|
| 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> |
0 commit comments