Prerequisites
- Node.js 18+ and npm
- A Supabase project (use the shared team project or create your own)
- A PostgreSQL database (the Supabase project’s built-in database works fine)
Installation
Configure the backend
Copy the example environment file:Open
backend/.env and fill in all four required variables:| Variable | Where to find it |
|---|---|
DATABASE_URL | Supabase → Project Settings → Database → Connection string (URI) |
SUPABASE_URL | Supabase → Project Settings → API → Project URL |
SUPABASE_SERVICE_KEY | Supabase → Project Settings → API → service_role secret key |
SUPABASE_ANON_KEY | Supabase → Project Settings → API → anon public key |
Physical device? The frontend automatically derives the backend host from the Metro bundler URI, so your phone connects to the backend without any manual configuration — as long as it is on the same WiFi network as your development machine.
Backend environment variables
All backend variables go inbackend/.env.
Optional rate-limit overrides
The rate limiters are configured via environment variables. If unset, the defaults below apply.| Variable | Default | Description |
|---|---|---|
RATE_LIMIT_BY | ip | Key requests by ip or user |
RL_PUBLIC_WINDOW_MINUTES | 15 | Window length for public endpoints |
RL_PUBLIC_MAX | 100 | Max requests per window (public) |
RL_AUTH_WINDOW_MINUTES | 15 | Window length for auth endpoints |
RL_AUTH_MAX | 5 | Max requests per window (auth) |
RL_COMPLETION_WINDOW_HOURS | 1 | Window length for completion submissions |
RL_COMPLETION_MAX | 10 | Max completion submissions per window |
RL_FLAG_WINDOW_HOURS | 1 | Window length for flag submissions |
RL_FLAG_MAX | 5 | Max flag submissions per window |
Frontend environment variables
The frontend reads from.env in the frontend/ directory (or the project root). No frontend .env is required for local development — the app auto-detects the backend URL from Metro.
Only set these variables when you need to override the defaults:
| Variable | When to set |
|---|---|
EXPO_PUBLIC_SUPABASE_URL | Only when you want the frontend to upload images directly to Supabase (bypassing the backend proxy) |
EXPO_PUBLIC_SUPABASE_ANON_KEY | Required alongside EXPO_PUBLIC_SUPABASE_URL for direct uploads |
EXPO_PUBLIC_API_URL | Only when pointing the app at a remote or production API |
Architecture
Understand how the frontend, backend, and database connect.
Database
Run migrations and explore the data models.