After enabling GitHub Pages (see deployment.md), the backend docs site includes MkDocs pages and static ReDoc at redoc.html (no running server required).
Start the API server:
cd backend
uv run uvicorn app.main:app --reload --port 8000Then open:
| UI | URL | Best for |
|---|---|---|
| Swagger UI | http://localhost:8000/docs | Trying endpoints, seeing request/response schemas |
| ReDoc | http://localhost:8000/redoc | Reading grouped reference documentation |
| OpenAPI JSON | http://localhost:8000/openapi.json | Codegen, Postman import, CI |
All business routes live under http://localhost:8000/api/v1 (configurable via API_PREFIX).
The root http://localhost:8000/ returns links to these UIs and GET /health reports ML model load status.
For every operation you get:
- Summary — from the route function name / docstring
- Parameters — query, path, and headers
- Request body — JSON schema from Pydantic models in
backend/app/schemas/ - Responses — status codes and response models (
200,201,422, …)
Example: POST /api/v1/students
- Input:
StudentCreate—name,roll_number,password(min 6),department_id, optionalprogram_id,semester,branch - Output:
201+StudentResponse—id,roll_number,name,department_id,program_id,semester,branch,section
Schemas are defined once in Python and stay in sync with the running API.
- Call
POST /api/v1/auth/loginwith JSON body, for example:
{
"identifier": "admin@demo.com",
"password": "admin123",
"role": "institution_admin"
}- The response sets httpOnly cookies in the browser.
- Other endpoints in the same browser tab use those cookies automatically.
For faculty use role: "faculty" and faculty email; for students use role: "student" and roll number as identifier.
A full endpoint list with parameter and body tables is generated from OpenAPI:
cd backend
uv run python scripts/generate_api_docs.pyOutput: api-reference.generated.md
Regenerate after adding or changing routes/schemas.
Shorter hand-maintained index: api.md.
Conventions (pagination, errors, tenancy): api-conventions.md.
Backend layout: backend-structure.md.