Skip to content

β˜• Coffee Shop Menu - Spring Boot Project πŸ“Œ The Coffee Shop Menu is a full-stack web application built using Spring Boot. Used thymeleaf for better integration with Spring Boot. Incorporated Spring Data JPA to make the application fully dynamic, allowing CRUD operations.

Notifications You must be signed in to change notification settings

ishjaiswal7/CoffeeShop-SpringBoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β˜• Coffee Shop Menu - Spring Boot Project

πŸ“ Project Overview

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.


πŸ”§ Technologies Used

  • 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

πŸ“Œ Evolution of the Project

πŸ› οΈ Phase 1: Static Menu with JSP

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

✨ Phase 2: Migration to Thymeleaf

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

πŸš€ Phase 3: Making the Application Dynamic with JPA

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

1️⃣ Creating the Product Entity

2️⃣ Defining the Repository Interface

3️⃣ Creating a Service Layer

4️⃣ Using JPA Data in Thymeleaf

πŸ“Œ Features Implemented

βœ… 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


⚑ How to Run the Project

1️⃣ Clone the Repository:

git clone https://github.com/your-username/coffee-shop-menu.git
cd coffee-shop-menu

2️⃣ Run the Spring Boot Application:

mvn spring-boot:run

3️⃣ Access the App in Browser:

http://localhost:8082

πŸ“œ Conclusion

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. πŸš€

πŸ“š Reference

I built this application alongside the course: Full-Stack Web Development on Coursera.

About

β˜• Coffee Shop Menu - Spring Boot Project πŸ“Œ The Coffee Shop Menu is a full-stack web application built using Spring Boot. Used thymeleaf for better integration with Spring Boot. Incorporated Spring Data JPA to make the application fully dynamic, allowing CRUD operations.

Topics

Resources

Stars

Watchers

Forks