Bridge Training
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
VariableRequiredDefaultDescription
VITE_SUPABASE_URLYesSupabase project URL
VITE_SUPABASE_ANON_KEYYesSupabase anonymous key
VITE_AUTH_PUBLISHABLE_KEYYesClerk publishable key
VITE_API_BASE_URLNohttp://localhost:3002/apiBFF API base URL
VITE_USE_LOCAL_APINoSet to dev or seed for local mode
VITE_FLAGSNoFeature flags (comma-separated or *)
VITE_WEB_BASE_URLNohttps://bridge-training.comLanding site URL
VITE_PLAYER_BASE_URLNoappUrl("player")Player app base URL
VITE_E2ENoSet 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 dev

The 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

On this page