A full-stack Student Management System built with Node.js, Express.js, and MongoDB Atlas. Features a professional admin dashboard UI with complete CRUD operations, aggregation reports, and REST API.
Production URL: https://student-management-system-gray-beta.vercel.app
- Dashboard — Stats overview (total students, courses, average marks, top score)
- Students Management — Add, view, edit, delete students with modal forms
- Courses Management — Full CRUD for courses
- Performance Reports — Aggregation pipeline showing per-course averages and grades
- Responsive UI — Works on desktop and mobile
- REST API — Full JSON API for all operations
| Layer | Technology |
|---|---|
| Runtime | Node.js 18+ |
| Framework | Express.js 5 |
| Database | MongoDB Atlas (Mongoose) |
| Frontend | Vanilla HTML/CSS/JS |
| Deployment | Vercel |
| Dev Tool | Nodemon |
Student-Management-System/
├── config/
│ └── database.js # MongoDB connection (cached for serverless)
├── controllers/
│ ├── studentController.js # Student CRUD + aggregation
│ └── courseController.js # Course CRUD
├── models/
│ ├── Student.js # Mongoose student schema
│ └── Course.js # Mongoose course schema
├── public/
│ └── index.html # Frontend dashboard SPA
├── routes/
│ ├── studentRoutes.js # /api/students routes
│ └── courseRoutes.js # /api/courses routes
├── .env # Environment variables (not committed)
├── .gitignore
├── package.json
├── server.js # App entry point
└── vercel.json # Vercel deployment config
- Node.js 18+
- MongoDB Atlas account
- npm or yarn
-
Clone the repository
git clone https://github.com/deepmaha2006/StudentManagementSystem.git cd StudentManagementSystem -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root:PORT=5000 MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.xxxxx.mongodb.net/StudentDB?retryWrites=true&w=majority
-
Start the development server
npm run dev
-
Open your browser
http://localhost:5000
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/students |
Get all students |
| GET | /api/students/:id |
Get student by ID |
| POST | /api/students |
Create a new student |
| PUT | /api/students/:id |
Update student by ID |
| DELETE | /api/students/:id |
Delete student by ID |
| GET | /api/students/reports/course-performance |
Aggregation report |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/courses |
Get all courses |
| GET | /api/courses/:id |
Get course by ID |
| POST | /api/courses |
Create a new course |
| PUT | /api/courses/:id |
Update course by ID |
| DELETE | /api/courses/:id |
Delete course by ID |
Create Student — POST /api/students
{
"studentId": 108,
"name": "Kiran Kumar",
"age": 21,
"courseId": "CS101",
"marks": 86
}Create Course — POST /api/courses
{
"_id": "AI101",
"courseName": "Artificial Intelligence",
"department": "Computer Science",
"credits": 4
}Course Performance Report — GET /api/students/reports/course-performance
[
{
"courseId": "CS101",
"courseName": "Computer Science",
"totalStudents": 3,
"averageMarks": 85
}
]| Field | Type | Required | Constraints |
|---|---|---|---|
| studentId | Number | Yes | Unique |
| name | String | Yes | Trimmed |
| age | Number | Yes | Min: 1 |
| courseId | String | Yes | Trimmed |
| marks | Number | Yes | Min: 0, Max: 100 |
| Field | Type | Required | Constraints |
|---|---|---|---|
| _id | String | Yes | e.g. "CS101" |
| courseName | String | Yes | Unique, Trimmed |
| department | String | Yes | |
| credits | Number | Yes |
- Push code to GitHub
- Connect repository on Vercel
- Set environment variable
MONGODB_URIin Vercel project settings - Deploy
Or deploy via CLI:
npx vercel --prodnpm start # Start production server
npm run dev # Start with nodemon (auto-reload)| Variable | Description | Required |
|---|---|---|
PORT |
Server port (default: 5000) | No |
MONGODB_URI |
MongoDB Atlas connection string | Yes |
MIT License — feel free to use and modify.
Deepesh — GitHub