System Overview
Purpose
FT Configs UI is a Vite + React single-page application that allows operators to:
-
browse configuration dictionaries,
-
export snapshots,
-
and (when permitted) apply changes via forms or import flows with dry-run.
Key facts (from the repository)
-
Framework: Vite 7 + React 19 SPA; routing via TanStack Router file-based routes under
src/routes/**(tree generated intorouteTree.gen.tsby@tanstack/router-plugin). -
Dev server:
npm run devstarts Vite on port9002(the port is set viavite --port 9002in the npm script). -
Container runtime:
nginx:alpineservingdist/as static assets and reverse-proxying/configs-service/to the backend; the image exposes ports80and443. -
Startup:
docker/ops/entrypoint.sh(POSIX shell) generatesruntime-config.js, picks between the HTTPS and HTTP-only nginx templates based on the presence of/etc/nginx/ssl/tls.{crt,key}, and execsnginx -g 'daemon off;'. -
API client: the axios instance in
src/lib/axios.tshandles base-URL resolution, CSRF token fetching with concurrent-request deduplication, a 401 refresh-token retry flow, and a read-only guard for VIEWER users. -
Runtime configuration:
index.htmlloads/runtime-config.jssynchronously before the app bundle; the resultingwindow.RUNTIME_CONFIGis validated at runtime against a Zod schema (src/lib/runtime-config.ts). -
Auth model: cookie-based requests (
withCredentials: true) plus a CSRF token fetched from/csrffor unsafe methods.
System boundary
FT Configs UI depends on a single backend base URL (ft-configs-service) for:
-
authentication and session management,
-
dictionary CRUD,
-
import/dry-run/export endpoints,
-
environment snapshot metadata.
Anything not served from the UI (database, email delivery, caches, etc.) is owned by the backend environment.