Vite + React 19 + TypeScript SPA for the Pocketpull collector experience (packs, vault, marketplace, rewards, profile). It talks to the API over HTTP with cookie-based sessions (credentials: "include").
- Node.js 20+ (recommended)
- For real data: the API running (see the repo
backend/README) withWEB_ORIGINmatching this app’s URL (defaulthttp://localhost:5173)
cd frontend
cp .env.example .env
npm installEdit .env as needed (see below).
| Command | Description |
|---|---|
npm run dev |
Dev server at http://localhost:5173 |
npm run build |
Typecheck + production bundle to dist/ |
npm run preview |
Serve dist/ locally for smoke tests |
Defined in .env (see .env.example):
| Variable | Purpose |
|---|---|
VITE_API_URL |
Base URL of the API (no trailing slash), e.g. http://localhost:8080. Used for all fetch calls. |
Auth note: The browser must send cookies to the API. The API’s WEB_ORIGIN / CORS settings must allow your frontend origin, or login and /auth/me will fail.
src/pages/— Route-level screens (home, packs, reveal, inventory, profile, etc.)src/components/— Shared UI and layout (app-shell, nav, etc.)src/lib/api.ts— Centralapi()helper (fetchtoVITE_API_URLwith session cookies)src/providers/— React Query, auth contextsrc/shared/schemas.ts— Zod-derived types shared with API shapes where applicable
/, /how-it-works, /packs, /packs/:slug, /reveal/:slug, /slab-roll, /slab-roll/:machineId, /vault, /marketplace, /rewards, /leaderboard, /profile, /partners, /login
Unknown paths redirect to /.