Repository navigation
apps dashboard development
Active contributors: Vassiliy Kuzenkov
The frontend uses explicit Vue routes, public module entries and a generated OpenAPI client. Its check command covers lint, formatting, types, unit/component tests and a production build; static serving and authentication also have Rust integration contracts.
For the shared app/common/globals/Ui scope, origin/main contains 68 source files, 7 test files, a 10.3% test/source file ratio and 1 unique nonbot author. Configuration files are discussed here but excluded from these counts. The dashboard-wide total is 162 source files and 18 specs; file ratios are not statement/branch coverage.
| Layer | Put here | Source |
|---|---|---|
| app | Boot, router, shell, base stylesheet |
web/src/app/entry.ts, web/src/app/router.ts, web/src/app/layouts/default.vue, web/src/app/styles/main.css
|
| pages | Route parameters, URL filters and cross-module composition |
web/src/pages/changes/[id].vue, web/src/pages/analytics/index.vue
|
| modules | Domain query hooks, pure helpers and UI exposed through the module index |
web/src/modules/Changes/index.ts, web/src/modules/Analytics/index.ts
|
| common | Reusable utilities/composables without domain-module dependencies |
web/src/common/composables/useQueryParam.ts, web/src/common/utilities/formatMicroUsd.ts
|
| globals | Router type augmentation | web/src/globals/vue-router.d.ts |
web/eslint.config.ts applies the strict FEOD architecture preset. web/package.json requires public module entries and checks module cycles. Cross-module consumers import @/modules/Findings, for example, rather than reaching into its private UI/query files. Internal sibling imports stay within the module.
Pages use URL-shaped names, but web/src/app/router.ts still needs an explicit route entry. Its public and title metadata are declared by web/src/globals/vue-router.d.ts; web/src/app/entry.ts turns titles into Title · Sych.
web/src/modules/Ui/index.ts is the public shared UI surface. It exports shadcn-vue/Reka primitives plus ErrorNotice, LoadMore, StatusBadge, status labels and class-name merging. web/components.json directs generated components to this module and uses the reka-nova style with Lucide icons.
web/src/modules/Ui/lib/tone.ts is the status meaning table. Partial/unknown outcomes are warnings; unavailable/failed/high/critical states are bad; stale, superseded, dismissed or revoked values are inactive. An unmapped new status is neutral, not implicitly successful. web/src/modules/Ui/components/StatusBadge.vue combines that tone with a readable label.
web/src/app/styles/main.css imports Tailwind 4, animation utilities and the generated kit stylesheet, then defines Sych's light/dark CSS variables. It uses local/system font fallbacks rather than fetching web fonts. Prettier's Tailwind plugin sorts classes using this stylesheet, as configured in web/.prettierrc.json.
Keep shared behavior in common helpers:
-
web/src/common/composables/useQueryParam.tsreads scalar URL state, preserves unrelated filters and clears empty values with router replacement. -
web/src/common/utilities/toId.tsaccepts positive-integer URL text rather than passing NaN into a request. -
web/src/common/utilities/csvHref.tsbuilds a same-origin export URL and omits unset filters. -
web/src/common/utilities/formatMicroUsd.tsdistinguishes unknown price from zero;web/src/common/utilities/formatShare.tshides shares below five observations. -
web/src/common/utilities/formatTime.tsconverts Unix seconds to local dates and renders durations;web/src/common/utilities/counted.tshandles count labels.
The thin common/globals directories and UI kit need no separate wiki pages. Domain-specific report prose and pinned source links stay in Runs, described in the review reader.
web/package.json pins pnpm 12.16.1 and supports Node ^22.18.0 || >=24.12.0. From the repository root:
cd web
pnpm install --frozen-lockfile
pnpm devOpen the /ui/ base path. web/vite.config.ts proxies /v1 and /auth to SYCH_URL or http://127.0.0.1:8080. Vite does not replace backend configuration: browser-session mutations still need an Origin consistent with the server's public URL policy in crates/sych-app/src/server/caller.rs, and OAuth callback/redirect behavior belongs to the server.
Command in web/
|
What it runs |
|---|---|
pnpm gen:api |
openapi-typescript over schemas/openapi.json
|
pnpm lint |
Oxlint, then ESLint with cache and zero allowed warnings |
pnpm format:check |
Prettier check |
pnpm type-check |
vue-tsc --build |
pnpm test |
vitest run |
pnpm build |
Vite production build into web/dist/
|
pnpm check |
Generate API → lint → format check → type-check → test → build |
pnpm lint:fix, pnpm format
|
Explicit fixing/formatting commands |
At repository root, just web-check installs with the frozen lockfile and runs pnpm check; just web-fmt formats and fixes lint. just check includes Rust lint/tests and web-check, as defined in justfile. A Vite build alone is not the type check or the full validation pipeline.
.github/workflows/ci.yml installs pnpm from web/package.json, selects Node 24 and runs just check. The Dockerfile frontend stage generates API types and builds static assets, then copies them into the server image; that image-build step does not substitute for the fuller CI checks.
web/tsconfig.json references separate app, Node-tooling and Vitest projects:
-
web/tsconfig.app.jsonincludes Vue/app sources, excludes specs and enablesnoUncheckedIndexedAccess. -
web/tsconfig.node.jsoncovers Vite/Vitest/ESLint configuration with Node types and bundler resolution. -
web/tsconfig.vitest.jsonincludes specs with jsdom/Node types and clears the app test exclusions.
All three keep incremental build metadata under web/node_modules/.tmp/. The @ alias maps to web/src/ in TypeScript and Vite configuration.
Generated client types live at web/src/modules/Api/schema.gen.d.ts. Change the Rust API/OpenAPI source first and regenerate through web/package.json; see the API reference and repository tooling. The generated declaration is excluded from ESLint and Prettier in web/eslint.config.ts and web/.prettierignore.
web/.oxlintrc.json enables correctness errors with JavaScript/TypeScript, Vue and Vitest plugins. ESLint adds type-checked Vue/TypeScript rules, FEOD and Vitest recommendations, then disables conflicting formatting checks. Exceptions allow URL-shaped page/layout names and the generated UI kit's component names/optional props; they are not blanket exclusions for all domain Vue components.
web/pnpm-workspace.yaml declines vue-demi's installation build script because this is a Vue 3 app.
web/vitest.config.ts merges the Vite configuration, uses jsdom, roots execution at web/ and excludes e2e/** in addition to Vitest defaults. There is no committed browser E2E suite under web/ in this revision, no e2e package script and no configured coverage-report/threshold command in web/package.json.
The 18 tracked specs fall into these areas:
| Area | Existing contracts |
|---|---|
| API and Session | Successful/bodyless responses, refusal envelopes, ordered repository roles and instance URLs |
| Runs | Partial-coverage wording, category/severity order, HEAD/DIFF_BASE/TARGET_TIP links, agent prompts and inline code prose |
| Finding feedback | Submitted judgement/scope/rationale and unchanged normalized-body retry identity |
| Publication recreation | Required reason, exact endpoint/body and retained retry key |
| Waivers | Trimmed scope, local-time-to-UTC conversion, future expiry or condition, retry identity and state boundaries |
| Analytics and Overview | Judgement grouping/noisy-rule threshold and missing UTC-day filling |
| Audit and Ui | Supported target navigation and unknown/partial/unmapped status tones |
| common | URL filter preservation/clearing, positive IDs, CSV encoding, money, shares and count labels |
Concrete examples are web/src/modules/Runs/__tests__/report.spec.ts, web/src/modules/Findings/__tests__/FeedbackForm.spec.ts, web/src/modules/Operations/__tests__/ReconcileForm.spec.ts and web/src/modules/Waivers/__tests__/WaiverForm.spec.ts.
The component-request tests stub global fetch before dynamically importing the form because openapi-fetch captures fetch at client creation. They mount with a fresh QueryClient/VueQueryPlugin, trigger form submissions and flush promises. They test real request construction and key reuse rather than mocking away the entire mutation hook.
For one focused test, run from web/:
pnpm exec vitest run src/modules/Runs/__tests__/report.spec.tsFrontend specs do not cover the whole trust boundary. crates/sych-app/tests/ui.rs checks SPA fallback, asset 404s, caching/security headers and traversal resistance; crates/sych-app/tests/auth.rs covers browser authentication, and crates/sych-app/tests/api.rs covers HTTP contracts. See repository testing.
There are no module-local specs for Admin, Changes, Playground, Policy, Suggestions or Tours at this revision. Existing helper/component tests are not proof of complete route, keyboard/accessibility, OAuth-provider or deployed-server end-to-end coverage.
| File | Responsibility |
|---|---|
web/package.json |
Toolchain, scripts and FEOD settings |
web/eslint.config.ts |
Import boundaries and lint layering |
web/.oxlintrc.json |
Fast correctness rules |
web/.prettierrc.json |
Formatting and Tailwind class ordering |
web/vite.config.ts |
Plugins, /ui/ base and API proxy |
web/vitest.config.ts |
jsdom runner and exclusions |
web/tsconfig.app.json |
Browser type-check configuration |
web/tsconfig.vitest.json |
Test type-check configuration |
web/components.json |
Shared component-generation aliases |
web/src/modules/Ui/index.ts |
Public UI kit |
web/src/common/composables/useQueryParam.ts |
Shareable filter state |
web/src/globals/vue-router.d.ts |
Global route metadata types |
Add a route in web/src/app/router.ts, compose only public module exports in the page, and keep query keys aligned with all request filters. Put pure display rules next to a small spec instead of embedding them in a large template.
For a new mutation, follow the session/API conventions, test the request body and retry key, and retain explicit refusal feedback. For shared component changes, inspect web/src/modules/Ui/index.ts and generation aliases before changing import paths. Run pnpm check for frontend work and follow the repository's development workflow for the complete change process.