Monorepo structure

openproxy/
├── apps/
│   ├── api/      # Rust + Axum proxy
│   ├── server/   # Bun + Elysia backend
│   └── web/      # React + Vite frontend
├── packages/
│   ├── schema/            # Shared Zod/TypeBox schemas
│   ├── payment-provider/  # Payment gateway abstraction
│   ├── phone-auth/        # Phone OTP abstraction
│   └── ui/                # Shared React components
└── website/      # Docs site (Stropress)

Start all services at once

# From repo root
bun run dev

Runs turbo run dev, which starts all workspaces that expose a dev script in parallel.

Start services individually

Rust Proxy (apps/api)

cd apps/api
cargo run

Requires apps/api/.env with DATABASE_URL, RSA_PRIVATE_KEY, and PORT.

Business Server (apps/server)

cd apps/server
bun run dev

Web — Tenant dashboard

cd apps/web
bun run dev:tenant

Web — Admin panel

cd apps/web
bun run dev:admin
  1. Start apps/server and confirm it is healthy at http://localhost:3888/api/health
  2. Start apps/api and confirm curl http://localhost:5060/health returns 200
  3. Start apps/web for end-to-end UI testing

Running tests

Rust Proxy

cd apps/api
cargo test

All unit and integration tests run in-process with embedded HTTP servers. No external services required.

Server / packages

bun test

Database migrations

cd apps/server
bun run migrate      # apply pending migrations

Migration SQL lives in apps/server/drizzle/. Schema changes should be made via Drizzle and a new migration file.

Key environment files

FilePurpose
apps/server/.envAuth secrets, DB URL, RSA public+private key, email/OAuth
apps/api/.envDB URL, RSA private key, port
apps/web/envs/Frontend env files per target (tenant/admin)

Key ports

ServiceDefault port
apps/server3888
apps/api5060
apps/web5173 (Vite, check terminal output)