A complete coffee shop management system built with Spring Boot backend, MySQL database, and modern HTML/CSS/JavaScript frontend. This is a Java conversion of the original Node.js Brew Cafe project.
brew-cafe/
├── src/
│ ├── main/
│ │ ├── java/com/brewcafe/
│ │ │ ├── BrewCafeApplication.java # Main application entry point
│ │ │ ├── config/ # Spring configuration
│ │ │ ├── controller/ # REST API controllers
│ │ │ │ ├── PageController.java # Page routing
│ │ │ │ ├── CustomerController.java # Customer endpoints
│ │ │ │ ├── AdminController.java # Admin endpoints
│ │ │ │ ├── MenuController.java # Menu item endpoints
│ │ │ │ ├── OrderController.java # Order endpoints
│ │ │ │ ├── ReviewController.java # Review endpoints
│ │ │ │ └── OfferController.java # Offer endpoints
│ │ │ ├── model/ # Entity classes
│ │ │ │ ├── Customer.java
│ │ │ │ ├── Admin.java
│ │ │ │ ├── MenuItem.java
│ │ │ │ ├── Order.java
│ │ │ │ ├── Review.java
│ │ │ │ └── Offer.java
│ │ │ ├── repository/ # Data access layer (JPA)
│ │ │ ├── service/ # Business logic layer
│ │ ├── resources/
│ │ │ ├── templates/ # HTML templates
│ │ │ ├── static/
│ │ │ │ ├── css/style.css # Styling
│ │ │ │ ├── js/ # JavaScript files
│ │ │ │ └── images/ # Images
│ │ │ └── application.properties # Spring Boot config
│ └── test/ # Unit tests
├── pom.xml # Maven dependencies
└── database.sql # MySQL schema
-
Modern UI/UX: Clean, responsive design with smooth animations
-
Pages:
- Home page with featured offers and café info
- Menu page with category filters and shopping cart
- Customer login/registration
- My Orders dashboard for customers
- Admin login
-
Technologies: HTML5, CSS3, Vanilla JavaScript
- REST API with Spring Boot
- Database: MySQL
- ORM: Spring Data JPA + Hibernate
- Architecture: MVC pattern with layered architecture
POST /api/customers/register- Register new customerPOST /api/customers/login- Customer loginGET /api/customers/{id}- Get customer by IDGET /api/customers/phone/{phone}- Get customer by phone
POST /api/admins/login- Admin loginPOST /api/admins- Create admin accountGET /api/admins/{id}- Get admin by ID
GET /api/menu- Get all menu itemsGET /api/menu/categories- Get all categoriesGET /api/menu/category/{category}- Get items by categoryGET /api/menu/{id}- Get menu item by IDPOST /api/menu- Create menu itemPUT /api/menu/{id}- Update menu itemDELETE /api/menu/{id}- Delete menu item
GET /api/orders- Get all ordersGET /api/orders/customer/{customerId}- Get customer ordersGET /api/orders/status/{status}- Get orders by statusGET /api/orders/{id}- Get order by IDPOST /api/orders- Create new orderPUT /api/orders/{id}/status- Update order statusDELETE /api/orders/{id}- Delete order
GET /api/reviews- Get all reviewsGET /api/reviews/{id}- Get review by IDGET /api/reviews/customer/{phone}- Get reviews by customerPOST /api/reviews- Create reviewDELETE /api/reviews/{id}- Delete review
GET /api/offers- Get all offersGET /api/offers/active- Get active offersGET /api/offers/{id}- Get offer by IDPOST /api/offers- Create offerPUT /api/offers/{id}- Update offerDELETE /api/offers/{id}- Delete offer
- Java 17 or higher
- MySQL 8.0 or higher
- Maven 3.6+
-- Connect to MySQL and run the database.sql file
mysql -u root -p < database.sql
-- Or manually in MySQL:
CREATE DATABASE IF NOT EXISTS brew_cafe;
USE brew_cafe;
-- Then paste the contents of database.sqlEdit src/main/resources/application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/brew_cafe
spring.datasource.username=your_mysql_user
spring.datasource.password=your_mysql_passwordmvn clean installmvn spring-boot:runOr run the main class:
java -cp target/brew-cafe-1.0.0.jar com.brewcafe.BrewCafeApplicationThe application will start on http://localhost:8080
- Visit the home page - browse offers and menu overview
- Click "Explore Menu" or go to
/menu - Register or login to place orders
- Select items and add to cart
- Place order - order appears in "My Orders"
- Visit
/admin-login - Login with credentials (default: admin/password)
- Access admin dashboard to manage orders and menu
Admin Login:
- Username:
admin - Password:
password
Alternative Staff Log in:
- Username:
staff - Password:
12345678
- Framework: Spring Boot 3.1.5
- ORM: Spring Data JPA + Hibernate
- Database: MySQL
- Build Tool: Maven
- IDE Compatible: IntelliJ IDEA, VS Code, Eclipse
- HTML5 - Structure
- CSS3 - Styling (custom design system)
- JavaScript (Vanilla) - Interactivity
- Fetch API - AJAX calls
# Server
server.port=8080
server.servlet.context-path=/
# Database
spring.datasource.url=jdbc:mysql://localhost:3306/brew_cafe
spring.datasource.username=root
spring.datasource.password=root
# JPA/Hibernate
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect✅ Customer registration and authentication ✅ Menu management with categories ✅ Shopping cart and order placement ✅ Order tracking and history ✅ Admin dashboard for order management ✅ Offers and promotions management ✅ Customer reviews system ✅ Responsive design ✅ RESTful API architecture ✅ Database schema with proper relationships
- Payment gateway integration (Stripe/PayPal)
- Email notifications for orders
- SMS alerts for delivery
- Admin analytics and reports
- Rating and review system
- Wishlist functionality
- User profile management
- Order cancellation feature
- Delivery partner tracking
- Admin dashboard UI
- spring-boot-starter-web
- spring-boot-starter-data-jpa
- mysql-connector-java (8.0.33)
- lombok (productivity tool)
- spring-boot-devtools (development)
- jackson-databind (JSON processing)
- spring-boot-maven-plugin
# Get all menu items
curl http://localhost:8080/api/menu
# Create an order
curl -X POST http://localhost:8080/api/orders \
-H "Content-Type: application/json" \
-d '{"customerId":1,"customerName":"John","items":"Coffee x2","total":50}'
# Get customer orders
curl http://localhost:8080/api/orders/customer/1- Create a new Collection
- Import the API endpoints
- Set request type (GET, POST, PUT, DELETE)
- Add JSON body for POST/PUT requests
- Send and verify responses
- Verify MySQL is running
- Check credentials in application.properties
- Ensure database exists:
CREATE DATABASE brew_cafe;
- Clear Maven cache:
mvn clean - Update Maven:
mvn -v - Check Java version:
java -version(need 17+)
- Change in application.properties:
server.port=8081 - Or kill the process using port 8080
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is open source and available under the GPL v3.0 License.
For issues and questions:
- Check the documentation
- Review the code comments
- Create an issue in the repository