-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Base URL: /api/v1
Auth: HTTP-only cookie auth_token (set by /signin). Send credentials: "include" on all requests.
Responses: JSON. Keys are snake_case from the server; apiClient.ts converts to camelCase automatically for the frontend.
Errors: { "detail": "message" } with standard HTTP status codes.
Create a new account. Restricted to @post.jce.ac.il email domain.
Body:
{
"username": "Laith Mimi",
"email": "laith@post.jce.ac.il",
"password": "SecurePass1!",
"password_confirm": "SecurePass1!",
"major_id": "uuid"
}
Password policy: ≥8 chars, 1 uppercase, 1 number, 1 special character.
Response: 200 — User object. Email verification email sent by Auth0.
Sign in. Sets the auth_token HttpOnly cookie.
Body:
{ "email": "...", "password": "...", "remember_me": false }
remember_me: true extends cookie lifetime to 30 days (default: 24h).
Response: 200 — { "user": User }
Errors: 401 wrong password / 403 email not verified / 404 account not found
Clears the auth_token cookie.
Response: 200 — { "message": "Logged out successfully" }
Triggers Auth0 password reset email. Always returns success (prevents email enumeration).
Body: { "email": "..." }
Response: 200 — generic success message
Returns the current user's profile derived from the JWT cookie. Used by the frontend boot reconciliation to verify role server-side.
Response: 200 — User
Errors: 401 no cookie / 403 user not in local DB
Returns all majors. Cached indefinitely in frontend.
Returns all material types (Slides, Exam, Lecture Notes, etc.).
Returns static year labels: [{ id: "1", label: "Freshman (Year 1)" }, ...]
Returns static semester labels.
Query params: major_id (UUID), year_id (int), query (string)
Returns matching courses. Requires auth.
Single course. Returns 404 if not found.
Query param: course_id (optional; currently returns all regardless)
Query params: course_id, type_id, lecturer_id, search
Returns approved materials. Empty array if course_id not provided.
Returns file metadata + a 15-minute GCS signed download_url.
Streams raw PDF bytes via GCS proxy. Used by the PDF viewer.
Content-Type: multipart/form-data
| Field | Type | Required |
|---|---|---|
| title | string | Yes |
| academic_year | int (1–4) | Yes |
| material_year | int (e.g. 2023) | Yes |
| type_id | UUID | Yes |
| lecturer_id | UUID | Yes |
| notes | string | No |
| file | binary | Yes |