Surplus logo
Surplus Docsby Sharing Excess
GuidesDevelopersApps and services

Web client (apps/client)

Staff, partner, and driver experiences ship as a Vite SPA using TanStack Router and React 19.

Data and API

  • Calls the server through ORPC using contracts from @surplus/contracts and TanStack Query adapters.
  • VITE_API_URL (and related VITE_* keys) are validated in apps/client/src/env.ts. On localhost, the client defaults the API base to http://localhost:8080 so local dev does not require that variable.

UI stack

  • Tailwind CSS v4 with shadcn-style primitives under apps/client/src/components/ui/.
  • Mapbox for maps where features require geospatial UI.

Scripts

  • bun run dev — Vite dev server on port 3000 (package.json scripts)
  • bun run build / bun run preview — production bundle

Docker

apps/client/Dockerfile builds static assets and serves them with a minimal static file server suitable for Railway. Build-time environment is passed as ARG/ENV for VITE_* variables.