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
Recommended startup order
- Start
apps/serverand confirm it is healthy athttp://localhost:3888/api/health - Start
apps/apiand confirmcurl http://localhost:5060/healthreturns 200 - Start
apps/webfor 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
| File | Purpose |
|---|---|
apps/server/.env | Auth secrets, DB URL, RSA public+private key, email/OAuth |
apps/api/.env | DB URL, RSA private key, port |
apps/web/envs/ | Frontend env files per target (tenant/admin) |
Key ports
| Service | Default port |
|---|---|
apps/server | 3888 |
apps/api | 5060 |
apps/web | 5173 (Vite, check terminal output) |