Skip to content

Vishwajit1610/college-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

College Management System

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


Demo Credentials

Student Account

Email: student@college.com Password: student123

Admin Account

Email: admin@college.com Password: admin123


Features

  • 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

Tech Stack

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

System Architecture

                    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

Authentication & Authorization Flow

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

Role Permissions

Action Student Admin
Login
View Students
Create Student
Update Student
Delete Student

API Endpoints

Authentication

POST /signup
POST /login

Student Management

GET    /students
POST   /students
PUT    /students/:id
DELETE /students/:id

All student routes require a valid JWT token.

Create, update, and delete operations additionally require the user role to be admin.


Database Models

User

{
  name: String,
  email: String,
  password: String,
  role: String
}

Student

{
  name: String,
  email: String
}

Project Structure

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

Local Setup

Prerequisites

  • Node.js
  • MongoDB Atlas account or local MongoDB instance

Clone Repository

git clone https://github.com/Vishwajit1610/college-management-system.git

cd college-management-system

Backend Setup

cd backend

npm install

Create a .env file:

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key

Start the backend server:

node index.js

Server runs on:

http://localhost:3000

Frontend Setup

cd frontend

npm install

npm run dev

Frontend runs on:

http://localhost:5173

Security Considerations

  • 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

License

MIT License

About

Full-stack college management system with JWT authentication, role-based access control, and MongoDB-powered student record management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors