Setup
Prerequisites
- Node.js 20 or newer.
- 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_URLAUTH_SECRETAUTH_BASE_URLAUTH_GOOGLE_CLIENT_IDAUTH_GOOGLE_CLIENT_SECRETAUTH_APPLE_CLIENT_IDAUTH_APPLE_CLIENT_SECRETAUTH_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
- Copy the same
.envvalues to the VPS. - Run
pnpm db:setupordocker-compose up -d postgres && pnpm db:migrateon the VPS. - Keep the port binding on
127.0.0.1so Postgres is only reachable from services on that server. - If the API also runs on the VPS host, keep
DATABASE_URLpointed atlocalhost. - If the API later moves into Docker on the same compose network, remove the published port and connect to the
postgresservice name instead.
GitHub Pages setup
- In the GitHub repository, open Settings.
- Open Pages.
- Set Source to deploy from a branch.
- Select branch
mainand folder/docs. - Save the settings and wait for GitHub Pages to publish the docs site.
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.