Skip to content

Architecture Overview

Volare is a travel platform built as a monorepo with a Laravel backend and Astro frontend.

┌─────────────────────────────────────────────────────────────────┐
│ Clients │
│ Web Browser │ Mobile App │ Admin Panel │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ Cloudflare (CDN/Edge) │
│ Static Assets │ Edge Caching │ DDoS Protection │
└─────────────────────────────────────────────────────────────────┘
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ Astro Frontend │ │ Laravel Backend │
│ (Cloudflare Pages) │ │ (Docker/AWS) │
│ │ │ │
│ - SSR/SSG pages │────▶│ - REST API │
│ - Product pages │ │ - FilamentPHP Admin │
│ - Market routing │ │ - Queue workers │
└─────────────────────────┘ │ - Background jobs │
└─────────────────────────┘
┌───────────────────────────┼───────────────────────────┐
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ PostgreSQL │ │ Redis │ │ External APIs │
│ │ │ │ │ │
│ - Primary DB │ │ - Cache │ │ - AerTicket │
│ - Full-text search│ │ - Queue driver │ │ - Payment gateway │
│ - Job storage │ │ - Sessions │ │ - Email service │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
volare/
├── backend/ # Laravel 12 + FilamentPHP v4
│ ├── app/ # Application code
│ ├── config/ # Configuration
│ ├── database/ # Migrations, seeders
│ ├── routes/ # API and web routes
│ └── tests/ # Pest tests
├── frontend/ # Astro 5 + Tailwind CSS v4
│ ├── src/ # Source code
│ │ ├── pages/ # File-based routing
│ │ ├── components/
│ │ └── layouts/
│ └── public/ # Static assets
├── docs/ # Starlight documentation
│ └── src/content/ # Documentation content
└── .claude/ # Claude Code configuration
├── agents/ # Specialized AI agents
└── commands/ # Custom slash commands
┌─────────────────────────────────────────────┐
│ Presentation Layer │
│ Controllers │ Resources │ Middleware │
├─────────────────────────────────────────────┤
│ Application Layer │
│ Services │ Actions │ Jobs │ Events │
├─────────────────────────────────────────────┤
│ Domain Layer │
│ Models │ DTOs │ Enums │ Policies │
├─────────────────────────────────────────────┤
│ Infrastructure Layer │
│ Database │ Cache │ Queue │ APIs │
└─────────────────────────────────────────────┘
PatternUsage
Service LayerBusiness logic encapsulation
RepositoryData access abstraction
DTOsData transfer between layers
ActionsSingle-purpose operations
Form RequestsInput validation
ResourcesAPI response transformation
PoliciesAuthorization logic
1. HTTP Request arrives
2. Route matched, middleware executed
3. Controller receives request
4. Form Request validates input
5. Service layer processes business logic
6. Repository fetches/saves data
7. Resource transforms response
8. JSON response returned
1. Job dispatched from application
2. Job serialized to database
3. Queue worker picks up job
4. Job handler executes
5. Success: job deleted
6. Failure: retry or move to failed_jobs
ModelPurpose
ProductBase travel products
MarketProductMarket-specific product versions
ProductByMarketTranslationLocalized content
BookingCustomer bookings
FlightBookingFlight-specific booking data
OfferCombined product + flight offers
MarketGeographic markets
AirportAirport data with FTS
UserAdmin users with RBAC
Product (template)
└── hasMany: MarketProduct (per market)
└── hasMany: ProductByMarketTranslation (per locale)
Booking
└── belongsTo: User
└── hasOne: FlightBooking
└── belongsTo: Airport (departure, arrival)
Offer
└── belongsTo: MarketProduct
└── belongsTo: FlightBooking
LayerTechnologyPurpose
CDNCloudflareStatic assets, edge caching
ApplicationRedisQuery results, sessions
DatabasePostgreSQLQuery plan caching
  • Cache-aside: Load on miss, store on read
  • Write-through: Update cache on write
  • TTL-based: Automatic expiration
High Priority: aerticket-tickets
Medium Priority: aerticket-bookings
Normal Priority: default
CategoryQueueExamples
Ticketingaerticket-ticketsIssue tickets
Bookingaerticket-bookingsCreate/update bookings
NotificationsdefaultEmails, SMS
SyncdefaultPrice updates, inventory
  • Admin Panel: Session-based with CSRF
  • API: Token-based (Sanctum)
  • OAuth: Google integration
  • RBAC: Role-based access control
  • Policies: Model-level permissions
  • Gates: Feature-level permissions
  • Encryption: Sensitive data at rest
  • HTTPS: All traffic encrypted
  • Input validation: Form requests
  • Output encoding: XSS prevention
Docker Compose
├── Laravel (port 80)
├── PostgreSQL (port 5432)
├── Redis (port 6379)
├── Queue Worker
└── Mailpit (port 8025)
AWS / Cloudflare
├── Frontend: Cloudflare Pages
├── Backend: AWS ECS / EC2
├── Database: AWS RDS (PostgreSQL)
├── Cache: AWS ElastiCache (Redis)
├── Queue: Amazon SQS
└── Storage: AWS S3
ToolPurpose
Laravel TelescopeDevelopment debugging
Laravel HorizonQueue monitoring
Structured LoggingApplication logs
Health EndpointsService health checks
GET /health # Application health
GET /api/health # API health
GET /horizon # Queue dashboard
GET /telescope # Debug dashboard