Skip to main content

Daily development

Commands​

All commands run from the repo root as .\vesper <command>.

CommandWhat it does
setupFirst-time setup; safe to rerun
devStart Postgres, then the API and Expo in two new windows
backendRun only the API in this terminal
frontendRun only Expo in this terminal (.\vesper frontend -c clears the cache)
docsRun this docs site on http://localhost:3000
docs-buildBuild the docs; fails on broken links
db / db-stopStart or stop Postgres
db-shellOpen psql as the superuser
migrateApply pending migrations
makemigration "msg"Autogenerate a migration from model changes
seedSeed an empty database
reset-dbDowngrade everything, migrate, reseed (wipes local data)
db-destroyDelete the Postgres container and its volume (reruns role setup next time)
testRun backend tests; extra args go to pytest (.\vesper test -k trips)
doctorCheck tools, env files and ports

Pointing the app at the API​

Status: not wired up yet

The screens still read the sample data in apps/frontend/src/data/trips.ts; nothing reads EXPO_PUBLIC_API_URL yet. The API already returns the same Trip shape, so switching over is a data-layer change only.

apps/frontend/.env sets EXPO_PUBLIC_API_URL:

Where the app runsURL
Android emulatorhttp://10.0.2.2:8000 (the emulator's route to your PC)
Webhttp://localhost:8000
Physical phonehttp://<your PC's LAN IP>:8000

The API listens on 0.0.0.0, so phones on the same Wi-Fi can reach it. Restart Expo with .\vesper frontend -c after changing .env.

Expo​

Start Expo from apps/frontend (.\vesper frontend does this), never from the repo root. In the Expo terminal: a opens Android, w opens the browser, r reloads, s switches between Expo Go and the dev build. Check both Android and web as you work. Stop Expo with Ctrl+C before closing the emulator.

Start the emulator separately and leave it running: emulator -avd vesper.

Troubleshooting​

ProblemFix
docker daemon not runningStart Docker Desktop, wait for it to say "running"
Port 5432 in useAnother Postgres is running locally; stop it or change the port in docker-compose.yml and both URLs in apps/backend/.env
/health returns 503Postgres is down: .\vesper db
Migration fails after pulling.\vesper reset-db (local data only)
Role/permission errors after editing db/initInit scripts only run on a fresh volume: .\vesper db-destroy, then .\vesper setup
Unknown AVD nameemulator -list-avds; ours is vesper
a finds no deviceadb devices; else adb kill-server and retry
AppEntry.js / assets\images errorsExpo was started from the wrong folder; use apps\frontend
failed to deserialize ... Specifierlightningcss mismatch: root overrides, clean reinstall, npm ls lightningcss
Stale or odd bundling errors.\vesper frontend -c
App can't reach the APICheck the URL table above, the Windows firewall, and CORS
packages/* imports failnpm install at the root; check workspaces