diff --git a/.gitignore b/.gitignore index b8969b8..60f9580 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,10 @@ backend/node_modules/ backend/.env + +# macOS metadata +.DS_Store +._.DS_Store + +# Playwright artifacts +backend/playwright-report/ +backend/test-results/ diff --git a/PROJECT_SUMMARY.md b/PROJECT_SUMMARY.md new file mode 100644 index 0000000..4c6edbf --- /dev/null +++ b/PROJECT_SUMMARY.md @@ -0,0 +1,51 @@ +# HelpYourNeighbour Projektübersicht + +## Projektbeschreibung +HelpYourNeighbour ist ein Backend-System für eine Plattform zur Unterstützung von Nachbarn. Es ermöglicht Nutzern, Hilfeanfragen zu stellen und anzubieten, sowie Deals abzuschließen und Bewertungen auszutauschen. + +## Hauptfunktionen +1. **Authentifizierung**: Registrierung und Login +2. **Hilfeanfragen**: Erstellen und Auflisten von Anfragen +3. **Angebote**: Erstellen, Verhandeln und Akzeptieren von Angeboten +4. **Bewertungssystem**: 2-14 Tage Verzögerung für Bewertungen +5. **Adressmanagement**: Änderung von Adressen per Briefbestätigung +6. **Kontaktdaten-Austausch**: Nach Deal abgeschlossen + +## Datenbankschema +Das System verwendet ein MySQL-Datenbankschema mit folgenden Tabellen: +- users: Nutzerdaten +- help_requests: Hilfeanfragen +- offers: Angebote +- negotiations: Verhandlungen +- deals: Abschlüsse +- contact_exchange_requests: Kontaktanfragen +- addresses: Adressen +- address_change_requests: Adressänderungsanfragen +- reviews: Bewertungen + +## Technologie Stack +- Backend: Node.js mit Express +- Datenbank: MySQL +- Authentifizierung: JWT +- Verschlüsselung: AES-256-GCM für sensible Daten +- Validierung: Zod +- Tests: Playwright (Integration), Custom (Smoke) + +## Testumgebung +- Smoke-Tests funktionieren +- Integrationstests haben Playwright-Konfigurationsprobleme +- Docker-basierte Testumgebung vorhanden, aber keine lokale Docker-Installation + +## Konfiguration +Die .env.example zeigt die Produktionskonfiguration mit externer Datenbank: +- DB_HOST=80.74.142.125 +- DB_PORT=3306 +- DB_NAME=helpyourneighbour +- DB_USER=helpyourneighbour +- DB_PASSWORD=change-me + +## Nächste Schritte für Entwicklung +1. Lokale MySQL-Datenbank einrichten +2. Docker-Installation prüfen oder installieren +3. Testumgebung vollständig aufbauen +4. Integrationstests reparieren \ No newline at end of file diff --git a/README.md b/README.md index 5d2dff6..9996495 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,13 @@ npm run start - OpenAPI: `openapi.yaml` (Spiegel: `docs/openapi.yaml`) - Versioning/Deprecation Policy: `docs/api-versioning.md` - Rollen- und Rechtekonzept: `docs/roles-and-permissions.md` + +## Development Quickstart (auto-synced) + +```bash +cd backend +npm install +npm test +npm run start +``` + diff --git a/STATUS.md b/STATUS.md new file mode 100644 index 0000000..0edb19a --- /dev/null +++ b/STATUS.md @@ -0,0 +1,22 @@ +# Status des HelpYourNeighbour Projekts + +## Aktueller Stand +- Projekt ist ein Backend für eine Hilfeplattform mit Auth, Requests, Offers, Deals, Reviews, Address-Management +- Datenbank-Schema ist vollständig implementiert +- Backend verwendet Node.js mit Express, MySQL, bcryptjs, jsonwebtoken, zod +- Es gibt Test-Skripte für Smoke- und Integrationstests + +## Getestete Funktionen +- Smoke-Test erfolgreich: Syntax Checks OK +- Integrationstests fehlgeschlagen: Playwright-Konfigurationsfehler +- Datenbankinitialisierung fehlgeschlagen: Keine MySQL-Datenbank verfügbar + +## Verfügbare Konfigurationen +- .env.example zeigt Produktionskonfiguration für externe Datenbank +- Docker Compose Test-Umgebung vorhanden, aber keine lokale Docker-Installation + +## Nächste Schritte +1. Lokale MySQL-Datenbank einrichten für Entwicklung +2. Backend mit lokaler Datenbank testen +3. Integrationstests reparieren oder anpassen +4. Vollständige Entwicklungsumgebung aufbauen \ No newline at end of file diff --git a/backend/playwright.config.js b/backend/playwright.config.js index 35e3964..d2fc64f 100644 --- a/backend/playwright.config.js +++ b/backend/playwright.config.js @@ -1,9 +1,11 @@ -const { devices } = require('@playwright/test'); +const { defineConfig, devices } = require('@playwright/test'); -/** @type {import('@playwright/test').PlaywrightTestConfig} */ -const config = { - testDir: './scripts', +module.exports = defineConfig({ + testDir: './tests', timeout: 30000, + expect: { + timeout: 5000 + }, fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, @@ -17,9 +19,9 @@ const config = { projects: [ { name: 'chromium', - use: { ...devices['Desktop Chrome'] }, + use: { + ...devices['Desktop Chrome'], + }, }, ], -}; - -module.exports = config; \ No newline at end of file +}); \ No newline at end of file diff --git a/backend/playwright.config.mjs b/backend/playwright.config.mjs new file mode 100644 index 0000000..d063a8f --- /dev/null +++ b/backend/playwright.config.mjs @@ -0,0 +1,27 @@ +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests', + timeout: 30000, + expect: { + timeout: 5000 + }, + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + reporter: 'html', + use: { + actionTimeout: 0, + baseURL: 'http://localhost:3000', + trace: 'on-first-retry', + }, + projects: [ + { + name: 'chromium', + use: { + // ...devices['Desktop Chrome'], + }, + }, + ], +}); \ No newline at end of file diff --git a/backend/scripts/integration-test.mjs b/backend/scripts/integration-test.mjs index 25b652c..4cb2951 100644 --- a/backend/scripts/integration-test.mjs +++ b/backend/scripts/integration-test.mjs @@ -1,6 +1,24 @@ -import { test, expect } from '@playwright/test'; +// Einfacher HTTP-Test ohne Playwright +// Funktion zum Senden einer HTTP-Anfrage +async function testHealthEndpoint() { + try { + const response = await fetch('http://localhost:3000/health'); + if (response.status === 200) { + console.log('Integration test passed: API server is running and healthy'); + return true; + } else { + console.error(`Integration test failed: Expected status 200, got ${response.status}`); + return false; + } + } catch (error) { + console.error('Integration test failed:', error.message); + return false; + } +} -test('API server starts and returns 200', async ({ page }) => { - await page.goto('http://localhost:3000/api/health'); - await expect(page.status()).toBe(200); +// Führe den Test aus +testHealthEndpoint().then(success => { + if (!success) { + process.exit(1); + } }); \ No newline at end of file diff --git a/backend/tests/integration-test.spec.js b/backend/tests/integration-test.spec.js new file mode 100644 index 0000000..0cb61c0 --- /dev/null +++ b/backend/tests/integration-test.spec.js @@ -0,0 +1,7 @@ +import { test, expect } from '@playwright/test'; + +test('API server starts and returns 200', async ({ page }) => { + await page.goto('http://localhost:3000/api/health'); + const status = await page.status(); + expect(status).toBe(200); +}); \ No newline at end of file diff --git a/docs/plans/2026-03-06-bitte-arbeite-helpyourneighbour-weiter.md b/docs/plans/2026-03-06-bitte-arbeite-helpyourneighbour-weiter.md new file mode 100644 index 0000000..ed32c0e --- /dev/null +++ b/docs/plans/2026-03-06-bitte-arbeite-helpyourneighbour-weiter.md @@ -0,0 +1,26 @@ +# Goal Plan: Bitte arbeite an helpyourneighbour weiter + +- Project: helpyourneighbour +- Created: 2026-03-06T14:36:11Z +- Mode: general +- Source: user-intake + +## Goal +Bitte arbeite an helpyourneighbour weiter + +## Success Criteria +- [ ] Repo state refreshed +- [ ] Strongest available verification executed +- [ ] Goal brief written +- [ ] First concrete local target identified +- [ ] Result verified or precise blocker documented + +## Immediate Work Queue +- [ ] Refresh project snapshot for current goal +- [ ] Run the strongest available verification for current goal +- [ ] Create implementation brief for current goal +- [ ] Identify first concrete local change targets for current goal + +## Notes +- Created by `intake_goal`. +- This file is intentionally short; execution artifacts belong in `docs/runtime/`. diff --git a/docs/plans/2026-03-06-continue-working-the-helpyourneighbour-project-after.md b/docs/plans/2026-03-06-continue-working-the-helpyourneighbour-project-after.md new file mode 100644 index 0000000..78a759e --- /dev/null +++ b/docs/plans/2026-03-06-continue-working-the-helpyourneighbour-project-after.md @@ -0,0 +1,26 @@ +# Goal Plan: Continue working on the helpyourneighbour project after heartbeat + +- Project: helpyourneighbour +- Created: 2026-03-06T09:13:41Z +- Mode: general +- Source: user-intake + +## Goal +Continue working on the helpyourneighbour project after heartbeat + +## Success Criteria +- [ ] Repo state refreshed +- [ ] Strongest available verification executed +- [ ] Goal brief written +- [ ] First concrete local target identified +- [ ] Result verified or precise blocker documented + +## Immediate Work Queue +- [ ] Refresh project snapshot for current goal +- [ ] Run the strongest available verification for current goal +- [ ] Create implementation brief for current goal +- [ ] Identify first concrete local change targets for current goal + +## Notes +- Created by `intake_goal`. +- This file is intentionally short; execution artifacts belong in `docs/runtime/`. diff --git a/docs/plans/2026-03-06-implement-the-next-concrete-improvement-for.md b/docs/plans/2026-03-06-implement-the-next-concrete-improvement-for.md new file mode 100644 index 0000000..0e69844 --- /dev/null +++ b/docs/plans/2026-03-06-implement-the-next-concrete-improvement-for.md @@ -0,0 +1,26 @@ +# Goal Plan: Implement the next concrete improvement for the active project and keep working autonomously until the next precise blocker. + +- Project: helpyourneighbour +- Created: 2026-03-06T09:08:57Z +- Mode: coding +- Source: user-intake + +## Goal +Implement the next concrete improvement for the active project and keep working autonomously until the next precise blocker. + +## Success Criteria +- [ ] Repo state refreshed +- [ ] Strongest available verification executed +- [ ] Goal brief written +- [ ] First concrete local target identified +- [ ] Result verified or precise blocker documented + +## Immediate Work Queue +- [ ] Refresh project snapshot for current goal +- [ ] Run the strongest available verification for current goal +- [ ] Create implementation brief for current goal +- [ ] Identify first concrete local change targets for current goal + +## Notes +- Created by `intake_goal`. +- This file is intentionally short; execution artifacts belong in `docs/runtime/`. diff --git a/docs/plans/2026-03-06-initial-session-startup-and-greeting.md b/docs/plans/2026-03-06-initial-session-startup-and-greeting.md new file mode 100644 index 0000000..35adbbe --- /dev/null +++ b/docs/plans/2026-03-06-initial-session-startup-and-greeting.md @@ -0,0 +1,26 @@ +# Goal Plan: Initial session startup and greeting + +- Project: helpyourneighbour +- Created: 2026-03-06T09:33:28Z +- Mode: runtime +- Source: user-intake + +## Goal +Initial session startup and greeting + +## Success Criteria +- [ ] Repo state refreshed +- [ ] Strongest available verification executed +- [ ] Goal brief written +- [ ] First concrete local target identified +- [ ] Result verified or precise blocker documented + +## Immediate Work Queue +- [ ] Refresh project snapshot for current goal +- [ ] Run the strongest available verification for current goal +- [ ] Create implementation brief for current goal +- [ ] Identify first concrete local change targets for current goal + +## Notes +- Created by `intake_goal`. +- This file is intentionally short; execution artifacts belong in `docs/runtime/`. diff --git a/docs/plans/2026-03-06-nein-einfach-fortfahren-mit-der-arbeit.md b/docs/plans/2026-03-06-nein-einfach-fortfahren-mit-der-arbeit.md new file mode 100644 index 0000000..d7bed28 --- /dev/null +++ b/docs/plans/2026-03-06-nein-einfach-fortfahren-mit-der-arbeit.md @@ -0,0 +1,26 @@ +# Goal Plan: nein einfach fortfahren mit der arbeit + +- Project: helpyourneighbour +- Created: 2026-03-06T12:07:13Z +- Mode: general +- Source: user-intake + +## Goal +nein einfach fortfahren mit der arbeit + +## Success Criteria +- [ ] Repo state refreshed +- [ ] Strongest available verification executed +- [ ] Goal brief written +- [ ] First concrete local target identified +- [ ] Result verified or precise blocker documented + +## Immediate Work Queue +- [ ] Refresh project snapshot for current goal +- [ ] Run the strongest available verification for current goal +- [ ] Create implementation brief for current goal +- [ ] Identify first concrete local change targets for current goal + +## Notes +- Created by `intake_goal`. +- This file is intentionally short; execution artifacts belong in `docs/runtime/`. diff --git a/docs/plans/2026-03-06-start.md b/docs/plans/2026-03-06-start.md new file mode 100644 index 0000000..0cbf6fa --- /dev/null +++ b/docs/plans/2026-03-06-start.md @@ -0,0 +1,26 @@ +# Goal Plan: start + +- Project: helpyourneighbour +- Created: 2026-03-06T10:57:22Z +- Mode: runtime +- Source: user-intake + +## Goal +start + +## Success Criteria +- [ ] Repo state refreshed +- [ ] Strongest available verification executed +- [ ] Goal brief written +- [ ] First concrete local target identified +- [ ] Result verified or precise blocker documented + +## Immediate Work Queue +- [ ] Refresh project snapshot for current goal +- [ ] Run the strongest available verification for current goal +- [ ] Create implementation brief for current goal +- [ ] Identify first concrete local change targets for current goal + +## Notes +- Created by `intake_goal`. +- This file is intentionally short; execution artifacts belong in `docs/runtime/`.