Setup
App Setup
Setting up the main web application
Overview
The app (apps/app) is a Vite + React 19 SPA using TanStack Router. It runs in two modes:
- Hono mode (default): connects to the API server for data, with a local IndexedDB fallback for domains not yet migrated
- Local mode: fully local IndexedDB for development without any backend
Prerequisites
- Node.js 24+
- pnpm 10+
- Clerk account (for authentication)
- API server running (for Hono mode)
Environment Variables
Create apps/app/.env from the example:
cp apps/app/.env.example apps/app/.env| Variable | Required | Default | Description |
|---|---|---|---|
VITE_SUPABASE_URL | Yes | — | Supabase project URL |
VITE_SUPABASE_ANON_KEY | Yes | — | Supabase anonymous key |
VITE_AUTH_PUBLISHABLE_KEY | Yes | — | Clerk publishable key |
VITE_API_BASE_URL | No | http://localhost:3002/api | BFF API base URL |
VITE_USE_LOCAL_API | No | — | Set to dev or seed for local mode |
VITE_FLAGS | No | — | Feature flags (comma-separated or *) |
VITE_WEB_BASE_URL | No | https://bridge-training.com | Landing site URL |
VITE_PLAYER_BASE_URL | No | appUrl("player") | Player app base URL |
VITE_E2E | No | — | Set to true for E2E test mode |
API modes
Hono mode (default)
When VITE_USE_LOCAL_API is not set, the app connects to the API server:
- HTTP-backed: accounts, boards, themes, bookmarks, voting, auction systems
- Local fallback: groups, sessions, students, sharing groups (IndexedDB)
The app fetches real board IDs from the API and injects them into the local seed so sessions reference real boards.
Local mode
Set VITE_USE_LOCAL_API=dev for full local development:
- All data from IndexedDB (seeded with fake data)
- Dev tools panel for dataset switching
- No API server needed
Set VITE_USE_LOCAL_API=seed for pre-release testing with a single seeded dataset.
Running
# Start the app (Vite dev server)
pnpm dev:app
# Or from the app directory
cd apps/app && pnpm devThe app runs on http://localhost:5173.
Full stack development
For Hono mode, start both the API and app:
# Terminal 1: Start local Supabase + migrate + seed
cd packages/database && pnpm db:local && pnpm db:reset
# Terminal 2: Start the API server
pnpm dev:api
# Terminal 3: Start the app
pnpm dev:app