Self-hosted, open source subscription management platform for iOS and Android. Backend-first with Expo/React Native client SDKs — inspired by RevenueCat, built for developers who want full control.
- Subscription engine — Apple & Google receipt verification, lifecycle state machine
- Multi-tenant API — per-app API keys, isolated data boundaries
- Webhooks — reliable delivery with exponential backoff and dead-letter queue
- API gateway — rate limiting and usage tracking per plan tier
- Mobile SDK —
@opensub-haven/sdkfor Expo/React Native apps
- Express.js, TypeScript, Prisma, PostgreSQL
- Redis, BullMQ
- Zod validation, Docker, GitHub Actions CI
- Vitest + Testcontainers for integration tests
- Node.js 20+
- Docker (for Postgres, Redis, and integration tests)
# Install dependencies
npm install
# Start Postgres + Redis
docker compose up postgres redis -d
# Copy env and run migrations
cp .env.example .env
npm run db:generate
npm run db:push
npm run db:seed
# Start API and worker (separate terminals)
npm run dev --workspace=@opensub-haven/api
npm run dev --workspace=@opensub-haven/workerAPI health check: GET http://localhost:3000/health
curl -X POST http://localhost:3000/v1/apps \
-H "Content-Type: application/json" \
-d '{"name": "My App"}'Save the returned apiKey — use it as x-api-key on all authenticated routes.
apps/
api/ Express HTTP API
worker/ BullMQ background jobs
sample-app/ Expo app for Maestro E2E tests
packages/
shared/ Types, Zod schemas, state machine
sdk/ Expo/React Native client SDK
prisma/ Database schema and seed
npm run test:unit # Fast unit tests (no Docker)
npm run test:integration # API integration tests (requires Docker)
npm run test # All tests via TurborepoFull E2E guide: docs/e2e-testing.md
npm run e2e:up # Docker: Postgres, Redis, API, worker
cd apps/sample-app && npx expo run:android # or run:ios
maestro test .maestro/android/ # or .maestro/ios/Uses Maestro for iOS/Android UI tests against the sample app and sandbox store flows.
| Endpoint | Description |
|---|---|
POST /v1/apps |
Create app (returns API key) |
POST /v1/users |
Create user |
POST /v1/products |
Register subscription product |
POST /v1/apple/verify |
Verify iOS receipt |
POST /v1/google/verify |
Verify Android purchase |
GET /v1/subscriptions/:userId |
List user subscriptions |
POST /v1/webhooks |
Register webhook endpoint |
GET /v1/usage |
API usage analytics |
See docs/sdk-integration.md for mobile SDK setup.
MIT