Skip to main content
The client ships a mock-fetch shim that serves the entire /v1/* API surface from in-memory fixtures. Useful for UI iteration when you don’t want to boot Postgres + Stripe + provider adapters.

Set up

git clone https://github.com/Cryptex-Organisation/gpuoutlet-mono
cd gpuoutlet-mono
pnpm install

Run the client in mock mode

cd packages/client
VITE_MOCK_MODE=1 pnpm dev
Open http://localhost:5173. The marketing landing loads. Click Login → use any email + the code 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):
VITE_MOCK_MODE=1 pnpm dev --host
# Network: http://192.168.1.x:5173/

What the mock backend simulates

EndpointBehavior
POST /v1/auth/request-codeAlways 200 — no email sent
POST /v1/auth/verify-codeAccepts any 6-digit code
POST /v1/billing/checkoutReturns a fake checkoutUrl that goes straight to a “success” simulator
POST /v1/rentalsReserves wallet, returns a fake rental with provisioning status
GET /v1/rentals/:idFlips to running after ~2s
GET /v1/catalog/listingsReturns a static fixture covering all 6 GPU families
The mock store is in-memory only — refreshing the browser resets it to the initial fixture.

Run the real backend locally

If you want to develop against actual Postgres + Stripe sandbox:
# Terminal 1
cd packages/server
cp .env.example .env  # fill in DATABASE_URL, STRIPE_*, OAuth secrets
pnpm db:migrate
pnpm dev

# Terminal 2
cd packages/client
pnpm dev  # NO VITE_MOCK_MODE
Client at localhost:5173, server at localhost:3000. Vite proxies /v1/* to :3000 automatically (see vite.config.ts).

CI loop

The pre-push gate runs typecheck, lint, and build across all workspaces:
npx turbo run typecheck lint build --filter=@gpuoutlet/client
The pre-commit hook runs ESLint + Prettier on staged files.

Common environment variables

VariableWherePurpose
VITE_MOCK_MODEclient1 to enable the fetch shim
DATABASE_URLserverPostgres connection string
STRIPE_SECRET_KEYserversk_test_… or sk_live_…
STRIPE_WEBHOOK_SECRETserverwhsec_…
STRIPE_PUBLISHABLE_KEYserverReturned to client via /v1/billing/config
GOOGLE_CLIENT_ID / _SECRETserverOAuth — empty disables
GITHUB_CLIENT_ID / _SECRETserverOAuth — empty disables
See packages/server/src/env.ts for the full schema.