The Coffee Shop Menu project is a full-stack web application built using Spring Boot, designed to manage a dynamic menu for a coffee shop. Initially, we started with JSP (Java Server Pages) for rendering views, then transitioned to Thymeleaf for better integration with Spring Boot, and finally integrated Spring Data JPA for dynamic data management using a database.
- Backend: Spring Boot, Spring MVC, Spring Data JPA
- Frontend: JSP (initially) β Thymeleaf
- Database: H2 (for development) / MySQL (for production)
- ORM: Hibernate (via JPA)
- Build Tool: Maven
- Server: Embedded Tomcat
Initially, we built the project using JSP (Java Server Pages) for rendering views. In this phase:
β
Hardcoded menu items in JSP pages
β
Controllers handled basic navigation (@RequestMapping)
β
No database integration, all data was static
π‘ Why We Shifted Away from JSP?
- JSP requires a lot of boilerplate code
- Mixing Java logic inside JSP leads to poor maintainability
- Spring Boot prefers Thymeleaf for better integration
To improve integration with Spring Boot and simplify UI rendering, we switched to Thymeleaf, which allows embedding dynamic data directly in HTML.
β
Better HTML & Spring Boot integration
β
No need for JSP Servlet configurations
β
More readable and maintainable UI templates
π‘ Why Thymeleaf?
- Works seamlessly with Spring Boot
- Supports dynamic data binding without Java code in HTML
- More modern and maintainable
To move from a static menu to a fully dynamic system, we integrated Spring Data JPA with Hibernate. Now, all menu items are stored in a database, allowing CRUD operations.
β
Menu items stored in the database
β
Spring Data JPA used for persistence
β
Users can add, update, and delete menu items
β
Display a dynamic menu with items stored in the database
β
CRUD operations (Add, Update, Delete) for menu items
β
Thymeleaf templates for rendering dynamic views
β
Spring Boot & Hibernate integration
β
H2 database for development, MySQL for production
1οΈβ£ Clone the Repository:
git clone https://github.com/your-username/coffee-shop-menu.git
cd coffee-shop-menu2οΈβ£ Run the Spring Boot Application:
mvn spring-boot:run3οΈβ£ Access the App in Browser:
http://localhost:8082
This project showcases the evolution of a Spring Boot web application:
β
Started with JSP for static content
β
Migrated to Thymeleaf for better templating
β
Integrated JPA for full database-driven functionality
This transition made the project more scalable, maintainable, and dynamic. π
I built this application alongside the course: Full-Stack Web Development on Coursera.