| Category | Badges |
|---|---|
| π Project | |
| π¨ Build & Deploy | |
| π» Technologies | |
| ποΈ Data & Messaging | |
| ποΈ Architecture | |
| β‘ Performance |
Ultra-scale, cloud-native hospitality management platform designed to handle 10,000+ reservations per minute using hybrid Node.js + Java microservices with GraphQL Federation and event-driven communication.
The Modern Reservation Management System is a comprehensive, enterprise-grade platform built for hotels, resorts, and hospitality chains. It combines the I/O efficiency of Node.js with the computational power of Java to deliver unmatched performance at scale.
- Ultra-High Performance: 10,000+ reservations per minute sustained throughput
- Enterprise Multi-Tenancy: Complete data isolation with defense-in-depth security
- GraphQL Federation: 4x faster dashboard loads with unified data graph
- Event-Driven Architecture: Zero service coupling via Apache Kafka
- Hybrid Technology Stack: Best-of-breed Node.js + Java microservices
- 75% Bandwidth Reduction: GraphQL precise queries for mobile optimization
- Monorepo Excellence: Nx-powered unified development experience
- Cloud-Native: Kubernetes-ready with service mesh architecture
graph TB
subgraph "Client Layer"
A1["Angular PWA<br/>Guest Portal"]
A2["Angular PWA<br/>Staff Portal"]
A3["Angular PWA<br/>Admin Portal"]
A4["Mobile Apps<br/>iOS/Android"]
end
subgraph "API Gateway Layer"
B1["GraphQL Federation Gateway<br/>Apollo Gateway"]
B2["Express Gateway<br/>50,000+ req/sec"]
B3["Authentication<br/>JWT/OAuth2"]
B4["Rate Limiting<br/>Redis-based"]
B5["Load Balancing<br/>Intelligent routing"]
end
subgraph "Node.js Services - I/O Optimized"
N1["WebSocket Service<br/>100K+ connections"]
N2["Notification Service<br/>Multi-channel delivery"]
N3["Channel Manager<br/>OTA integrations"]
N4["Audit Service<br/>Event processing"]
end
subgraph "Java Services - CPU Optimized"
J1["Reservation Engine<br/>Complex business logic"]
J2["Availability Calculator<br/>Multi-threaded algorithms"]
J3["Rate Management<br/>Dynamic pricing"]
J4["Payment Processor<br/>PCI-DSS compliant"]
J5["Analytics Engine<br/>Heavy data processing"]
end
subgraph "Event Streaming - Apache Kafka"
K1["Reservation Events<br/>100 partitions"]
K2["Payment Events<br/>50 partitions"]
K3["Availability Updates<br/>200 partitions"]
K4["Notifications<br/>20 partitions"]
end
subgraph "Data Layer"
D1[("PostgreSQL<br/>Multi-master cluster")]
D2["Redis Cluster<br/>21-node architecture"]
D3["Elasticsearch<br/>Search & analytics"]
end
A1 --> B1
A2 --> B1
A3 --> B1
A4 --> B1
B1 --> B2
B2 --> N1
B2 --> J1
N1 --> K1
N2 --> K4
J1 --> K1
J2 --> K3
J3 --> K3
J4 --> K2
K1 --> N2
K2 --> J1
K3 --> N1
K4 --> N4
J1 --> D1
J2 --> D2
N1 --> D2
N4 --> D3
| Service Type | Technology | Rationale | Performance Benefit |
|---|---|---|---|
| GraphQL Federation | Apollo Gateway + Node.js | Unified data graph | 4x faster dashboard loads |
| API Gateway | Node.js + Express | High I/O throughput | 50,000+ req/sec |
| WebSocket Service | Node.js + Socket.io | Excellent connection handling | 100,000+ concurrent users |
| Reservation Engine | Java + Spring Boot | Complex business logic | 5x faster processing |
| Availability Calculator | Java + Parallel Streams | CPU-intensive algorithms | 10x calculation speed |
| Payment Processing | Java + Spring Security | Enterprise security | PCI-DSS compliance |
| Notification Service | Node.js + Bull Queue | I/O efficient delivery | Multi-channel optimization |
- Real-time Reservations: Instant booking with availability checking
- Dynamic Pricing: AI-driven rate management and revenue optimization
- Multi-property Support: Centralized management for hotel chains
- Guest Experience: 360Β° guest profiles and preference management
- Housekeeping Operations: Mobile-first cleaning and maintenance workflows
- Payment Processing: Secure, PCI-DSS compliant payment handling
- Multi-currency Support: Global payment gateway integrations
- Revenue Management: Advanced analytics and forecasting
- Billing & Invoicing: Automated folio management
- Financial Reporting: Real-time P&L and revenue dashboards
- Business Intelligence: Real-time occupancy and revenue metrics
- Performance Dashboards: Executive and operational reporting
- Predictive Analytics: Demand forecasting and pricing optimization
- Guest Analytics: Behavior analysis and personalization
- Operational Metrics: KPI tracking and performance monitoring
- Channel Manager: Seamless OTA synchronization (Booking.com, Expedia)
- PMS Integration: Legacy system connectivity
- Payment Gateways: Stripe, PayPal, and regional processors
- Communication: Email, SMS, and push notification services
- Third-party APIs: Weather, maps, and local services
Framework: Angular 17+ with Angular Material
GraphQL Client: Apollo Client for efficient data fetching
PWA: Service Workers + Offline Capabilities
State Management: NgRx for complex application state
UI/UX: Responsive design with dark/light themes
TypeScript: Full type safety across the application
Testing: Jest + Cypress for comprehensive coverageGraphQL Federation: Apollo Gateway for unified schema
GraphQL Subscriptions: Real-time updates via WebSocket
Query Optimization: DataLoader for N+1 problem elimination
Schema Management: TypeGraphQL for type-safe development
Caching Strategy: Multi-level caching (Gateway + Client)
REST Fallback: Traditional REST for third-party integrationsNode.js Services:
- Runtime: Node.js 20 LTS
- Framework: Express.js / NestJS
- WebSockets: Socket.io
- Queue: Bull + Redis
Java Services:
- Runtime: OpenJDK 21
- Framework: Spring Boot 3.x
- Security: Spring Security
- Data: Spring Data JPA
- Testing: JUnit 5 + TestcontainersContainerization: Docker + Kubernetes
Service Mesh: Istio for traffic management
Monitoring: Prometheus + Grafana + Jaeger
Logging: ELK Stack (Elasticsearch, Logstash, Kibana)
CI/CD: GitHub Actions + ArgoCD
Infrastructure as Code: Terraform + Helm chartsPrimary Database: PostgreSQL 15+ (Multi-master)
Caching: Redis 7+ (21-node cluster)
Message Streaming: Apache Kafka 3.x
Search Engine: Elasticsearch 8+
Schema Validation: Zod (TypeScript-first)| Metric | Target | Architecture Benefit |
|---|---|---|
| Reservation Throughput | 10,000/minute (167/sec) | Event-driven processing |
| GraphQL Query Response | <50ms (95th percentile) | Federation optimization |
| Dashboard Load Time | <50ms (vs 200ms REST) | Single query efficiency |
| API Response Time | <5ms (95th percentile) | Node.js I/O efficiency |
| Business Logic Processing | <10ms per reservation | Java computational power |
| Concurrent Users | 100,000+ simultaneous | WebSocket + Subscriptions |
| Database Performance | <5ms reads, <10ms writes | Multi-master architecture |
| Cache Hit Ratio | 99.9% availability data | Redis cluster strategy |
| Mobile Data Usage | 75% reduction | GraphQL precise queries |
| System Uptime | 99.95% availability | Fault-tolerant design |
- Horizontal Scaling: Independent service scaling based on load
- Multi-Master Database: 4+ PostgreSQL masters with sharding
- Event Partitioning: 500+ Kafka partitions for parallel processing
- Cache Distribution: 21-node Redis cluster with specialized roles
- Auto-scaling: Kubernetes HPA/VPA with custom metrics
modern-reservation/
βββ apps/
β βββ frontend/
β β βββ guest-portal/ # Angular PWA for guests
β β βββ staff-portal/ # Angular PWA for staff
β β βββ admin-portal/ # Angular PWA for admins
β β βββ mobile-pwa/ # Mobile-first PWA
β β
β βββ backend/
β β βββ graphql-gateway/ # Apollo Federation Gateway
β β βββ api-gateway/ # Node.js Express gateway
β β βββ websocket-service/ # Node.js real-time + GraphQL subscriptions
β β βββ notification-service/ # Node.js multi-channel delivery
β β βββ reservation-engine/ # Java Spring Boot core
β β βββ availability-service/ # Java computational service
β β βββ payment-processor/ # Java secure financial service
β β βββ analytics-engine/ # Java data processing
β β
β βββ workers/
β βββ kafka-consumer/ # Event stream processors
β βββ batch-processor/ # Scheduled background jobs
β βββ cleanup-worker/ # Data maintenance tasks
β
βββ libs/
β βββ shared/
β β βββ schemas/ # Zod validation schemas
β β βββ types/ # TypeScript definitions
β β βββ constants/ # Shared constants
β β
β βββ frontend/
β β βββ ui-components/ # Angular Material components
β β βββ state-management/ # NgRx stores and effects
β β βββ themes/ # Design system and themes
β β
β βββ backend/
β βββ graphql-federation/ # Schema federation utilities
β βββ graphql-client/ # Apollo Client configuration
β βββ database/ # Database utilities
β βββ kafka/ # Event streaming utilities
β βββ cache/ # Redis cache management
β βββ monitoring/ # OpenTelemetry setup
β
βββ infrastructure/
β βββ docker/ # Container configurations
β βββ kubernetes/ # K8s manifests and Helm charts
β βββ terraform/ # Cloud infrastructure as code
β βββ monitoring/ # Prometheus, Grafana configs
β
βββ docs/ # Comprehensive documentation
βββ tools/ # Custom Nx generators and scripts
βββ nx.json # Nx workspace configuration
- Node.js 20+ and Java 21+
- Docker & Docker Compose
- Maven 3.8+ for Java services
- PostgreSQL Client (for database operations)
# Clone and navigate
git clone https://github.com/red2n/modern-reservation.git
cd modern-reservation
# Start everything with clean environment
./dev.sh clean
# That's it! All services will be running in ~3 minutesThe dev.sh script is your single entry point for all operations:
# See all available commands
./dev.sh help
# Start all services
./dev.sh start
# Check what's running
./dev.sh status
# Stop everything
./dev.sh stop
# Clean restart for testing
./dev.sh clean
# View logs
./dev.sh logs reservation-engine
# Open monitoring UIs
./dev.sh ui-kafka # http://localhost:8090
./dev.sh ui-eureka # http://localhost:8761
./dev.sh ui-zipkin # http://localhost:9411./dev.sh start # Start all services
./dev.sh status # Verify everything is running./dev.sh clean # Full clean restart
# All data removed, fresh database, Avro schemas regenerated./dev.sh clean --keep-data --skip-maven
# Faster restart, preserves database./dev.sh stop-business # Stop business services only
# Make your changes...
./dev.sh start-business # Restart business services./dev.sh stop # Stop all services cleanly# Test Avro event publishing
./dev.sh test-avro
# Check all dependencies
./dev.sh check-deps
# Comprehensive health check
./dev.sh check-health
# View service logs
./dev.sh logs reservation-engine
./dev.sh logs kafka# Initialize database schema
./dev.sh db-setup
# Connect to database
./dev.sh db-connect
# Backup database
./dev.sh db-backup| Service | URL | Description |
|---|---|---|
| Reservation Engine | http://localhost:8081/reservation-engine | Main business service |
| Kafka UI | http://localhost:8090 | Monitor Kafka topics & events |
| Schema Registry | http://localhost:8085 | Avro schema management |
| Eureka Dashboard | http://localhost:8761 | Service discovery |
| Zipkin | http://localhost:9411 | Distributed tracing |
| PgAdmin | http://localhost:5050 | Database management |
| PostgreSQL | localhost:5432 | Database |
| Redis | localhost:6379 | Cache |
| Kafka | localhost:9092 | Event streaming |
- Quick Reference:
DEV_QUICK_REFERENCE.md - All Scripts:
scripts/README.md - Clean Restart Guide:
docs/CLEAN_RESTART_GUIDE.md - Avro Events:
docs/AVRO_QUICK_REFERENCE.md
graph LR
subgraph "Traditional REST API"
R1["8 API Calls"] --> R2["200ms Load Time"]
R3["500KB Data"] --> R4["Over-fetching"]
R5["Polling Updates"] --> R6["5s Delay"]
end
subgraph "GraphQL Approach"
G1["1 GraphQL Query"] --> G2["50ms Load Time"]
G3["150KB Data"] --> G4["Precise Fields"]
G5["Subscriptions"] --> G6["Real-time"]
end
R2 -.->|"4x Improvement"| G2
R4 -.->|"70% Reduction"| G4
R6 -.->|"Instant Updates"| G6
| Feature | Benefit | Performance Impact |
|---|---|---|
| Federation Gateway | Unified schema across services | Single API endpoint |
| Query Optimization | DataLoader + caching | Eliminates N+1 queries |
| Real-time Subscriptions | Live updates via WebSocket | Instant availability changes |
| Field Selection | Precise data fetching | 60-75% bandwidth reduction |
| Type Safety | Generated client libraries | Compile-time error detection |
| Query Complexity Control | Prevents expensive operations | DoS protection |
Complex Dashboard Query (Single Request):
query DashboardData($propertyId: ID!, $date: Date!) {
property(id: $propertyId) {
name
todayReservations: reservations(date: $date) {
id
guest { name, vip }
room { number, type }
status
}
availability(date: $date) {
total
occupied
available
}
revenue(period: TODAY) {
amount
currency
}
}
}Real-time Availability Subscription:
subscription AvailabilityUpdates($propertyId: ID!) {
availabilityChanged(propertyId: $propertyId) {
date
roomType
available
rate
restrictions
}
}graph TB
subgraph "Testing Pyramid"
T1["E2E Tests<br/>Cypress automation<br/>Critical user journeys"]
T2["Integration Tests<br/>Service contracts<br/>API & Event testing"]
T3["Unit Tests<br/>Jest & JUnit<br/>80%+ coverage target"]
T3 --> T2
T2 --> T1
end
subgraph "Quality Gates"
Q1["Performance Testing<br/>K6 load testing<br/>10K reservations/min"]
Q2["Security Testing<br/>OWASP scanning<br/>Vulnerability assessment"]
Q3["Contract Testing<br/>Pact consumer/provider<br/>API compatibility"]
end
T1 --> Q1
Q1 --> Q2
Q2 --> Q3
# Unit tests with coverage
nx test reservation-engine --coverage
nx test guest-portal --code-coverage
# Integration tests
nx integration api-gateway
nx integration reservation-engine
# Load testing
nx load-test --target=10000-reservations-per-minute
# Security scanning
nx security-scan --all-servicessequenceDiagram
participant UI as Guest Portal
participant GW as API Gateway
participant K as Kafka Event Bus
participant AC as Availability Calculator
participant RE as Reservation Engine
participant PP as Payment Processor
participant NS as Notification Service
UI->>GW: Create Reservation
GW->>K: Publish ReservationRequested
par Availability Check
K->>AC: Consume ReservationRequested
AC->>K: Publish AvailabilityConfirmed
end
K->>RE: Consume AvailabilityConfirmed
RE->>K: Publish PaymentRequested
K->>PP: Consume PaymentRequested
PP->>K: Publish PaymentCompleted
K->>RE: Consume PaymentCompleted
RE->>K: Publish ReservationConfirmed
par Notifications
K->>NS: Consume ReservationConfirmed
NS->>UI: WebSocket real-time update
end
Note over UI,NS: Zero coupling, fault tolerance<br/>Independent scaling, audit trail
| Topic | Partitions | Use Case | Consumer Groups |
|---|---|---|---|
reservation.requested |
100 | New booking requests | availability-calculators |
availability.confirmed |
200 | Room availability results | reservation-engines |
payment.requested |
50 | Payment processing | payment-processors |
reservation.confirmed |
100 | Successful bookings | notification-services, analytics |
- Authentication: JWT tokens with refresh mechanism
- Authorization: Role-based access control (RBAC)
- API Security: Rate limiting, input validation, CORS
- Data Encryption: TLS 1.3 in transit, AES-256 at rest
- PCI-DSS Compliance: Secure payment processing
- GDPR Compliance: Data privacy and right to be forgotten
- Audit Trails: Complete audit logging for all operations
- PCI-DSS Level 1: Payment card industry compliance
- GDPR: European data protection regulation
- SOX: Sarbanes-Oxley financial reporting
- ISO 27001: Information security management
- WCAG 2.1 AA: Web accessibility standards
graph TB
subgraph "Application Metrics"
A1["Node.js Services<br/>Custom business metrics"]
A2["Java Services<br/>Micrometer + Actuator"]
A3["Frontend Apps<br/>Performance + UX metrics"]
end
subgraph "Infrastructure Metrics"
I1["Kubernetes<br/>Pod & Node metrics"]
I2["PostgreSQL<br/>Database performance"]
I3["Redis<br/>Cache hit ratios"]
I4["Kafka<br/>Message throughput"]
end
subgraph "Observability Platform"
O1["OpenTelemetry<br/>Distributed tracing"]
O2["Prometheus<br/>Metrics collection"]
O3["Grafana<br/>Dashboards & alerting"]
O4["Jaeger<br/>Trace analysis"]
O5["ELK Stack<br/>Log aggregation"]
end
A1 --> O1
A2 --> O2
A3 --> O2
I1 --> O2
I2 --> O3
I3 --> O4
I4 --> O5
- Business Metrics: Reservation rate, revenue, occupancy
- System Performance: Response times, throughput, error rates
- Infrastructure Health: CPU, memory, disk, network utilization
- Event Streaming: Kafka lag, partition distribution, consumer health
We welcome contributions! Please read our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- TypeScript: Strict mode enabled, full type safety
- ESLint + Prettier: Automated code formatting
- Conventional Commits: Standardized commit messages
- Test Coverage: Minimum 80% coverage required
- Documentation: Comprehensive inline and external docs
This project is licensed under the MIT License - see the LICENSE file for details.
- π Complete Documentation - GitHub Pages
- π Product Requirements
- π Project Development Plan
- π Quick Start Guide
- ποΈ Architecture Overview
- οΏ½ Multi-Tenancy Guide - NEW! Enterprise multi-tenancy implementation
- οΏ½π Deployment Guide
- π Report Issues
- π‘ Feature Requests
- π§ Email Support
- π Live Demo
- π Performance Benchmarks
- π API Documentation