A full-stack web application for managing student records with secure authentication, role-based authorization, and administrative CRUD operations.
Live Demo: https://vishwajit1610.github.io/college-management-system/
Repository: https://github.com/Vishwajit1610/college-management-system
Email: student@college.com
Password: student123
Email: admin@college.com
Password: admin123
- JWT-based authentication with secure session management
- Role-based access control (RBAC)
- Secure password hashing using bcrypt
- Student record management through REST APIs
- Protected backend routes using authentication middleware
- Admin-only write operations
- MongoDB persistence using Mongoose
- Single-page React application with client-side routing
- API testing and validation using Postman
| Layer | Technology |
|---|---|
| Frontend | React, Vite |
| Routing | React Router |
| HTTP Client | Axios |
| Backend | Node.js, Express |
| Database | MongoDB, Mongoose |
| Authentication | JWT, bcryptjs |
| API Testing | Postman |
| Deployment | GitHub Pages |
User
│
▼
React Frontend
│
Axios Requests
│
▼
Express REST API
│
┌───────────┴───────────┐
│ │
▼ ▼
Authentication Student Management
├── Signup ├── GET /students
└── Login ├── POST /students
├── PUT /students/:id
└── DELETE /students/:id
│
▼
MongoDB Database
User Login
│
▼
Find User by Email
│
▼
bcrypt Password Verification
│
▼
Generate JWT Token
│
▼
Token Stored on Client
│
▼
Protected API Request
│
▼
JWT Verification Middleware
│
▼
Role Validation Middleware
│
▼
Authorized Resource Access
| Action | Student | Admin |
|---|---|---|
| Login | ✓ | ✓ |
| View Students | ✓ | ✓ |
| Create Student | ✗ | ✓ |
| Update Student | ✗ | ✓ |
| Delete Student | ✗ | ✓ |
POST /signup
POST /loginGET /students
POST /students
PUT /students/:id
DELETE /students/:idAll student routes require a valid JWT token.
Create, update, and delete operations additionally require the user role to be admin.
{
name: String,
email: String,
password: String,
role: String
}{
name: String,
email: String
}college-management-system/
│
├── backend/
│ ├── index.js
│ └── models/
│ ├── User.js
│ └── Student.js
│
├── frontend/
│ ├── App.jsx
│ ├── main.jsx
│ └── pages/
│ ├── Login.jsx
│ ├── Signup.jsx
│ ├── Dashboard.jsx
│ └── Admin.jsx
│
└── Demo_and_Github_links.txt
- Node.js
- MongoDB Atlas account or local MongoDB instance
git clone https://github.com/Vishwajit1610/college-management-system.git
cd college-management-systemcd backend
npm installCreate a .env file:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_keyStart the backend server:
node index.jsServer runs on:
http://localhost:3000
cd frontend
npm install
npm run devFrontend runs on:
http://localhost:5173
- Passwords are hashed before storage using bcrypt
- JWT tokens secure protected routes
- Unauthorized requests are rejected through middleware validation
- Administrative operations require explicit role verification
- Sensitive credentials are stored through environment variables
MIT License