Trader-facing web application for the Hyperwood prediction market platform.
- TanStack Start
- TanStack Router + TanStack Query
- Tailwind CSS
- shadcn/ui primitives
- React Hook Form + Zod
- Recharts
- react-i18next
- Storybook
- Vitest
- Playwright
- public market discovery
- market detail with live chart and order book
- login, registration, email verification, MFA verification
- portfolio summary and historical account views
- wallet funding flows
- account security: sessions, TOTP, API keys
Internal operator workflows are intentionally out of scope here.
- Start the Hyperwood backend API.
- Copy the env file:
cp .env.example .env- Install dependencies:
npm install- Start the frontend:
npm run devDefault local URLs:
- trader frontend:
http://localhost:3002 - backend API:
http://localhost:3000
Required:
VITE_API_BASE_URL
Optional:
VITE_APP_TITLEVITE_DEFAULT_LOCALEPLAYWRIGHT_BASE_URLE2E_MARKET_IDE2E_USER_EMAILE2E_USER_PASSWORD
npm run dev
npm run build
npm run preview
npm run check
npm run check:types
npm run test
npm run storybook
npm run build-storybook
npm run test:e2e
npm run generate:apiThis app does not expose backend bearer tokens to browser code.
- login and registration happen through TanStack Start server functions
- the backend opaque session token is stored in an HttpOnly cookie
- authenticated loaders and actions call the backend server-to-server
- private SSE for
/api/v1/portfolio/streamis proxied through the frontend
The API types are generated from the backend OpenAPI spec:
npm run generate:apiStorybook is configured for the trader UI components and uses app-level providers so links, query hooks, and i18n work inside stories.
Run:
npm run storybookBuild:
npm run build-storybookThe smoke tests assume the backend is running and optionally use seeded credentials.
Configured smoke coverage:
- homepage shell
- login/register routes
- market detail route for a known market id
- authenticated portfolio and wallet access
If you want the full smoke suite:
E2E_MARKET_ID=<market-id> \
E2E_USER_EMAIL=<email> \
E2E_USER_PASSWORD=<password> \
npm run test:e2eIf those values are missing, the backend-dependent cases are skipped.
src/
components/
features/
auth/
funding/
markets/
orders/
portfolio/
lib/
api/
realtime/
session/
locales/
routes/
- PT-BR is the default locale
- EN is available as a secondary locale
- UI is intentionally dark and trading-oriented
- the backend remains the system of record for trading, funding, settlement, and security state