POST /api/auth/register
- Description: Register a new user.
- Request Body:
{ "username": "string", "email": "string", "password": "string" }
- Response:
{ "message": "User registered successfully", "userId": "string" }
POST /api/auth/login
- Description: Authenticate a user.
- Request Body:
{ "email": "string", "password": "string" }
- Response:
{ "token": "string", "user": { "id": "string", "username": "string", "email": "string" } }
POST /api/auth/logout
- Description: Log out a user.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "message": "Logout successful" }
GET /api/profile/:userId
- Description: Retrieve user profile information.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "id": "string", "username": "string", "email": "string", "skills": ["string"], "bio": "string", "portfolio": ["string"] }
PUT /api/profile/:userId
- Description: Update profile details.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "skills": ["string"], "bio": "string", "portfolio": ["string"] }
- Response:
{ "message": "Profile updated successfully" }
POST /api/sessions
- Description: Schedule a new session.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "mentorId": "string", "skill": "string", "dateTime": "ISO_8601 string", "duration": "integer (minutes)" }
- Response:
{ "message": "Session created successfully", "sessionId": "string" }
GET /api/sessions
- Description: Get all scheduled sessions for the authenticated user.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
[ { "sessionId": "string", "mentorId": "string", "skill": "string", "dateTime": "ISO_8601 string", "duration": "integer (minutes)", "status": "string" } ]
PUT /api/sessions/:sessionId
- Description: Update session details.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "dateTime": "ISO_8601 string", "duration": "integer (minutes)", "status": "string" }
- Response:
{ "message": "Session updated successfully" }
GET /api/forum
- Description: Retrieve all discussion threads.
- Response:
[ { "threadId": "string", "title": "string", "author": "string", "createdAt": "ISO_8601 string" } ]
POST /api/forum
- Description: Create a new discussion thread.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "title": "string", "content": "string" }
- Response:
{ "message": "Thread created successfully", "threadId": "string" }
GET /api/gamification/leaderboard
- Description: Retrieve the top mentors and learners leaderboard.
- Response:
[ { "userId": "string", "username": "string", "points": "integer" } ]