https://github.com/aka-azad/study-buddies-server
This is the server side of Study Buddies web platform.
https://github.com/aka-azad/study-buddies-server
cookie-parser cors expressjs firebase-auth mongodb nodejs
Last synced: 2 months ago
JSON representation
This is the server side of Study Buddies web platform.
- Host: GitHub
- URL: https://github.com/aka-azad/study-buddies-server
- Owner: aka-azad
- Created: 2025-01-05T05:48:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-08T08:44:56.000Z (over 1 year ago)
- Last Synced: 2025-10-31T09:32:09.740Z (8 months ago)
- Topics: cookie-parser, cors, expressjs, firebase-auth, mongodb, nodejs
- Language: JavaScript
- Homepage: https://study-buddies-by-ashraf.web.app/
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Study Buddies Server
**Purpose**:
This server is designed to support the Study Buddies web application, which facilitates online group study with friends. The server handles user authentication, assignment management, and submission tracking.
**Live URL**:
[Study Buddies Server](https://study-buddies-by-ashraf.web.app)
## Key Features
- **User Authentication**: Utilizes JWT for secure user login and logout.
- **Assignment Management**: Supports creating, reading, updating, and deleting assignments.
- **Submission Tracking**: Allows users to submit assignments, view submission status, and manage submissions.
- **Protected Routes**: Uses middleware to verify tokens and protect certain routes.
- **Environment Variables**: Uses dotenv for managing environment-specific settings.
## Dependencies
The server uses the following npm packages:
- **express**
- **cors**
- **cookie-parser**
- **jsonwebtoken**
- **dotenv**
- **mongodb**
## API Endpoints
### Root Endpoint
- **GET /**: Check if the server is running.
### Authentication Endpoints
- **POST /login**: Logs in the user and provides a JWT token.
- **POST /logout**: Logs out the user and clears the JWT token.
### User Data Endpoints
- **POST /users**: Adds a new user to the database.
### Assignment Endpoints
- **POST /assignments**: Creates a new assignment.
- **GET /assignments**: Retrieves all assignments with optional search and filter.
- **GET /assignments/:id**: Retrieves a single assignment by ID.
- **PUT /assignments/:id**: Updates an assignment by ID.
- **DELETE /assignments/:id**: Deletes an assignment by ID.
### Submission Endpoints
- **POST /submissions**: Submits a new assignment.
- **GET /submissions/pending**: Retrieves all pending submissions.
- **GET /submissions**: Retrieves submissions by user email.
- **PATCH /submissions/:id**: Updates a submission by ID.
## Middleware
- **verifyToken**: Middleware to verify JWT tokens and protect routes.