Files
calchat/docs/api-routes.md
Linus Waldowsky 105a9a4980 implement auth login and register with MongoDB
- Add AuthController login/register endpoints with error handling
- Implement AuthService with password validation and user creation
- Add MongoUserRepository with findByEmail and create methods
- Implement password hashing with bcrypt
- Add dotenv for environment variable support
- Add Docker Compose setup for MongoDB + Mongo Express
- Stub AuthMiddleware with fake user for testing
- Update CLAUDE.md with implementation status
2026-01-03 16:47:11 +01:00

55 lines
1.5 KiB
Markdown

# CalChat API Routes
Base URL: `/api`
## Authentication
### Auth Endpoints (`/api/auth`)
Öffentliche Endpoints - keine Authentifizierung erforderlich.
| Method | Endpoint | Beschreibung |
|--------|----------|--------------|
| POST | `/auth/login` | User Login |
| POST | `/auth/register` | User Registrierung |
| POST | `/auth/refresh` | JWT Token erneuern |
| POST | `/auth/logout` | User Logout |
---
## Events
### Event Endpoints (`/api/events`)
Alle Endpoints erfordern JWT-Authentifizierung.
| Method | Endpoint | Beschreibung |
|--------|----------|--------------|
| GET | `/events` | Alle Events des Users abrufen |
| GET | `/events/range` | Events nach Zeitraum filtern |
| GET | `/events/:id` | Einzelnes Event abrufen |
| POST | `/events` | Neues Event erstellen |
| PUT | `/events/:id` | Event aktualisieren |
| DELETE | `/events/:id` | Event löschen |
---
## Chat
### Chat Endpoints (`/api/chat`)
Alle Endpoints erfordern JWT-Authentifizierung.
| Method | Endpoint | Beschreibung |
|--------|----------|--------------|
| POST | `/chat/message` | Nachricht an AI senden |
| POST | `/chat/confirm/:conversationId/:messageId` | Vorgeschlagenes Event bestätigen |
| POST | `/chat/reject/:conversationId/:messageId` | Vorgeschlagenes Event ablehnen |
| GET | `/chat/conversations` | Alle Konversationen abrufen |
| GET | `/chat/conversations/:id` | Nachrichten einer Konversation (mit Pagination) |
---
## Health
| Method | Endpoint | Beschreibung |
|--------|----------|--------------|
| GET | `/health` | Health Check |