Files
lincodex/frontend/README.en.md
T

7.1 KiB

Frontend

Русский | English

A React and TypeScript SPA built with Vite and organized using FSD. The interface scaffold exists: public pages and the candidate and employer cabinet shells with navigation, shared screen states, and brand tokens. Every screen is a placeholder; business screens are separate tasks.

  • src/app/ starts the application: the route tree (router/), the query client (providers/), global styles, and the route error page.
  • src/pages/ holds pages: welcome (start page), placeholder (screen placeholders and the screen map), status (technical status), not-found.
  • src/widgets/ holds shells: public-shell, candidate-shell, employer-shell, plus the technical system-status widget.
  • src/features/ and src/entities/ are still empty.
  • src/shared/ui/ holds design tokens, fonts, logos, and primitives; src/shared/config/ holds route paths; src/shared/api/ holds the API client with generated endpoints, Zod schemas, and MSW mocks.
  • codegen/orval.config.ts configures generation from the shared OpenAPI contract.
  • scripts/ checks FSD boundaries and Orval compatibility with the OpenAPI 3.2 fixture.

From the repository root, make -C frontend dev starts development and make -C frontend check runs checks and builds the app. In Docker, Nginx serves the built files using configuration from deploy/nginx/.

Routes

Group Paths Shell
Public /, /login, /register, /verify-email, /support, /status PublicShell
Candidate /candidate and /candidate/ + onboarding, profile, assessment, results, invitations, privacy CandidateShell
Employer /employer (redirects to /employer/company), /employer/ + company, needs, candidates, invitations EmployerShell

Each group has its own not-found page. Paths are defined once in shared/config/paths.ts. The router uses React Router data APIs (createBrowserRouter): a route-level error boundary, loader redirects, and later lazy code splitting for cabinets. Loaders do not fetch data; server data belongs to TanStack Query. Access control is not implemented in the interface; the server enforces it.

/status is a service page: it checks /api/v1/healthz and is linked from the public footer only. It is not a product readiness indicator. In development mode the same page shows a gallery of states built from local fixtures (an error with retry, loading, empty, forbidden, saving, trust levels); production builds do not include it.

Server data

Generated Orval hooks call the shared same-origin apiRequest client, so the QueryClient has no default query function. Defaults in app/providers/query-client.ts:

  • retries: up to two, only for no response (status 0) and 5xx except 501; 4xx and invalid_response fail at once;
  • staleTime of 30 s; window focus does not refetch, and screens that need fresh data opt in per query;
  • mutations do not retry until the API supports Idempotency-Key.

Tokens and theme

Tokens live in shared/ui/theme/tokens.css: palette, semantic colors, type scale, spacing in 4px steps, radii, lines, focus ring, content widths, and motion. Breakpoints are fixed in media queries: 360px minimum, 768px tablet (48rem), 1024px desktop navigation (64rem), and 1280px verified wide layout.

Only the light theme ships. The graphite employer sidebar is a local dark region with its own checked text, link, and focus colors. A dark theme must define and check its own pairs instead of inheriting the light accents.

WCAG 2.2 contrast of the pairs in use:

Foreground Background Ratio Use
#1B1C21 #FFFFFF 17.01 Text on surfaces
#1B1C21 #EDEDED 14.53 Text on the canvas
#2D2E37 #FFFFFF 13.48 Secondary text
#2D2E37 #EDEDED 11.52 Secondary text on the canvas
#402FFF #FFFFFF 6.84 Links, active navigation, focus ring
#402FFF #EDEDED 5.85 Labels and links on the canvas
#FFFFFF #402FFF 6.84 Primary button, skip link
#EDEDED #1B1C21 14.53 Employer sidebar text
#FFFFFF #1B1C21 17.01 Active item and focus ring in the sidebar
#EC1D35 #FFFFFF 4.38 Error graphics only (needs 3:1)
#FFFFFF #EC1D35 4.38 Glyph inside the error mark (graphic)

Excluded pairs: red is not used for body text (4.38 is below 4.5); #402FFF on #1B1C21 (2.49) and on #2D2E37 (1.97) is not used; grey #C8C9CA (1.66 on white) is only for decorative dividers.

Fonts and logos

JetBrains Mono 2.304 (SIL OFL 1.1) is self-hosted from requirements/brandbook/: regular and bold woff2 files plus the license and authors list live in shared/ui/theme/fonts/. The font is used through Mono for numbers, scores, codes, and pseudonyms. Text uses the system font stack: Unbounded and Golos Text are not added, because their files and licenses are not in the repository.

The header uses the FSP brandbook logo: logo_02w.svg on light backgrounds and logo_01.svg on the graphite sidebar, unchanged, with the product name beside it.

Shared components

  • Page, Section, Stack: page layout; Page owns the only h1 and the document title.
  • Button, ButtonLink, TextLink, NavItem: controls with text labels; NavItem marks the active section with aria-current, a bar, and weight.
  • StatusView, LoadingState, EmptyState, ErrorState, ForbiddenState, SavingStatus: screen states. Each state has its own shape and text. ErrorState shows the code, status, server text, and request ID as plain text and offers a retry.
  • QueryView: maps a query result to loading, error, forbidden (401 and 403 without retry), empty, or data.
  • TrustLevel: an empty mark, ring, partial fill, or full mark with a visible label.
  • Mono, VisuallyHidden, SkipLink, MainRegion, BrandLogo.

Accessibility: every shell starts with a skip link to main, has landmarks and a visible focus ring, and moves focus to main after navigation. Animations respect prefers-reduced-motion.

Tests

Vitest runs in the Node environment with no DOM library. Routes are rendered through React Router's static handler and checked as HTML: shells, landmarks, the skip link, the active item, redirects, and not-found pages. State tests render components to markup; the query-error test runs the real QueryClient with the generated health operation and a stubbed fetch. Clicks and focus movement are checked manually in a browser; automated interaction tests need a DOM environment, which is a separate dependency decision.

See the development guide.