REST v1Employee, department, and project resources.
ODataFilter, select, sort, page, count, and expand.
JWTUSER reads and ADMIN writes.
Live Endpoints
| Method | Path | Auth | Purpose |
|---|---|---|---|
| POST | /api/v1/auth/login |
Public | Get a JWT access token |
| GET | /api/v1/employees |
USER or ADMIN | List employees with departments and projects |
| POST | /api/v1/employees |
ADMIN | Create a new employee |
| GET | /api/v1/departments |
USER or ADMIN | Reference data for departments |
| GET | /api/v1/projects |
USER or ADMIN | Reference data for projects |
| GET | /odata/v1/Employees |
USER or ADMIN | Composable OData-style employee queries |
Demo Flow
Login at POST /api/v1/auth/login with admin@example.com and Admin123!, then use the returned bearer token in Swagger.
Try GET /odata/v1/Employees?$filter=active eq true&$select=employeeId,firstName,lastName,title&$top=5&$count=true for a compact reporting query.
Run npm run seed before demos so departments, projects, and employees are available in MongoDB.
Use user@example.com and User123! to demonstrate read-only access and ADMIN-only write protection.
Quick Login Request
curl -X POST http://localhost:3000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d "{\"email\":\"admin@example.com\",\"password\":\"Admin123!\"}"