Tea Post
A basic e-commerce store skeleton for a tea shop, split into two independent Spring Boot Maven modules under one parent POM.
Structure
TeaPost/
├── pom.xml # parent POM (Maven multi-module)
├── backend/ # REST API (Spring Boot, Spring Data JPA, H2)
│ └── src/main/java/com/teapost/backend/
│ ├── model/ # JPA entities: Category, Product, User, Cart, CartItem, Order, OrderItem
│ ├── repository/ # Spring Data repositories
│ ├── dto/ # Request/response DTOs
│ ├── service/ # Business logic interfaces + impl
│ ├── controller/ # REST controllers
│ ├── config/ # CORS config
│ └── exception/ # Global exception handling
└── frontend/ # Server-rendered UI (Spring Boot MVC + Thymeleaf)
└── src/main/java/com/teapost/frontend/
├── client/ # RestTemplate wrappers calling the backend API
├── controller/ # MVC controllers (page routes)
├── dto/ # DTOs mirroring the backend contracts
└── config/ # RestTemplate bean
Running
Requires a local JDK 17+ and Maven 3.9+ (no wrapper is bundled). Two independent Spring Boot apps — run each in its own terminal from the TeaPost/ directory.
Backend (port 8082, H2 in-memory database, seeded with sample teas):
cd backend && mvn spring-boot:run
Frontend (port 8081, calls the backend at http://localhost:8082/api):
cd frontend && mvn spring-boot:run
Then open http://localhost:8081 in a browser.
What's included
- Product catalog with categories (seeded via
data.sql) - Cart (add/update/remove items, session-based user linkage)
- Basic registration/login (plaintext password — not production-ready, see note below)
- Order placement from cart contents
- H2 console at
http://localhost:8082/h2-console(JDBC URL:jdbc:h2:mem:teapostdb)