Quickstart
This guide matches the main Recurfy repository workflow: Postgres → API → Firebase emulators → web dashboard.
Prerequisites
- Node 22+ and pnpm 10+
- Docker (for Postgres)
- Firebase CLI (
npm i -g firebase-tools) - Optional: Stripe CLI for billing webhooks
1. Install and env
pnpm install
cp .env.example .env
Fill in values from .env.example (Firebase emulator ports, DATABASE_URL, API_SERVICE_TOKEN, etc.).
2. Database
docker compose up -d postgres
DATABASE_URL='postgresql://recurfy:recurfy@localhost:5432/recurfy' \
pnpm --filter @recurfy/db exec prisma migrate deploy
3. API (port 4000)
set -a && source .env && set +a
pnpm --filter api dev
4. Firebase emulators
set -a && source .env && set +a
export API_BASE_URL=http://localhost:4000
firebase emulators:start --only auth,firestore,functions --project demo-recurfy
5. Dashboard
pnpm --filter web dev
Open the URL Vite prints (often http://localhost:5173), sign up, create an org, and generate an API key.
6. Verify the data plane
Use a key from the dashboard:
KEY="recurfy_sk_..."
curl -s http://localhost:4000/v1/track \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"externalUserId":"user-1","entitlementKey":"api_calls","quantity":1}'
You should see an allowed response and usage updating in the dashboard within a few seconds.
For more detail on each service, see Local development.