Monorepo Structure
The project is organized into two main directories:apps/ for standalone applications and packages/ for shared libraries.
All applications and packages are managed with PNPM workspaces and orchestrated by Turborepo for optimal build caching and parallelization.
Applications
Web Application (@skyteam/web)
Next.js 15 application serving the public-facing website for passengers.
Framework
Next.js 15 with React 19
Styling
TailwindCSS 4
Port
3000
Dependencies
@skyteam/database, @skyteam/ui
- Flight browsing and search
- Miles balance checking
- Product marketplace
- Responsive design with Radix UI components
Admin Panel (@skyteam/admin)
Next.js 15 application for airline operators to manage their operations.
Framework
Next.js 15 with React 19
UI Library
Headless UI + Heroicons
Port
3001
Dependencies
@skyteam/database, @skyteam/ui
- Airline and brand management
- Flight scheduling and monitoring
- Miles product configuration
- User management and analytics
API Server (@skyteam/api)
Express.js REST API providing backend services for ROBLOX game integration.
Framework
Express 4
Security
Helmet + CORS
Port
4000
Dependencies
@skyteam/database
/health) require the x-api-key header:
Discord Bot (@skyteam/client)
Discord.js bot with Discordx for slash commands and event handling.
Framework
Discord.js 14 + Discordx
Features
Slash commands, embeds
Type
ESM module
Dependencies
@skyteam/database
/ping- Test bot responsiveness (apps/client/src/commands/public/ping.ts)/setupchannel- Configure flight channels (apps/client/src/commands/private/setupchannel.ts)
ROBLOX Module (@skyteam/models)
TypeScript module compiled to Lua for integration into ROBLOX games.
Language
TypeScript (roblox-ts)
Compiler
roblox-ts 3.0
Sync
Rojo
Framework
Roact + Ripple
Shared Packages
Database Package (@skyteam/database)
Centralized database access layer using Drizzle ORM with PostgreSQL.
ORM
Drizzle ORM 0.40
Database
PostgreSQL
Type Safety
Full TypeScript types
Tools
Drizzle Kit + Studio
- Users
- Airlines
- Brands
- Flights
UI Package (@skyteam/ui)
Shared React components used across web and admin applications.
Framework
React 19
Styling
TailwindCSS compatible
Consumers
@skyteam/web, @skyteam/admin
Type
TypeScript library
System Flow
Flight Lifecycle
Flight Creation
Airline creates a flight in the admin panel with:
- Flight code, aircraft type
- Departure and arrival airports
- Brand and codeshare settings
- Discord event link
ROBLOX Game Start
When the ROBLOX server starts, it:
- Calls
GET /flight/fetchUpcomingFlights - Displays available flights to pilots
- Calls
POST /flight/:id/serverStartwhen flight begins
In-Flight Operations
During the flight:
- Server sends heartbeat:
POST /flight/:id/tick - Passengers are tracked via
flightPassengerstable - Miles are calculated based on distance/duration
Miles Rewards Flow
Authentication Flow
Data Flow Diagram
Build System
Turborepo Configuration
Theturbo.json file orchestrates builds across the monorepo:
- Parallel builds - Independent tasks run simultaneously
- Smart caching - Rebuilds only changed packages
- Dependency ordering - Builds packages before apps
Environment Variables
Global environment variables are defined inturbo.json:
Deployment
Docker Compose
Thedocker-compose.yml defines all services:
- Services
- Networks
- Environment
Technology Choices
Why Turborepo?
Why Turborepo?
Turborepo provides intelligent caching and parallel execution for monorepos. When you change a package, only dependent apps rebuild, saving significant time in development.
Why PNPM?
Why PNPM?
PNPM uses a content-addressable store, meaning packages are stored once and hard-linked everywhere. This saves disk space and speeds up installs compared to npm/yarn.
Why Drizzle ORM?
Why Drizzle ORM?
Drizzle provides type-safe database queries with minimal overhead. It generates TypeScript types from your schema, catching errors at compile time.
Why Next.js 15?
Why Next.js 15?
Next.js 15 offers React Server Components, improved performance, and excellent developer experience. The App Router simplifies routing and layouts.
Why roblox-ts?
Why roblox-ts?
roblox-ts brings TypeScript’s type safety to ROBLOX development. It compiles to Lua while providing modern language features and tooling.
Next Steps
Setup Prerequisites
Detailed environment setup guide
Database Configuration
Learn about schema and migrations
ROBLOX Integration
Connect your ROBLOX game
Development Workflow
Best practices for development