bun dev- Run both backend (Convex) and frontend (Vite) concurrentlybun dev:backend- Run Convex dev server onlybun dev:frontend- Run Vite dev server on port 3001bun check-types- Type check all TypeScript codebun run build- Build production frontendbun serve- Preview production build
bun dev:backend:setup- Configure and set up Convex projectbun generate-pwa-assets- Generate PWA assets for different screen sizes
- Frontend: React 19, TypeScript, TanStack Router, TanStack Query, TailwindCSS v4, shadcn/ui
- Backend: Convex (reactive database), Clerk authentication
- Maps: Mapbox GL JS, Mapbox Search API
- ML: Roboflow integration for court detection
- Build: Vite, Bun as package manager
- PWA: Progressive Web App support
- Map Components: Located in
src/components/map/with sections and shared utilities - UI Components: shadcn/ui components in
src/components/ui/ - Routes: File-based routing with TanStack Router in
src/routes/ - Backend: Convex functions in
convex/with schema inschema.ts
The Convex database schema is defined in convex/schema.ts. Treat that file as the source of truth for table names, fields, validators, and indexes. This project is very greenfield, so migrations or data loss are acceptable when explicitly requested; otherwise preserve deployed data.
- Satellite tiles and geocoding
- Custom map controls and navigation
- API key required from environment
- ML inference for court detection
- Training data upload
- Model version management
- Path aliases:
@forsrc/,@backendforconvex/ - PWA with auto-update registration
- Sourcemaps enabled for debugging
- TanStack Router plugin for file-based routing
- Auto-generated types in
convex/_generated/ - Schema validation
- Background task scheduling
- Always use
buninstead of npm/yarn/pnpm - Bun automatically loads
.envfiles - Use
bun run testfor testing
Every log must include structured context:
- Timing information (startTs, durationMs)
- IDs for all entities (tileId, scanId, etc.)
- Progress and completion metrics
- Throw descriptive errors for client-facing issues
- Validate required data before operations
- Include complete context in error logs
- React 19 doesn't need
import React - Components:
PascalCase - Hooks:
useCamelCase - Database tables:
snake_case