Skip to content

Commit 60b2fba

Browse files
author
2307062csit-coder
committed
Initial commit of Student management system
0 parents  commit 60b2fba

59 files changed

Lines changed: 8556 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI Build Pipeline
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
cache-dependency-path: |
26+
backend/package-lock.json
27+
frontend/package-lock.json
28+
29+
- name: Install backend dependencies
30+
working-directory: ./backend
31+
run: npm ci
32+
33+
- name: Install frontend dependencies
34+
working-directory: ./frontend
35+
run: npm ci
36+
37+
- name: Build frontend
38+
working-directory: ./frontend
39+
run: npm run build

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Backend
2+
backend/node_modules
3+
backend/.env
4+
5+
# Frontend
6+
frontend/node_modules
7+
frontend/dist
8+
frontend/.env
9+
10+
# OS
11+
.DS_Store
12+
Thumbs.db
13+
14+
# Logs
15+
*.log
16+
npm-debug.log*
17+
18+
# Root
19+
node_modules

README.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# 🎓 EduManage — Student Management System
2+
3+
<div align="center">
4+
<img src="https://img.shields.io/badge/MERN-Stack-6366f1?style=for-the-badge" />
5+
<img src="https://img.shields.io/badge/React-18-61DAFB?style=for-the-badge&logo=react" />
6+
<img src="https://img.shields.io/badge/Node.js-Express-339933?style=for-the-badge&logo=node.js" />
7+
<img src="https://img.shields.io/badge/MongoDB-Mongoose-47A248?style=for-the-badge&logo=mongodb" />
8+
<img src="https://img.shields.io/badge/TailwindCSS-3.x-38B2AC?style=for-the-badge&logo=tailwind-css" />
9+
</div>
10+
11+
<br />
12+
13+
A **full-stack, role-based Student Management System** built with the MERN stack (MongoDB, Express.js, React.js, Node.js) and styled with Tailwind CSS. Features a modern dark glassmorphism UI with three distinct role dashboards — Admin, Teacher, and Student.
14+
15+
---
16+
17+
## ✨ Features
18+
19+
### 🔐 Role-Based Access Control (RBAC)
20+
| Feature | Admin | Teacher | Student |
21+
|---|---|---|---|
22+
| Manage All Users ||||
23+
| Create / Delete Courses ||||
24+
| Mark Attendance ||||
25+
| Enter Grades ||||
26+
| View Own Grades ||||
27+
| View Own Attendance ||||
28+
29+
### 📊 Admin Dashboard
30+
- System overview stats (users, students, teachers, courses)
31+
- Interactive Recharts bar & pie charts
32+
- Full User CRUD with role filters and search
33+
- Course management with teacher assignment
34+
35+
### 👨‍🏫 Teacher Dashboard
36+
- Assigned courses with student rosters
37+
- Bulk attendance marking with one-click "All Present / All Absent"
38+
- Grade entry with live table preview and letter grade calculation
39+
40+
### 🎓 Student Dashboard
41+
- Grade progress bars per course with letter grades (A+ to F)
42+
- Attendance tracker with present/absent/late breakdown
43+
- Enrolled courses grid with teacher info
44+
- Personal profile page
45+
46+
---
47+
48+
## 🚀 Quick Start
49+
50+
### Prerequisites
51+
- Node.js >= 18.x
52+
- MongoDB (local or Atlas)
53+
- npm
54+
55+
### 1. Clone the repository
56+
```bash
57+
git clone https://github.com/nikita827009-source/Student-management-system.git
58+
cd Student-management-system
59+
```
60+
61+
### 2. Backend Setup
62+
```bash
63+
cd backend
64+
npm install
65+
```
66+
67+
Create a `.env` file in the `/backend` directory:
68+
```env
69+
PORT=5000
70+
MONGO_URI=mongodb://localhost:27017/sms_db
71+
JWT_SECRET=your_super_secret_jwt_key_here
72+
JWT_EXPIRES_IN=1d
73+
NODE_ENV=development
74+
```
75+
76+
Start the backend server:
77+
```bash
78+
npm run dev
79+
```
80+
81+
### 3. Frontend Setup
82+
```bash
83+
cd ../frontend
84+
npm install
85+
npm run dev
86+
```
87+
88+
The app will be available at **http://localhost:5173**
89+
90+
---
91+
92+
## 🧱 Tech Stack
93+
94+
| Layer | Technology |
95+
|---|---|
96+
| Frontend | React 18, Vite, React Router v6 |
97+
| Styling | Tailwind CSS 3, custom glassmorphism utilities |
98+
| Charts | Recharts |
99+
| HTTP Client | Axios (with interceptors) |
100+
| Backend | Node.js, Express.js |
101+
| Database | MongoDB, Mongoose ODM |
102+
| Auth | JWT (JSON Web Tokens), bcryptjs |
103+
104+
---
105+
106+
## 📁 Project Structure
107+
108+
```
109+
student-management-system/
110+
├── backend/
111+
│ └── src/
112+
│ ├── config/ # DB connection
113+
│ ├── controllers/ # auth, user, course, attendance, grade
114+
│ ├── middlewares/ # protect, authorize (RBAC)
115+
│ ├── models/ # User, Course, Attendance, Grade
116+
│ ├── routes/ # All API routes
117+
│ ├── utils/ # generateToken
118+
│ └── server.js
119+
└── frontend/
120+
└── src/
121+
├── components/ # Sidebar, ProtectedRoute
122+
├── context/ # AuthContext
123+
├── layouts/ # DashboardLayout
124+
├── pages/
125+
│ ├── admin/ # Dashboard, Users, Students, Teachers, Courses
126+
│ ├── teacher/ # Dashboard, Courses, Attendance, Grades
127+
│ └── student/ # Dashboard, Courses, Grades, Attendance, Profile
128+
├── services/ # Axios API instance
129+
└── App.jsx # Router
130+
```
131+
132+
---
133+
134+
## 🔌 API Endpoints
135+
136+
### Auth
137+
| Method | Route | Access |
138+
|---|---|---|
139+
| POST | `/api/auth/login` | Public |
140+
| POST | `/api/auth/register` | Public |
141+
| GET | `/api/auth/me` | Private |
142+
143+
### Users
144+
| Method | Route | Access |
145+
|---|---|---|
146+
| GET | `/api/users` | Admin |
147+
| POST | `/api/users` | Admin |
148+
| GET | `/api/users/students` | Admin, Teacher |
149+
| GET | `/api/users/teachers` | Admin |
150+
| PUT | `/api/users/:id` | Admin |
151+
| DELETE | `/api/users/:id` | Admin |
152+
153+
### Courses
154+
| Method | Route | Access |
155+
|---|---|---|
156+
| GET | `/api/courses` | All (filtered by role) |
157+
| POST | `/api/courses` | Admin |
158+
| PUT | `/api/courses/:id` | Admin |
159+
| DELETE | `/api/courses/:id` | Admin |
160+
| POST | `/api/courses/:id/enroll` | Admin |
161+
162+
### Attendance
163+
| Method | Route | Access |
164+
|---|---|---|
165+
| POST | `/api/attendance` | Teacher, Admin |
166+
| POST | `/api/attendance/bulk` | Teacher, Admin |
167+
| GET | `/api/attendance/course/:id` | Teacher, Admin |
168+
| GET | `/api/attendance/student/:id` | All |
169+
| GET | `/api/attendance/summary/:id` | All |
170+
171+
### Grades
172+
| Method | Route | Access |
173+
|---|---|---|
174+
| POST | `/api/grades` | Teacher, Admin |
175+
| GET | `/api/grades/course/:id` | Teacher, Admin |
176+
| GET | `/api/grades/student/:id` | All |
177+
| GET | `/api/grades/summary/:id` | All |
178+
| DELETE | `/api/grades/:id` | Admin |
179+
180+
---
181+
182+
## 🛡️ Security
183+
- JWT authentication with HTTP Authorization headers
184+
- Passwords hashed with bcryptjs (salt rounds: 10)
185+
- RBAC middleware enforced on every protected endpoint
186+
- Frontend route guards with role validation
187+
188+
---
189+
190+
## 📜 License
191+
MIT License. Feel free to use, modify, and distribute.
192+
193+
---
194+
195+
<div align="center">
196+
Built with ❤️ using the MERN Stack
197+
</div>

backend/.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.env
3+
npm-debug.log
4+
Dockerfile
5+
.dockerignore
6+
.git
7+
.gitignore

backend/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
EXPOSE 5000
12+
13+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)