Backend is live at: https://fall2025-assignment-6-v2.wm.r.appspot.com/
| # | Functionality | Method | Endpoint | Protection | Description |
|---|---|---|---|---|---|
| 1 | User login | POST | /users/login | Pre-created Auth0 users | Users authenticate with username and password. Auth0 issues JWTs. |
| 2 | Get all users | GET | /users | Admin only | Summary information of all 9 users. No avatar or course info. |
| 3 | Get a user | GET | /users/:id | Admin or user with matching JWT | Detailed user info, including avatar (if any) and courses (for instructors and students). |
| 4 | Create/update a user’s avatar | POST | /users/:id/avatar | User with matching JWT | Upload avatar file to Google Cloud Storage. |
| 5 | Get a user’s avatar | GET | /users/:id/avatar | User with matching JWT | Read and return avatar file from Google Cloud Storage. |
| 6 | Delete a user’s avatar | DELETE | /users/:id/avatar | User with matching JWT | Delete avatar file from Google Cloud Storage. |
| 7 | Create a course | POST | /courses | Admin only | Create a course. |
| 8 | Get all courses | GET | /courses | Unprotected | Paginated using offset/limit (page size 3). Ordered by subject. Does not return enrollment info. |
| 9 | Get a course | GET | /course/:id | Unprotected | Does not return enrollment info. |
| 10 | Update a course | PATCH | /course/:id | Admin only | Partial update of course fields. |
| 11 | Delete a course | DELETE | /course/:id | Admin only | Delete course and associated enrollment info. |
| 12 | Update enrollment in a course | PATCH | /courses/:id/students | Admin or course instructor | Enroll or disenroll students in the course. |
| 13 | Get enrollment for a course | GET | /courses/:id/students | Admin or course instructor | Retrieve all students enrolled in the course. |