Frontend Architecture

The frontend is a React 19 + Vite + TypeScript single-page application with TailwindCSS 4 styling and Shadcn/ui components. Served as static files by nginx.

Core Stack

TechnologyVersionPurpose
React19UI framework
ViteBuild tool, HMR
TypeScriptstrictType safety
TailwindCSS4Utility-first styling
Shadcn/ui(Radix UI)Accessible component primitives
React Routerv7Client-side routing
TanStack React QueryServer state management
ZustandGlobal client state
react-hook-form + ZodForm state and validation
i18nextGerman/English internationalization

Directory Structure

DirectoryFilesPurpose
src/pages/96Page-level components (one per route)
src/components/623+UI and feature components
src/components/ui/Shadcn/ui base components
src/hooks/43Custom React hooks
src/lib/queries/35React Query modules (key factories)
src/lib/api/API client functions
src/lib/Utilities, helpers, constants
src/stores/Zustand stores
src/locales/i18n translation files (de/en)

State Management

Each data type has a designated tool. See State Management for full rules.

Data TypeToolLocation
Server entities (CRUD)React Querylib/queries/
Global auth/preferencesZustand + localStoragestores/
URL-shareable UI stateURL state hookshooks/url-state/
Form fieldsreact-hook-form + Zodinline
Transient UIuseStateinline

Component Decomposition

Files exceeding 600 lines must be split. See Component Decomposition for the pattern.

ModuleContains
fooService.tsPure functions, constants, types (zero React)
useFooState.tsState, queries, mutations, handlers
FooSection.tsxPresentational (props + useTranslation only)
Foo.tsxOrchestrator (calls hook, composes sub-components)

URL State Hooks

Never use raw useSearchParams. See URL State Management.

HookPurpose
useTabStateTab switching with URL sync
useFilterStateMulti-parameter filter state
useModalStateDeep-linkable modals/dialogs
useMultiSortStateMulti-column sort + Shift+Click stacking

Source: frontend/src/hooks/url-state/

React Query Pattern

All query hooks live in frontend/src/lib/queries/, never inline in components. Uses key factory + as const pattern. ESLint warns on useMutation in components/ or pages/. See React Query Pattern for conventions.

Routing

96 page components mapped via React Router v7. See Routing and Pages Overview for the full route table.

Internationalization

Bilingual (German/English) via i18next. Translation files in src/locales/. LocalizedText type ({de: string, en: string}) used for all database text fields. See Internationalization and Validation Pattern.

Brand Colors

NameValueHex
Primaryoklch(75% 0.15 130)91C832
Secondaryoklch(44% 0.15 170)007C57
Gray-50oklch(98.7% 0 0)F9FAFB