Payments Infrastructure in Africa
# Quidly
Kenya-first payments infrastructure, currently focused on a strict crypto v1:
- `method=CRYPTO`
- `asset=USDC`
- `chain=BASE`
This repository is a modular monolith. The backend remains the source of truth for payment lifecycle, ledgering, provider events, and webhook delivery state.
## Monorepo apps
- `apps/api` - NestJS backend with Prisma, PostgreSQL, BullMQ, Redis, and Base/USDC monitoring
- `apps/dashboard` - Next.js merchant dashboard using backend JWT auth
- `apps/docs` - Next.js documentation site for external developers
## Local prerequisites
- Node.js 22+
- pnpm 10+
- PostgreSQL 16+
- Redis 7+
## Quick start
1. Install dependencies:
```bash
pnpm install
```
2. Copy environment files:
```bash
cp apps/api/.env.example apps/api/.env
cp apps/dashboard/.env.example apps/dashboard/.env.local
```
3. Start PostgreSQL and Redis, then run the API migration:
```bash
pnpm --filter api exec prisma migrate dev
```
4. Seed a local merchant:
```bash
pnpm seed:api
```
The seed script prints a merchant email/password, API key, and webhook secret for local use.
5. Start the apps you need:
```bash
pnpm dev:api
pnpm dev:dashboard
pnpm dev:docs
```
Default local ports:
- API: `
localhost`
- Dashboard: `
localhost`
- Docs: `
localhost`
## Docker
For a local containerized stack with API + PostgreSQL + Redis:
```bash
pnpm docker:up
```
This uses the root Dockerfile for the API and docker-compose.yml for service orchestration.
To stop the stack:
```bash
pnpm docker:down
```
## Workspace commands
```bash
pnpm lint
pnpm test
pnpm test:e2e
pnpm build
```
## Deployment notes
Railway:
- run the API service from the repo root with the root `Dockerfile`
- attach managed PostgreSQL and Redis
- set `DATABASE_URL`, `JWT_SECRET`, `WEBHOOK_SECRET_ENCRYPTION_KEY`, `REDIS_HOST`, `REDIS_PORT`, `BASE_RPC_URL`, and `CRYPTO_WALLET_SEED`
- use a start command equivalent to `pnpm --filter api exec prisma migrate deploy && pnpm -- …