A simple and beginner-friendly Student Course Management System built with Java Spring Boot and Thymeleaf.
- Student Management: Add, update, delete, and view students
- Course Management: Add, update, delete, and view courses
- Enrollment Management: Assign/unassign courses to students
- Many-to-Many Relationship: Students can be enrolled in multiple courses
- Modern UI: Bootstrap-styled responsive web interface
- H2 Database: In-memory database for easy setup and testing
- Java 17+
- Spring Boot 3.2.0 (Latest stable version)
- Spring Web - Web layer
- Spring Data JPA - Data access layer
- Thymeleaf - Template engine
- H2 Database - In-memory database
- Bootstrap 5 - Frontend styling
- Font Awesome - Icons
src/
├── main/
│ ├── java/com/studentmanagement/
│ │ ├── entity/ # JPA Entities
│ │ │ ├── Student.java
│ │ │ └── Course.java
│ │ ├── repository/ # Data Access Layer
│ │ │ ├── StudentRepository.java
│ │ │ └── CourseRepository.java
│ │ ├── service/ # Business Logic Layer
│ │ │ ├── StudentService.java
│ │ │ └── CourseService.java
│ │ ├── controller/ # Web Layer
│ │ │ ├── HomeController.java
│ │ │ ├── StudentController.java
│ │ │ ├── CourseController.java
│ │ │ └── EnrollmentController.java
│ │ └── StudentCourseManagementApplication.java
│ └── resources/
│ ├── application.properties
│ └── templates/ # Thymeleaf Templates
│ ├── index.html
│ ├── students/
│ ├── courses/
│ └── enrollments/
└── test/
- Java 17 or higher
- Maven (or use the included Maven wrapper)
-
Clone or download the project
-
Run the application using Maven wrapper:
./mvnw spring-boot:run
-
Access the application:
- Main application: http://localhost:8080
- H2 Database Console: http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:studentdb - Username:
sa - Password:
password
- JDBC URL:
- Home Page: View system overview and quick actions
- Students:
- View all students
- Add new students
- Edit existing students
- Delete students
- View student details
- Courses:
- View all courses
- Add new courses
- Edit existing courses
- Delete courses
- View course details
- Enrollments:
- Manage student-course enrollments
- Enroll students in courses
- Unenroll students from courses
id(Long) - Primary keyname(String) - Student's full nameemail(String) - Student's email address (unique)
id(Long) - Primary keyname(String) - Course namedescription(String) - Course description
- Many-to-many relationship between Student and Course
- Managed through JPA
@ManyToManyannotation - Join table:
student_courses
- Controller Layer: Handles HTTP requests and responses
- Service Layer: Contains business logic
- Repository Layer: Data access using Spring Data JPA
- Entity Layer: JPA entities representing database tables
- Responsive Bootstrap 5 design
- Font Awesome icons
- Flash messages for user feedback
- Confirmation dialogs for destructive actions
- H2 in-memory database for easy setup
- Automatic table creation on startup
- H2 console for database inspection
- No Spring Security (as requested for simplicity)
- No complex configuration
- Beginner-friendly code structure
- Comprehensive error handling
- Clean separation of concerns
GET /students- List all studentsGET /students/new- Show add student formPOST /students- Create new studentGET /students/{id}- View student detailsGET /students/{id}/edit- Show edit student formPOST /students/{id}- Update studentPOST /students/{id}/delete- Delete student
GET /courses- List all coursesGET /courses/new- Show add course formPOST /courses- Create new courseGET /courses/{id}- View course detailsGET /courses/{id}/edit- Show edit course formPOST /courses/{id}- Update coursePOST /courses/{id}/delete- Delete course
GET /enrollments/student/{id}- Manage student enrollmentsPOST /enrollments/student/{studentId}/enroll/{courseId}- Enroll studentPOST /enrollments/student/{studentId}/unenroll/{courseId}- Unenroll student
This project is created for educational purposes.