Backend API
The NeuroLab backend is an Express service that owns authentication, user and doctor workflows, appointments, uploads, reports, billing, notifications, and chat orchestration.
This page is an overview of the current route surface. For the full request and response schema details, use the generated Swagger UI exposed by the backend itself.
Base URL
- Local:
http://localhost:5000 - Swagger UI:
http://localhost:5000/api-docs - OpenAPI JSON:
http://localhost:5000/api-docs.json
The backend root endpoint is:
GET /
It returns a basic service status payload.
Authentication
Authentication routes are mounted under:
/api/auth
Current auth routes include:
POST /api/auth/registerPOST /api/auth/loginPOST /api/auth/refreshPOST /api/auth/logoutGET /api/auth/verify-email/:tokenPOST /api/auth/request-password-resetPOST /api/auth/reset-password/:token
Example login request:
POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "yourpassword"
}
Example login response shape:
{
"message": "Login successful",
"accessToken": "jwt-access-token",
"refreshToken": "jwt-refresh-token",
"user": {
"id": "user-id",
"fullName": "John Doe",
"username": "johndoe",
"email": "user@example.com",
"role": "USER"
}
}
Primary Route Groups
The backend currently mounts the following route prefixes:
/api/auth/api/users/api/admin/api/doctors/api/devices/api/sessions/api/analysis/api/reviews/api/uploads/api/reports/api/appointments/api/calendar/api/notifications/api/clinics/api/billing/api/chat
Appointments
Appointments are mounted under:
/api/appointments
Notable routes include:
GET /api/appointments/GET /api/appointments/doctorsGET /api/appointments/doctors/searchGET /api/appointments/doctor/meGET /api/appointments/user/me
This area is broader than a single create/list pair. The backend supports patient, doctor, scheduling, and calendar-oriented appointment flows.
Uploads
Uploads are mounted under:
/api/uploads
Current documented routes include:
POST /api/uploads/uploadGET /api/uploads/GET /api/uploads/:uploadIdGET /api/uploads/:uploadId/accessDELETE /api/uploads/:uploadId
The upload route uses multipart/form-data with a file field.
Reports
Reports are mounted under:
/api/reports
Current documented routes include:
POST /api/reports/GET /api/reports/GET /api/reports/:reportIdGET /api/reports/:reportId/accessGET /api/reports/:reportId/events
Report generation is modeled as a queued workflow rather than a single synchronous generate endpoint.
Chat
Chat is mounted under:
/api/chat
The backend chat API is conversation-based and supports both synchronous and queued AI responses.
Notable routes include:
POST /api/chat/conversationsGET /api/chat/conversationsGET /api/chat/conversations/:id/messagesPOST /api/chat/conversations/:id/messagesPOST /api/chat/conversations/:id/messages/submitPATCH /api/chat/conversations/:idDELETE /api/chat/conversations/:idPOST /api/chat/conversations/:id/refresh-titleGET /api/chat/jobs/:jobId/statusGET /api/chat/jobs/:jobId/sse
Use the submit and sse endpoints when you want asynchronous AI processing with job status and event streaming.
Devices, Analysis, and Other Domains
Additional route groups are active for:
- users and profile management
- admin operations
- doctors and patient workflows
- devices and device status
- session tracking
- analysis orchestration
- reviews
- notifications
- clinics
- billing
- calendar integrations
Those areas are part of the live backend surface even if they are not fully expanded on this page yet.
Notes
- Global rate limiting is enabled.
- Most application routes are mounted under
/api/*. - Swagger is the best current source of truth for backend request and response schemas.
- If this page and Swagger disagree, trust Swagger and the route files in
backend/routes.