Server documentation

GigRentals platform

A California P2P car-share marketplace backend that demos live with no vendor bills, then turns into production by setting one or two environment variables.

Live process

Investor demo · us-west

demobills today $0US-CA

database

memory

cache

memory

broker

memory

payments

simulated

auth

memory

uploads

memory

  • Investor demo runs with zero vendor accountsdemo

    Memory adapters + simulated Stripe/IoT/Twilio. npm run dev is enough.

  • Durable Postgres (DATABASE_URL)production

    Unset on purpose. Set DATABASE_URL to Neon or Supabase to persist (PITR backups included by those hosts).

  • Non-default JWT_SECRETproduction

    Using the built-in demo secret. Set JWT_SECRET before GO_LIVE.

  • Stripe Connect for real moneyproduction

    Holds post to the in-process ledger only. No card network fees.

  • Compliance jurisdiction ()production

    US-CA is the first live state. Other states stay dark until counsel enables them.

  • California counsel reviewed program formsproduction

    On-site contracts are templates. Set LEGAL_COUNSEL_REVIEWED=true after a CA attorney signs off.

  • 1099 + local tax collection switchesproduction

    TAX_FORM_1099_ENABLED and TAX_COLLECTION_ENABLED must be true before live payouts.

  • Point-in-time backupsproduction

    Memory mode has nothing to back up. Persistence and backups arrive with DATABASE_URL.

Backups: none · memory · n/a — process restart wipes demo state. Upgrade knobs: DATABASE_URL, REDIS_URL.

What this server is

GigRentals LLC is a marketplace, not a rental-car agency. The backend is a modular monolith: one Next.js deployable, DDD modules, ports for Postgres, Redis, AMQP, and Stripe. Investor walkthroughs hit real routes and real algorithms. They do not hit paid APIs unless you add keys.

  • Two places to read every loop: this site, and @docs comments on the source file.
  • Same TypeScript path in demo and production — adapters swap, business rules do not.
  • Countrywide expansion is a jurisdiction table, not a rewrite. Only US-CA can take live money today.

The only knobs that matter later

VariableWhat it turns onWhen to set it
DATABASE_URLPostgres + PostGIS + host PITR backupsWhen demo state must survive a restart
REDIS_URLShared presence, rate limits, Socket.io adapterWhen you run more than one process or realtime workers
GO_LIVE=trueProduction gates (JWT, Stripe, counsel, 1099, tax)After a California attorney and a broker have signed off

Stripe, Twilio, Mapbox, Persona, and IoT webhooks are optional overlays. The loops below already complete without them.

Plain English: /docs/company (what the business is). If production is on fire: /docs/break-glass. Point a Namecheap domain at Vercel: /docs/deploy.

  1. Investor demo — press one button, watch every loop.
  2. Runtime loops — GPS, match, FSM, escrow, unlock, SOS.
  3. Turnkey checklist — the production gate list the server actually enforces.