Skip to main content

Getting started

Use Node 22, pnpm 11.10.0 (pinned in package.json), and PostgreSQL 16. Android needs JDK 21 and the Android SDK versions in apps/mobile/gradle/libs.versions.toml.

API and web​

From the repository root, in an isolated development environment:

corepack enable
pnpm install --frozen-lockfile
docker compose -f docker-compose.dev.yml up -d
cp .env.example apps/api/.env

Edit apps/api/.env: set NODE_ENV=development, APP_ENV=development, and DATABASE_URL=postgresql://postgres:postgres@localhost:5432/taghvimam. Replace JWT_SECRET, JWT_REFRESH_SECRET, and SYNC_CURSOR_SECRET with separate random values. Remove sample Kavenegar settings for SMS-free local development. Only explicit APP_ENV=development or APP_ENV=test exposes an OTP in the response; unset fails closed, and OTPs are not logged to the console. Never enable debug mode in production or copy OTPs into reports.

pnpm --filter @taghvimam/contracts build
pnpm --filter taghvimam-backend prisma:generate
pnpm --filter taghvimam-backend db:deploy
pnpm dev

Migrations are required; db:push does not install the sync triggers. API is at http://localhost:5000, web at http://localhost:5173. Leave VITE_API_URL unset locally so Vite proxies /api to the local API. Check curl http://localhost:5000/health/ready; use the local /api-docs Swagger page, not production, for write experiments.

Android and docs​

Inside apps/mobile: ./gradlew :android:assembleBazarDebug. Debug defaults to the production API. Set and verify the test host override before experimental login or instrumentation.

For this site, from the root:

npm ci --prefix docs
cp apps/api/openapi.json docs/static/openapi.json
npm start --prefix docs

Next: Android, web, or tests. The full guides are in Persian.