Enterprise-grade cinema ticketing system built with polyglot microservices
Featuring Go + Java services, real-time seat reservations, payment processing, and event-driven notifications
Documentation β’ Architecture β’ API Reference β’ Development Guide
This platform implements a complete cinema ticketing workflow using a distributed microservices architecture. Each service is independently deployable, follows domain-driven design principles, and communicates via both synchronous REST APIs and asynchronous NATS messaging.
Key Capabilities:
- Real-time seat availability with distributed locking
- SAGA-based booking orchestration with automatic rollback
- Stripe payment integration with idempotency guarantees
- Event-driven notifications (email, SMS, push)
- Contract testing with Pact for service compatibility
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENTS β
β Web App / Mobile / Kiosk β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β API GATEWAY β
β Load Balancing / Auth / Rate Limit β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GO SERVICES (Core Platform) β
β β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β USER β β MOVIE β β CINEMA β β SHOWTIME β β SEAT β β BOOKING β β PAYMENT β β
β β :8004 β β :8000 β β :8085 β β :3003 β β :3004 β β :8082 β β :8001 β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JAVA SERVICES (Business Intelligence) β
β β β
β βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ β
β β ANALYTICS β β LOYALTY β β REVIEWS β β
β β :8010 SpringBoot β β :8011 Quarkus β β :8012 Micronaut β β
β β Reports & Metrics β β Points & Rewards β β Ratings & Stats β β
β βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββ
β NATS β
β Event Bus / JetStream β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββ
β NOTIFICATION :8002 β
β Email / SMS / Push β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
| Service | Port | Domain | Description |
|---|---|---|---|
| user | 8004 | Identity | Authentication, JWT tokens, user profiles |
| movie | 8000 | Catalog | Movie metadata, search, recommendations |
| cinema | 8085 | Catalog | Cinema locations, rooms, amenities |
| showtime | 3003 | Schedule | Show schedules, pricing, availability windows |
| seat | 3004 | Inventory | Seat maps, real-time holds, distributed locks |
| booking | 8082 | Transaction | SAGA orchestrator, reservation lifecycle |
| payment | 8001 | Financial | Stripe integration, refunds, receipts |
| notification | 8002 | Communication | Multi-channel delivery, templates, tracking |
| Service | Port | Framework | Description |
|---|---|---|---|
| analytics | 8010 | Spring Boot 3.2 | Reports, sales metrics, business intelligence |
| loyalty | 8011 | Quarkus 3.x | Points program, tiers, rewards |
| reviews | 8012 | Micronaut 4.x | Movie reviews, ratings, statistics |
- Go 1.24+
- Java 21+ (for Java services)
- Maven 3.9+ / Gradle 8.5+
- Docker & Docker Compose
- Task (recommended) or Make
# Clone repository
git clone https://github.com/crizstian/cinema-microservices.git
cd cinema-microservices
# Option 1: DevContainer (recommended)
# Open in VS Code β "Reopen in Container"
# Option 2: Local setup
go work sync
# Start full dev environment (MongoDB 3-node replica + Redis + NATS + all services)
task dev:up
# View logs
task dev:log
# Stop environment
task dev:down# Unit tests for single service
task test SERVICE=booking
# Unit tests for all services
task test:all
# Contract tests (Pact consumer + provider)
task test:contract
# Full E2E tests (starts test environment automatically)
task test:e2e
# CI pipeline (lint + unit + contracts + coverage)
task test:ci| Layer | Technology | Purpose |
|---|---|---|
| Languages | Go 1.24, Java 21 | Polyglot microservices |
| Go Framework | Echo v4 | Lightweight HTTP routing, middleware |
| Java Frameworks | Spring Boot, Quarkus, Micronaut | Enterprise Java (comparison-ready) |
| Database | MongoDB 8.0 | Document store, replica set transactions |
| Cache | Redis 7 | Session management, distributed locks |
| Messaging | NATS JetStream | Event streaming, pub/sub |
| Payments | Stripe | PCI-compliant payment processing |
| API Specs | OpenAPI 3.0 | Contract-first design |
| Contracts | Pact | Consumer-driven contract testing |
| CI/CD | Harness | Test Intelligence, deployment pipelines |
| Containers | Docker | Standardized builds, orchestration |
cinema-microservices/
βββ services/ # Microservices (polyglot)
β β
β β # Go Services
β βββ booking/ # SAGA orchestrator
β βββ cinema/ # Cinema locations
β βββ movie/ # Movie catalog
β βββ notification/ # Multi-channel notifications
β βββ payment/ # Stripe integration
β βββ seat/ # Real-time seat inventory
β βββ showtime/ # Schedule management
β βββ user/ # Authentication & profiles
β β
β β # Java Services
β βββ analytics/ # Spring Boot - Reports & metrics
β βββ loyalty/ # Quarkus - Points & rewards
β βββ reviews/ # Micronaut - Reviews & ratings
β
βββ platform/
β βββ docker/ # All Dockerfiles
β β βββ devcontainer/ # Development container (Go + Java)
β β βββ e2e-runner/ # E2E test runner
β β βββ go-service/ # Go service build template
β β βββ java-service/ # Java service build template
β β βββ mongodb/ # MongoDB init + seeds
β βββ deploy/
β β βββ docker-compose/ # Docker Compose (dev + test profiles)
β βββ scripts/ # Build & test automation
βββ tests/
β βββ contracts/ # Pact contract tests
β βββ integration/ # E2E test suite
βββ docs/ # Documentation hub
βββ go.work # Go workspace configuration
βββ Taskfile.yml # Task automation (Go + Java)
βββ VERSION # Semantic versioning
All common operations are automated via Taskfile:
task --list # List all available tasks
# Build (Go)
task build SERVICE=booking # Build single service Docker image
task build:all # Build all Go service images
# Build (Java)
task java:build SERVICE=analytics # Build Java service Docker image
task java:build:all # Build all Java services
# Development Environment
task dev:up # Start dev environment (3 MongoDB replicas)
task dev:down # Stop and clean volumes
task dev:log # Stream logs (optionally: SERVICE=booking)
task dev:clean # Remove images and build cache
# Testing (Go)
task test SERVICE=booking # Unit tests for single service
task test:all # Unit tests for all Go services
task test:contract # Pact contract tests
task test:e2e # End-to-end tests (full system)
# Testing (Java)
task java:test SERVICE=analytics # Unit tests for Java service
task java:test:all # Unit tests for all Java services
# Run locally (Java)
task java:run SERVICE=analytics # Run Java service in dev mode| Section | Description |
|---|---|
| Documentation Hub | Start here β system overview and navigation |
| Architecture | C4 diagrams, data flows, ADRs |
| Services | Detailed service specifications |
| API Reference | OpenAPI specs, error handling |
| Development | Setup, testing, code style |
| Operations | CI/CD pipelines, deployment |
| Contracts | Pact testing, consumer/provider |
- Review the Development Guide
- Create a feature branch from
main - Write tests following the testing pyramid
- Run
task test:cibefore submitting - Open a Pull Request with a clear description
Current: 0.1.0 | License: MIT
Built with precision for scalability and maintainability