Assignment created and guided with README file by Safwan kher(https://github.com/safwan-kher).
README and instruction by Safwan kher.
Assignment: Building a Student Enrollment System Using Spring Boot, Thymeleaf, PostgreSQL, and JPA Hibernate
Develop a simple web-based student enrollment system that allows users to add, view, and manage student entries. This system will utilize Spring Boot for the backend, Thymeleaf for the frontend, PostgreSQL as the database, and JPA Hibernate for ORM.
-
Setup and Configuration:
- Use Maven to manage project dependencies.
- Configure PostgreSQL as the database for storing student data.
- Set up Spring Boot with necessary dependencies for Web, Thymeleaf, JPA, and PostgreSQL.
-
Database Model:
- Create a
Student
entity with fields such asid
,name
,enrollmentDate
, andcourse
.
- Create a
-
Repository Layer:
- Implement a repository interface for the
Student
entity using Spring Data JPA.
- Implement a repository interface for the
-
Service Layer:
- Develop a service class to handle the logic for adding, retrieving, and listing all students.
-
Controller Layer:
- Create a controller to manage HTTP requests such as GET and POST for adding and viewing students.
-
View Layer:
- Utilize Thymeleaf to create HTML templates for the student submission form, the home page listing all students, and a submission result page.
-
Project Setup:
- Initialize a Spring Boot project with required dependencies.
- Configure
application.properties
for database connection and Hibernate settings.
-
Entity Creation:
- Define a
Student
entity with annotations to map it to a PostgreSQL table.
- Define a
-
Repository Setup:
- Create an interface extending
JpaRepository
for theStudent
entity.
- Create an interface extending
-
Service Implementation:
- Implement methods in the service class to save a student to the database and retrieve student entries.
-
Controller Implementation:
- Develop endpoints to display the submission form, accept form submissions, and display all students.
-
Thymeleaf Templates:
- Design HTML pages using Thymeleaf for displaying the form, listing students, and showing submission results.
-
Testing:
- Test the application to ensure that students can be added and viewed correctly.
- Source code for the entire application including entity, repository, service, and controller classes.
- Thymeleaf templates for the user interface.
- A detailed README file documenting how to set up and run the application.
- Functionality: The application should meet all the functional requirements specified.
- Code Quality: The code should be clean, well-organized, and properly commented.
- Design and Usability: The Thymeleaf templates should be user-friendly and aesthetically pleasing.
- Error Handling: The application should gracefully handle and report errors.
This assignment will help you understand how to integrate various components of a Spring Boot application and provide practical experience with web application development using MVC architecture.