A comprehensive Spring Boot application with role-based access control for managing students, teachers, courses, departments, and enrollments.
- JWT Authentication - Secure token-based authentication
- Role-Based Access Control - Admin, Teacher, and Student roles with different permissions
- Student Management - Complete CRUD operations for student profiles
- Teacher Management - Manage teacher accounts and assignments
- Course Management - Create courses, assign teachers, track enrollments
- Department Management - Organize departments with course associations
- Enrollment System - Students can enroll/drop courses
- View Classmates - Students can see their department peers
- Multi-Page Web UI - Responsive HTML interface with dark teal theme
| Component | Technology |
|---|---|
| Backend Framework | Spring Boot 4.0.2 |
| Security | Spring Security + JWT |
| Database | PostgreSQL 16 |
| ORM | Spring Data JPA + Hibernate |
| Migrations | Liquibase |
| Build Tool | Maven |
| Container | Docker + Docker Compose |
| Frontend | HTML/CSS/JavaScript |
- Java 21 or higher
- Docker & Docker Compose
- Maven 3.6+ (or use included wrapper)
# Start PostgreSQL
docker-compose up -d
# Run application (Windows)
mvnw.cmd spring-boot:run
# Run application (Linux/Mac)
./mvnw spring-boot:runApplication runs on: http://localhost:9090
docker-compose -f docker-compose.prod.yaml up --build| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
POST /api/auth/login- Login and receive JWT tokenPOST /api/auth/register- Register new user account
Users
GET /api/admin/users- List all usersPOST /api/admin/users- Create new userPUT /api/admin/users/{id}- Update userDELETE /api/admin/users/{id}- Delete user
Students
GET /api/admin/students- List all studentsPOST /api/admin/students- Create student with credentialsPUT /api/admin/students/{id}- Update studentDELETE /api/admin/students/{id}- Delete student
Teachers
GET /api/admin/teachers- List all teachersPOST /api/admin/teachers- Create teacher with credentialsPUT /api/admin/teachers/{id}- Update teacherDELETE /api/admin/teachers/{id}- Delete teacher
Courses
GET /api/admin/courses- List all coursesPOST /api/admin/courses- Create coursePUT /api/admin/courses/{id}- Update courseDELETE /api/admin/courses/{id}- Delete course
Departments
GET /api/admin/departments- List all departmentsPOST /api/admin/departments- Create departmentPUT /api/admin/departments/{id}- Update departmentDELETE /api/admin/departments/{id}- Delete department
GET /api/teacher/students- View all students (Read-only)GET /api/teacher/courses- View courses (View-only, no edit)GET /api/teacher/my-courses- View assigned courses
GET /api/student/profile- View own profilePUT /api/student/profile- Update own profileGET /api/student/courses- View available coursesPOST /api/student/enroll/{courseId}- Enroll in courseDELETE /api/student/drop/{courseId}- Drop courseGET /api/student/my-enrollments- View enrolled coursesGET /api/student/department-students- View classmates
curl -X POST http://localhost:9090/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"admin123"}'Response:
{
"token": "eyJhbGciOiJIUzUxMiJ9...",
"id": 1,
"username": "admin",
"roles": ["ROLE_ADMIN"]
}curl -X POST http://localhost:9090/api/admin/students \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"username":"john.doe",
"email":"john@example.com",
"password":"pass123",
"firstName":"John",
"lastName":"Doe",
"studentId":"STU001",
"department":"CSE",
"gpa":3.75
}'src/main/java/com/example/StudentMS/
├── config/ # Security & app configuration
├── controller/ # REST API endpoints (5 controllers)
├── dto/ # Data Transfer Objects (12 DTOs)
├── entity/ # JPA entities (7 tables)
├── exception/ # Global exception handler
├── repository/ # Data access layer (7 repositories)
├── security/ # JWT authentication components
├── service/ # Business logic (7 services)
└── util/ # Helper utilities
src/main/resources/
├── application.yaml # App configuration
├── db/changelog/ # Liquibase migrations (10 files)
└── static/ # Frontend HTML pages (12 pages)
See explain.md for detailed technical documentation.
Tables:
users- User accounts with authenticationroles- Role definitions (ADMIN, TEACHER, STUDENT)user_roles- Many-to-many user-role mappingstudents- Student profiles linked to usersteachers- Teacher profiles linked to userscourses- Course information with teacher assignmentdepartments- Department organizationenrollments- Student course enrollments
Migrations managed by Liquibase - See src/main/resources/db/changelog/changes/
| Role | Permissions |
|---|---|
| ADMIN | Full CRUD on all resources (users, students, teachers, courses, departments) |
| TEACHER | View students, view courses (read-only), manage own profile |
| STUDENT | Enroll in courses, view classmates, manage own profile |
Access the web UI at http://localhost:9090 after starting the application.
Available Pages:
- Login (
/login.html) - Dashboard (
/dashboard.html) - Students Management (
/students.html) - Teachers Management (
/teachers.html) - Courses Management (
/courses.html) - Departments Management (
/departments.html) - Users Management (
/users.html) - Profile Management (
/profile.html) - My Enrollments (
/my-enrollments.html) - Classmates View (
/classmates.html)
This project was developed as part of a Software Engineering lab course.
This project is for educational purposes.