Backend API for Cinebee movie ticket platform, built with Spring Boot and organized using Clean Architecture layers for easier maintenance and scaling.
- 🔒 JWT auth + Google OAuth2 login flow
- 👥 Role-based access (
USER,ADMIN) - 🎫 Booking flow with seat lock strategy to reduce double booking risk
- 💰 MoMo payment integration (create payment + callback handling)
- 📧 Ticket email notification with QR code
- ⚡ Redis caching for frequently used data
- ☁️ Cloudinary media upload support
- 🏗️ Clean Architecture package separation
- 🧪 ArchUnit guardrails to protect architecture boundaries
src/main/java/com/cinebee
|-- presentation # Controllers + request/response DTOs
|-- application # Use-case services, mappers, app utilities
|-- domain # Core entities and business model
|-- infrastructure # Config, security, scheduler, persistence adapters
`-- shared # Cross-cutting utilities, exceptions, enums
Main entrypoint: src/main/java/com/cinebee/CineBeeApplication.java
- Java 21
- Spring Boot 3.3.3
- Spring Data JPA + Hibernate
- Spring Security + JWT
- MySQL
- Redis
- Cloudinary
- MoMo payment API
- Thymeleaf + Jakarta Mail
- ZXing (QR code)
- Maven
- JDK 21
- Maven 3.8+
- MySQL 8+
- Redis 6+
git clone https://github.com/phamvanson04/ticket-be.git
cd ticket-beCreate .env in project root:
DB_USERNAME=your_mysql_username
DB_PASSWORD=your_mysql_password
REDIS_PASSWORD=
MAIL_USERNAME=your_email
MAIL_PASSWORD=your_app_password
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
MOMO_PARTNER_CODE=your_partner_code
MOMO_ACCESS_KEY=your_access_key
MOMO_SECRET_KEY=your_secret_key
RECAPTCHA_SECRET=your_recaptcha_secretdocker compose up -dmvn clean install
mvn spring-boot:runDefault URL: http://localhost:8080
Current controllers:
AuthControllerBannerControllerCaptchaControllerLoginControllerMovieControllerPaymentControllerProfileControllerRegisterControllerShowtimeControllerTheaterController
Run all tests:
mvn testArchitecture tests use ArchUnit and currently enforce:
- domain does not depend on application/presentation/infrastructure
- shared does not depend on domain/application/presentation/infrastructure
- presentation does not depend on infrastructure
pom.xmldocker-compose.ymlsrc/main/resources/application.ymlsrc/test/java/com/cinebee/architecture/CleanArchitectureRulesTest.java
- Create feature branch from
master - Keep commits atomic and message clear (conventional commit style preferred)
- Ensure
mvn testpasses before creating PR
Internal/Project-specific usage.