Architecture overview
The Expo app talks only to the FastAPI backend. The backend owns all business logic and is the only thing that touches Postgres or holds third-party keys.
Environments
Today only local exists. Staging and prod are planned on AWS, following the infrastructure plan.
| Environment | App build | API runs on | Database | Secrets |
|---|---|---|---|---|
| Local | Expo dev server | uvicorn on your PC | Postgres in Docker Compose | apps/backend/.env (git-ignored) |
| Staging (planned) | EAS preview | EC2 via Kamal | RDS | SSM Parameter Store |
| Prod (planned) | EAS production | EC2 via Kamal | RDS | SSM Parameter Store |
Repo layout
.
├── apps/
│ ├── backend/ FastAPI app, models, migrations, tests
│ └── frontend/ Expo / React Native app
├── packages/ Shared TypeScript code (npm workspaces; empty for now)
├── docs/ This Docusaurus site (its own npm project)
├── docker-compose.yml Local Postgres
├── scripts/vesper.ps1 Dev tasks behind vesper.cmd
├── vesper.cmd Dev task runner: .\vesper <command>
└── CLAUDE.md Pointers for AI coding assistants
docs/ is deliberately not an npm workspace, so Docusaurus's React and webpack versions can never clash with the versions Expo pins.
Principles
- The backend is the only gatekeeper. Authorization is per trip (via
trip_members) and is checked in the backend's service layer, never in the app. - No secrets in the app. Every
EXPO_PUBLIC_*value is readable by anyone who downloads the app. - Old app builds stay alive for weeks. API and schema changes must stay backwards compatible: see the migration rules in Database.