Setup
Prerequisites
- Node.js 24.
- pnpm 9 or newer.
- A local Postgres database.
- Expo tooling for mobile development.
Environment variables
Copy .env.example to .env and fill in the values for:
DATABASE_URLAPI_PORTEXPO_PUBLIC_API_URLEXPO_PUBLIC_WEB_PUSH_VAPID_PUBLIC_KEYfor browser push subscriptions, when web push is enabled.AUTH_SECRETAUTH_BASE_URLAUTH_GOOGLE_CLIENT_IDAUTH_GOOGLE_CLIENT_SECRETAUTH_APPLE_CLIENT_IDAUTH_APPLE_TEAM_IDAUTH_APPLE_KEY_IDAUTH_APPLE_PRIVATE_KEYorAUTH_APPLE_PRIVATE_KEY_PATHto generate Apple client secrets automatically.AUTH_SESSION_TTL_DAYS
Local development
- Install dependencies with
pnpm install. - Start Postgres and apply migrations with
pnpm db:setup. - Start the backend with
pnpm dev:api. - Start the Expo app with
pnpm dev:mobile. - Open the app in web, Android, or iOS as needed.
Database setup
- The repo ships with
docker-compose.ymlfor a local Postgres 16 instance. - The container binds to
127.0.0.1:${POSTGRES_PORT}so it is not exposed beyond the host. - The Drizzle migrations in
packages/db/drizzle/create both the schema and thepgcryptoprerequisite for UUID generation. - Generate new migration SQL with
pnpm db:generateafter changingpackages/db/src/schema.ts. - Apply migrations with
pnpm db:migrate. pnpm db:setupcombines container startup and migration application for normal local use.- Use
pnpm db:resetto recreate the database volume and replay migrations from scratch. - Use
pnpm db:testafter the API is running to validate container health, migration state, and a persisted API round-trip.
VPS recreation
Use VPS Setup Checklist for a full rebuild and validation pass.
The database rule is fixed for the current scaffold: keep Postgres bound to 127.0.0.1 and keep DATABASE_URL pointed at localhost when the API runs on the VPS host. If the API later moves into Docker on the same compose network, remove the published Postgres port and connect to the postgres service name instead.
Track remaining VPS and website validation work in VPS And Website Tasks.
GitHub Pages setup
- In the GitHub repository, open Settings.
- Open Pages.
- Set Source to GitHub Actions.
- Keep
.github/workflows/jekyll-gh-pages.ymlenabled onmain. - The workflow builds Jekyll from
./docs, uploads./_site, and deploys to GitHub Pages. - Confirm the latest Pages workflow run succeeds and the docs site loads.
Publishing rule
- Keep all documentation pages inside the
docs/folder. - Update
docs/index.mdwhen the site structure changes. - Keep the docs aligned with the actual app scaffold and setup commands.