Documentation

Quick start

Run Payghaam locally — infrastructure, API, worker, and dashboard.

Prerequisites

  • Node.js 20+ and pnpm 9+
  • Docker (Postgres + Redis via docker compose)
  • A Firebase project for dashboard Google sign-in + service account for API auth

Install & configure

Terminal
pnpm install
cp .env.example .env   # fill Firebase + secrets

# Generate a 32-byte encryption key for channel secrets at rest
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
# → SECRETS_ENCRYPTION_KEY in .env

Database

bash
pnpm infra:up        # Postgres + Redis
pnpm db:generate     # Prisma client
pnpm db:push         # apply schema

Run services

Open three terminals:

bash
pnpm api         # HTTP API → :4000  (Swagger at /api/docs)
pnpm worker      # journey + delivery workers
pnpm dashboard   # admin UI → :3003

Create your first project

  1. Open the dashboard and sign in with Google.
  2. Create an organization, then a project.
  3. Go to Project settings → Channels and configure push (FCM for Android, APNs for iOS).
  4. Create an SDK API key and a REST key under API Keys.
  5. Integrate the Flutter SDK or call the REST API to identify a user and send a test push.

Key environment variables

VariablePurpose
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis for queues, cache, idempotency
SECRETS_ENCRYPTION_KEYAES-256-GCM key for FCM/APNs/SMTP credentials
FIREBASE_*Dashboard auth + API token verification
warning

Warning

Never commit .env or channel credential files. SDK keys belong in the app; REST keys and APNs/FCM secrets belong on the server or dashboard only.