Skip to content

phamvanson04/Booking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 Cinebee Backend

Java Spring Boot Maven MySQL Redis

Backend API for Cinebee movie ticket platform, built with Spring Boot and organized using Clean Architecture layers for easier maintenance and scaling.

✨ Highlights

  • 🔒 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

🧭 Clean Architecture Layout

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

:tools: Tech Stack

  • 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

🚀 Quick Start

1) Prerequisites

  • JDK 21
  • Maven 3.8+
  • MySQL 8+
  • Redis 6+

2) Clone

git clone https://github.com/phamvanson04/ticket-be.git
cd ticket-be

3) Configure environment

Create .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_secret

4) Run dependencies (optional by Docker)

docker compose up -d

5) Run application

mvn clean install
mvn spring-boot:run

Default URL: http://localhost:8080

📦 API Modules

Current controllers:

  • AuthController
  • BannerController
  • CaptchaController
  • LoginController
  • MovieController
  • PaymentController
  • ProfileController
  • RegisterController
  • ShowtimeController
  • TheaterController

🧪 Testing

Run all tests:

mvn test

Architecture 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

📁 Important Files

  • pom.xml
  • docker-compose.yml
  • src/main/resources/application.yml
  • src/test/java/com/cinebee/architecture/CleanArchitectureRulesTest.java

🤝 Contributing

  • Create feature branch from master
  • Keep commits atomic and message clear (conventional commit style preferred)
  • Ensure mvn test passes before creating PR

📄 License

Internal/Project-specific usage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors