Daily development
Commands
All commands run from the repo root as .\vesper <command>.
| Command | What it does |
|---|---|
setup | First-time setup; safe to rerun |
dev | Start Postgres, then the API and Expo in two new windows |
backend | Run only the API in this terminal |
frontend | Run only Expo in this terminal (.\vesper frontend -c clears the cache) |
docs | Run this docs site on http://localhost:3000 |
docs-build | Build the docs; fails on broken links |
db / db-stop | Start or stop Postgres |
db-shell | Open psql as the superuser |
migrate | Apply pending migrations |
makemigration "msg" | Autogenerate a migration from model changes |
seed | Seed an empty database |
reset-db | Downgrade everything, migrate, reseed (wipes local data) |
db-destroy | Delete the Postgres container and its volume (reruns role setup next time) |
test | Run backend tests; extra args go to pytest (.\vesper test -k trips) |
doctor | Check tools, env files and ports |
Pointing the app at the API
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 runs | URL |
|---|---|
| Android emulator | http://10.0.2.2:8000 (the emulator's route to your PC) |
| Web | http://localhost:8000 |
| Physical phone | http://<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
| Problem | Fix |
|---|---|
docker daemon not running | Start Docker Desktop, wait for it to say "running" |
| Port 5432 in use | Another Postgres is running locally; stop it or change the port in docker-compose.yml and both URLs in apps/backend/.env |
/health returns 503 | Postgres is down: .\vesper db |
| Migration fails after pulling | .\vesper reset-db (local data only) |
Role/permission errors after editing db/init | Init scripts only run on a fresh volume: .\vesper db-destroy, then .\vesper setup |
Unknown AVD name | emulator -list-avds; ours is vesper |
a finds no device | adb devices; else adb kill-server and retry |
AppEntry.js / assets\images errors | Expo was started from the wrong folder; use apps\frontend |
failed to deserialize ... Specifier | lightningcss mismatch: root overrides, clean reinstall, npm ls lightningcss |
| Stale or odd bundling errors | .\vesper frontend -c |
| App can't reach the API | Check the URL table above, the Windows firewall, and CORS |
packages/* imports fail | npm install at the root; check workspaces |