Skip to content
Yshareef edited this page May 13, 2025 · 1 revision

Routes Documentation


Authentication Routes

Google OAuth Routes

GET /auth/google

Initiates Google OAuth login process.

Redirects to Google consent screen.


GET /auth/google/callback

Handles Google OAuth callback.

Creates or updates user session.

Redirects to dashboard.


GET /auth/logout

Destroys user session.

Redirects to home page.


Session Management

GET /auth/status

Returns current session status.

POST /auth/refresh

Refreshes user session.

Requires valid session cookie.


Course Routes

Course Management

GET /api/courses

Returns list of all courses.

GET /api/courses/:id

Returns detailed course information. Includes student list and videos.

POST /api/courses

Creates new course. Requires authentication.

PUT /api/courses/:id

Updates course information. Requires course admin privileges.

DELETE /api/courses/:id

Deletes course. Requires course admin privileges.


Course Enrollment

POST /api/courses/:id/enroll

Adds user to course students. Requires authentication.

POST /api/courses/:id/leave

Removes user from course students. Requires authentication.

GET /api/courses/:id/students

Returns list of course students.


Course Progress

POST /api/courses/:id/videos/:videoId/complete

Marks video as complete for student. Requires course enrollment.

GET /api/courses/:id/progress

Returns student's course progress. Includes completed videos and overall progress.


Notes Routes

Notes Management

GET /api/notes

Returns list of user's notes.

GET /api/notes/:id

Returns detailed note information.

POST /api/notes

Creates new note.

Requires authentication.

PUT /api/notes/:id

Updates note information.

Requires note owner privileges.

DELETE /api/notes/:id

Deletes note. Requires note owner privileges.


Profile Routes

User Profile

GET /api/profile

Returns user profile information. Requires authentication.

PUT /api/profile

Updates user profile. Requires authentication.

DELETE /api/profile

Deletes user account. Requires authentication. Requires password confirmation.

GET /api/profile/progress

Returns user's overall learning progress. Includes completed courses and videos.


Error Handling

All routes follow standard HTTP status codes and return error responses in the format:

Common error codes:

AUTH_REQUIRED: Authentication required

INVALID_CREDENTIALS: Invalid login credentials

PERMISSION_DENIED: Insufficient permissions

RESOURCE_NOT_FOUND: Requested resource not found

VALIDATION_ERROR: Invalid request data

SERVER_ERROR: Internal server error