MilkTea
π§Spring MVC + JSP + MySQL milk tea shop management: products, categories, users, warehouse, suppliers. Role-based access, file upload, search.
Install / Use
/learn @KienCuongSoftware/MilkTeaREADME
π§ Milk Tea Shop
A web application for managing a milk tea shop: products, categories, employees, suppliers, and warehouse. Built with Spring MVC, JSP, and MySQL.
Features
- Home β Featured products, search, and category filter
- Product management β CRUD for products with images
- Category management β Product categories
- Employee management β Staff accounts and roles
- Supplier management β Supplier list and details
- Warehouse management β Inventory (for warehouse staff)
- User profile β Personal info and avatar upload
- Role-based access β Manager, owner, warehouse staff with different menus
Tech stack
- Java 21
- Spring MVC 5.3 (Web, JDBC)
- JSP + JSTL
- MySQL 8
- Bootstrap 5, Font Awesome
- Maven (WAR packaging)
- Apache Tomcat 9
Prerequisites
- JDK 21
- Maven 3.6+
- MySQL 8
- Apache Tomcat 9 (or run via IDE)
Setup
1. Clone the repository
git clone https://github.com/KienCuongSoftware/MilkTea.git
cd MilkTea
2. Database
Create a MySQL database and user:
CREATE DATABASE TeaMilk CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Create user and grant privileges as needed
Copy and edit src/main/resources/jdbc.properties with your database settings:
jdbc.urlβ e.g.jdbc:mysql://localhost:3306/TeaMilk?serverTimezone=UTCjdbc.usernameβ your MySQL userjdbc.passwordβ your MySQL password (default in repo ischangeme; do not commit real production passwords)
Run your schema scripts (tables for products, categories, users, permissions, suppliers, warehouse, etc.) if you have them.
3. Build
mvn clean package
The WAR file is generated in target/MilkTea-0.0.1-SNAPSHOT.war.
4. Run
- Tomcat: Deploy the WAR to Tomcat 9 (e.g. copy to
webapps/or use Tomcatβs manager). - Eclipse/IDE: Run on Tomcat from your IDE; the app is typically available at
http://localhost:8080/MilkTea/.
Project structure
MilkTea/
βββ src/main/java/
β βββ controller/ # Spring MVC controllers
β βββ dao/ # Data access (JDBC)
β βββ beans/ # Domain models
β βββ interceptor/ # Auth interceptor
β βββ utils/
βββ src/main/webapp/
β βββ WEB-INF/
β β βββ views/ # JSP pages
β β β βββ common/ # Shared navbar, etc.
β β βββ spring-servlet.xml
β β βββ web.xml
β βββ resources/
β βββ images/
βββ pom.xml
βββ README.md
Configuration
- Session timeout: 30 minutes (in
web.xml) - Upload size: 10 MB (in
spring-servlet.xml) - Encoding: UTF-8
License
This project is licensed under the MIT License β see the LICENSE file for details.
Contributing
See CONTRIBUTING.md for how to contribute.
