This is the backend for the Stud-Com platform, a system designed to facilitate study groups, resource sharing, and progress tracking. The backend is built using Node.js and Express, with MongoDB as the database and Socket.IO for real-time communication.
All API endpoints are relative to http://local_ip:3000
Most endpoints require a JWT token for authentication. This token should be included in the request body as the token
field.
- User Management
- Study Group Management
- Resource Management
- Node.js
- MongoDB
- Clone the repository
- Navigate to the backend directory
- Install dependencies:
npm install
- Set up your environment variables (create a
.env
file) - Start the server:
npm run dev
- URL:
/signup
- Method: POST
- Body:
{ "username": "string", "email": "string", "password": "string" }
- URL:
/signin
- Method: POST
- Body:
{ "email": "string", "password": "string" }
- URL:
/api/fetchUser
- Method: POST
- Body:
{ "userID": "string" }
- URL:
/api/createCommunity
- Method: POST
- Body:
{ "token": "string", "communityName": "string", "tags": ["string"] }
- URL:
/api/createChannel
- Method: POST
- Body:
{ "communityID": "string", "channelName": "string" }
(Additional endpoints for Study Group Management are available in the full API documentation)
- URL:
/progressTrack
- Method: POST
- Body:
{ "token": "string", "commnuityID": "string", "channelID": "string", "liveTask": ["string"], "subtask": ["string"] }
(Additional endpoints for Resource Management are available in the full API documentation)
The backend includes a Socket.IO server for real-time communication. Key events include:
signin
: User sign-inmessagep2c
: Messages from user to communitymessagep2p
: Direct messages between users
The backend uses MongoDB with the following main collections:
- Users
- Communities
- Channels
- Chats
- P2P Chats
- Progress
Detailed schema information is available in the full documentation.
The API uses standard HTTP status codes for error responses. Common error codes include:
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 500: Internal Server Error