/v1/* API
surface from in-memory fixtures. Useful for UI iteration when you don’t
want to boot Postgres + Stripe + provider adapters.
Set up
Run the client in mock mode
123456 (the mock
backend accepts any 6-digit string). You’re in the dashboard with a
$310.02 starting balance and a few fake rentals.
To expose it on your LAN (e.g. for testing on a phone):
What the mock backend simulates
| Endpoint | Behavior |
|---|---|
POST /v1/auth/request-code | Always 200 — no email sent |
POST /v1/auth/verify-code | Accepts any 6-digit code |
POST /v1/billing/checkout | Returns a fake checkoutUrl that goes straight to a “success” simulator |
POST /v1/rentals | Reserves wallet, returns a fake rental with provisioning status |
GET /v1/rentals/:id | Flips to running after ~2s |
GET /v1/catalog/listings | Returns a static fixture covering all 6 GPU families |
Run the real backend locally
If you want to develop against actual Postgres + Stripe sandbox:localhost:5173, server at localhost:3000. Vite proxies
/v1/* to :3000 automatically (see vite.config.ts).
CI loop
The pre-push gate runstypecheck, lint, and build across all
workspaces:
Common environment variables
| Variable | Where | Purpose |
|---|---|---|
VITE_MOCK_MODE | client | 1 to enable the fetch shim |
DATABASE_URL | server | Postgres connection string |
STRIPE_SECRET_KEY | server | sk_test_… or sk_live_… |
STRIPE_WEBHOOK_SECRET | server | whsec_… |
STRIPE_PUBLISHABLE_KEY | server | Returned to client via /v1/billing/config |
GOOGLE_CLIENT_ID / _SECRET | server | OAuth — empty disables |
GITHUB_CLIENT_ID / _SECRET | server | OAuth — empty disables |
packages/server/src/env.ts for the full schema.