Skip to content

Local Development Setup

Prerequisites

  • Node.js v24+ (via fnm)
  • Wrangler CLI (npm install -g wrangler)
  • Cloudflare account (authenticated via wrangler login)
  • Clerk account with dev instance configured
  • Expo CLI (npx expo)
  • iOS Simulator (via Xcode) or physical device

Backend (g2-elite-backend)

1. Clone and install

bash
cd /Users/aoliver/dev/youth-sports-manager/g2-elite-backend
npm install

2. Configure secrets

Create .dev.vars with your Clerk and database credentials:

CLERK_SECRET_KEY=sk_test_...
CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_WEBHOOK_SECRET=whsec_...
ORG_DB_FARM=postgresql://...

3. Run the gateway locally

bash
npm run dev:gateway

Gateway runs at http://localhost:8787. Test with:

bash
curl http://localhost:8787/api/health

4. Run other workers

bash
npm run dev:mobile-bff    # port 8788
npm run dev:webhook       # port 8789

Mobile App (YouthSportMate)

1. Install dependencies

bash
cd /Users/aoliver/dev/youth-sports-manager/YouthSportMate/youth-sports-mobile
npm install --legacy-peer-deps

2. Configure environment

Create .env:

EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
EXPO_PUBLIC_API_GATEWAY_URL=https://g2-elite-gateway.2pw.workers.dev

3. Start Expo

bash
npx expo start --clear

Press i to open in iOS Simulator.

Type Checking

bash
cd g2-elite-backend
npx tsc --noEmit

Internal Documentation — Do Not Share