API Reference In Progress¶
REST API¶
The backend API is available under /api/. All endpoints except register and login require a Bearer JWT in the Authorization header.
| Method | Endpoint | Auth needed | Description |
|---|---|---|---|
| POST | /api/auth/register |
No | Create a new account |
| POST | /api/auth/login |
No | Log in and get a JWT token |
| GET | /api/user/me |
Yes | Get your profile and stats |
| POST | /api/session/start |
Yes | Launch a simulation container |
| POST | /api/session/stop |
Yes | Stop the running container |
| GET | /api/session/status |
Yes | Check current session info |
| POST | /api/results |
Yes | Save an activity result and award badges |
| GET | /api/leaderboard |
Yes | Get ranked scores |
🚧
Being Written
This tab will provide full request and response schemas for the auth endpoints.
- POST /api/auth/register: required fields, validation rules, error codes
- POST /api/auth/login: OAuth2 password flow, JWT format and expiry
- Token refresh strategy
- Error response format
🚧
Being Written
This tab will document the session management endpoints.
- POST /api/session/start: activity parameter, response shape including assigned ports
- POST /api/session/stop: graceful container teardown
- GET /api/session/status: running state, ports, activity name
- Port assignment scheme
- Concurrent session handling
🚧
Being Written
This tab will detail the results and leaderboard endpoints.
- POST /api/results: score, duration, status fields; badge award logic
- GET /api/leaderboard: activity filter, limit parameter, response schema
- Badge award conditions and thresholds
- Score calculation per activity