Monorepo for Launch Bay Next, containing:
- A Next.js web app with tRPC API and PostgreSQL persistence
- An Expo React Native mobile app
- A shared
lbn-corepackage with game data, types, and helper logic
platform/
├── apps/
│ ├── web/ # Next.js frontend + API routes + tRPC server
│ └── app/ # Expo mobile app (iOS/Android)
├── packages/
│ └── core/ # Shared X-Wing data, types, converters, serializers
└── package.json # Root scripts + Bun workspaces (web + packages/*)
- Runtime/package manager: Bun
- Web: Next.js 14, React, Tailwind, tRPC, Drizzle ORM
- Mobile: Expo Router, React Native, Zustand, SWR
- Shared domain logic: TypeScript package (
lbn-core)
- Bun 1.x
- Node-compatible tooling required by Expo/Next.js
- PostgreSQL (for
apps/web) - Xcode/Android Studio if building native mobile binaries locally
Install root workspace dependencies:
bun install
apps/appis currently not listed in root workspaces and has its own lockfile. Install its dependencies separately:
cd apps/app
bun installFrom repo root:
bun run dev:webOr directly:
cd apps/web
bun run devBuild production web bundle:
bun run web:buildcd apps/app
bun run startRun on simulators/devices:
cd apps/app
bun run ios
bun run androidCommon variables used by the web/API layer:
DATABASE_URL(required): PostgreSQL connection stringJWT_SECRET(required): token signing/verification secretPOSTMARK_API_TOKEN(required for email login flow)NEXT_PUBLIC_HOSTING_URL(optional, defaults tohttp://localhost:3000)
Additional provider/deployment variables referenced in config:
FACEBOOK_ID,FACEBOOK_SECRETGOOGLE_ID,GOOGLE_SECRETPOSTGRES_URL,POSTGRES_URL_NON_POOLING,POSTGRES_PRISMA_URL
APP_VARIANTcontrols app identity (developmentvs production metadata inapp.config.js)EXPO_PUBLIC_SERVER_URLis configured in EAS profiles, though the current mobile tRPC URL is hardcoded inapps/app/src/helpers/trpc.ts
- UI routes and API route handlers live in
apps/web/src/app - tRPC entrypoint:
apps/web/src/app/api/trpc/[trpc]/route.ts - tRPC router and subrouters:
apps/web/src/server - Database schema and SQL migrations:
apps/web/src/server/drizzle
Notable API route handlers:
POST /api/linkconverts inbound squad data to a Launch Bay Next URLPOST /api/standardvalidates standard legalityGET /api/xws?lbx=...expands serialized link data back to XWS JSON
- Expo Router screens are organized in
apps/app/src/app - Main tab routes are in
apps/app/src/app/(tabs):- collection
- database
- overview/account/login
- squadrons flow
- Shared client-side state and helpers live in
apps/app/src/storesandapps/app/src/helpers
- Canonical game assets by ruleset in
packages/core/src/assets/{xwa,legacy,amg} - Types in
packages/core/src/types.ts - Domain helpers (loaders, serializers, import/export, conversion) in
packages/core/src/helpers - Source data bundles in
packages/core/src/sources
cd apps/web
bun run dev
bun run build
bun run start
bun run lintcd apps/app
bun run start
bun run ios
bun run android
bun run web
bun run lint
bun run testcd packages/core
bun run update:xwa
bun run update:legacypackages/core/scripts/xwing-data contains merge/update scripts that pull upstream data and rewrite local assets.
Use:
update:xwato sync XWA dataupdate:legacyto sync Legacy data
After updating, verify generated changes in packages/core/src/assets before committing.