https://github.com/yukti-says/student-management-api
Role-based Student Management REST API using Node.js, Express, MongoDB, JWT. Built with MVC structure, teacher & student features included.
https://github.com/yukti-says/student-management-api
backend expressjs jwt-authentication mongodb mongodb-atlas mvc nodejs restapi
Last synced: 2 months ago
JSON representation
Role-based Student Management REST API using Node.js, Express, MongoDB, JWT. Built with MVC structure, teacher & student features included.
- Host: GitHub
- URL: https://github.com/yukti-says/student-management-api
- Owner: yukti-says
- Created: 2025-06-30T07:45:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-30T08:26:27.000Z (about 1 year ago)
- Last Synced: 2025-06-30T08:44:15.676Z (about 1 year ago)
- Topics: backend, expressjs, jwt-authentication, mongodb, mongodb-atlas, mvc, nodejs, restapi
- Language: JavaScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Student Management System API
A role-based RESTful API built with Node.js, Express, and MongoDB for managing students, teachers, reports, and assignments โ using MVC architecture and JWT authentication.
---
## ๐ Features
- โ
**User Roles:** Teacher and Student
- โ
**JWT Authentication**
- โ
**Secure Routing with Role-based Access**
- โ
**Teachers can:**
- Add, Update, Delete, Get student by ID
- โ
**Students can:**
- View their Assignments by student ID
- โ
**Clean Folder Structure using MVC**
- โ
Built with: `Node.js`, `Express`, `MongoDB`, `Mongoose`
---
## Live Deployed
[https://student-management-api-w0gc.onrender.com](https://student-management-api-w0gc.onrender.com)
---
## PostMan Tests
## ๐ธ Screenshots
User Registration:
 |
User Login:
 |
---
## ๐งฑ Tech Stack
| Layer | Technology |
|-----------|------------------|
| Runtime | Node.js |
| Framework | Express.js |
| Database | MongoDB (Mongoose) |
| Auth | JWT + bcryptjs |
| Structure | MVC + Service Layer |
---
## ๐ Folder Structure
/backend
โโโ /models
โโโ /controllers
โโโ /routes
โโโ /services
โโโ /middlewares
โโโ /config
โโโ server.js
โโโ .env
---
## ๐ Roles
| Role | Access |
|---------|-------------------------------------------------|
| Teacher | Can add, delete, update, and search students |
| Student | Can view their assignments by ID |
---
## ๐งช API Endpoints
### ๐ Auth
- `POST /api/auth/register` โ Register with role (teacher/student)
- `POST /api/auth/login` โ Login and receive JWT
### ๐จโ๐ซ Teacher (Requires JWT + Role: teacher)
- `POST /api/teacher/add`
- `PUT /api/teacher/update/:id`
- `DELETE /api/teacher/delete/:id`
- `GET /api/teacher/student/:id`
- `GET /api/teacher/students` *(future enhancement)*
### ๐ฉโ๐ Student (Requires JWT + Role: student)
- `GET /api/student/assignments/:id`
---
## ๐ ๏ธ Setup & Run Locally
```bash
git clone https://github.com/yukti-says/student-management-api
cd student-management-api
npm install
```
### ๐ง Configure .env
```ini
PORT = 5000
MONGO_URI = "mongodb+srv://yuktiji:yuktiji@cluster0.a9q6ybi.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
JWT_SECRET = "yukti's good"
```
### โ
Run Project
```nodemon server.js```
## ๐ง Learnings
MVC structure and clean code practices
JWT authentication + role-based middleware
Real-world API structure using Node.js & MongoDB
How to handle routes securely with middlewares
## ๐ก Future Enhancements
Report model + view
Assignment submissions
PDF generation
MongoDB Atlas hosting
Admin panel UI
## ๐ค Connect with Me
Yukti Sahu