Frontend
Owner: Frontend Engineering Last reviewed: 2026-Q2
The frontend is a Vite + React 19 + TypeScript app with Tailwind and Radix UI primitives. Authentication uses Clerk. API clients are generated from OpenAPI using Orval.
Key Paths
frontend/package.json– scripts (dev,build,preview,orval).frontend/openapi.json– OpenAPI source for client generation.frontend/orval.config.ts– Orval configuration → outputs tosrc/api/generated.src/lib/*– API config and utilities.src/api/*– Thin wrappers over generated clients.src/components/*– UI primitives and feature components (kanban, layout, dialogs).src/hooks/*– custom hooks (useApiError,useTasks,use-mobile).
Patterns
- Data fetching: Use TanStack Query. Co-locate queries with features; keep caching and invalidations explicit.
- Generated clients: Regenerate with
npm run orvalwhen backend changes OpenAPI. Do not hand-editsrc/api/generated/*. - Generated code policy lives in
generated-code.md. - Forms and validation:
react-hook-form+zodschemas. - Styling: Tailwind v4 + utility helpers (
clsx,tailwind-merge). Keep components accessible (Radix). - Frontend UX and state standards live in
frontend-ux-standards.md. - Auth: Use
@clerk/clerk-react. Read the publishable key fromVITE_CLERK_PUBLISHABLE_KEY. - Routing:
react-router-domwith route components insrc/pages/*and layout incomponents/layout/*.
Error Handling
- Centralize API error parsing in
useApiErrorand handle toasts in UI. - Prefer user-friendly messages; log technical details to console only in dev.
Kanban Example
- Drag & drop via
@dnd-kit/*. - Data entities mirror backend schemas (items, columns, comments, profiles) via generated models (e.g.,
src/api/generated/models/*). - Mutations: keep optimistic updates safe; reconcile with server responses.
Performance
- Code-split by route if payload grows; lazy-load heavy components.
- Memoize expensive subtrees; avoid prop drilling by composing hooks.
- Batch network calls where possible; leverage server pagination.
Testing & Linting
- ESLint config in
eslint.config.js. Keep type-aware rules enabled for production code. - Prefer component tests for complex UI and integration tests around critical flows.
Local Dev
- Env: copy
frontend/env.exampleto.envand setVITE_APP_API_URLto backend and Clerk publishable key. - Run:
npm ci && npm run dev.