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 into routeTree.gen.ts by @tanstack/router-plugin).

  • Dev server: npm run dev starts Vite on port 9002 (the port is set via vite --port 9002 in the npm script).

  • Container runtime: nginx:alpine serving dist/ as static assets and reverse-proxying /configs-service/ to the backend; the image exposes ports 80 and 443.

  • Startup: docker/ops/entrypoint.sh (POSIX shell) generates runtime-config.js, picks between the HTTPS and HTTP-only nginx templates based on the presence of /etc/nginx/ssl/tls.{crt,key}, and execs nginx -g 'daemon off;'.

  • API client: the axios instance in src/lib/axios.ts handles 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.html loads /runtime-config.js synchronously before the app bundle; the resulting window.RUNTIME_CONFIG is 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 /csrf for 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.

Roles

Roles & permissions

VIEWER

Read-only access. Can browse and export configurations.

EDITOR

VIEWER access + can edit configurations (create/update/delete/import).

ADMIN

EDITOR access + user management (create/edit/disable/delete users).