veza/apps/web
senke 698859cc52 feat(backend,web): surface RTMP ingest health on the Go Live page
Fifth item of the v1.0.6 backlog. "Go Live" was silent when the
nginx-rtmp profile wasn't up — an artist could copy the RTMP URL +
stream key, fire up OBS, hit "Start Streaming" and broadcast into the
void with no in-UI signal that the ingest wasn't listening. The audit
flagged this 🟡 ("livestream sans feedback UI si nginx-rtmp down").

Backend (`GET /api/v1/live/health`)
  * `LiveHealthHandler` TCP-dials `NGINX_RTMP_ADDR` (default
    `localhost:1935`) with a 2s timeout. Reports `rtmp_reachable`,
    `rtmp_addr`, a UI-safe `error` string (no raw dial target in the
    body — avoids leaking internal hostnames to the browser), and
    `last_check_at`.
  * 15s TTL cache protected by a mutex so a burst of page loads can't
    hammer the ingest. First call dials; subsequent calls within TTL
    serve the cached verdict.
  * Response ships `Cache-Control: private, max-age=15` so browsers
    piggy-back the same quarter-minute window.
  * When the dial fails the handler emits a WARN log so an operator
    watching backend logs sees the outage before a user does.
  * Public endpoint — no auth. The "RTMP is up / down" signal has no
    sensitive payload and is useful pre-login too.

Frontend
  * `useLiveHealth()` hook: react-query with 15s stale time, 1 retry,
    then falls back to an optimistic `{ rtmpReachable: true }` — we'd
    rather miss a banner than flash a false negative during a transient
    blip on the health endpoint itself.
  * `LiveRtmpHealthBanner`: amber, non-blocking banner with a Retry
    button that invalidates the health query. Copy explicitly tells the
    artist their stream key is still valid but broadcasting now won't
    reach anyone.
  * `GoLivePage` wraps `GoLiveView` in a vertical stack with the banner
    above — the view itself stays unchanged (the key + instructions
    remain readable even when the ingest is down).

Tests
  * 3 Go tests: live listener reports reachable + Cache-Control header;
    dead address reports unreachable + UI-safe error (asserts no
    `127.0.0.1` leak); TTL cache survives listener teardown within
    window.
  * 3 Vitest tests: banner renders nothing when reachable; banner
    visible + Retry enabled when unreachable; Retry invalidates the
    right query key.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 23:52:36 +02:00
..
.husky state-ownership: delete unused optimisticStoreUpdates.ts file 2026-01-15 19:26:53 +01:00
.storybook feat(ui): add SUMI design system components, seasonal hooks, and i18n updates 2026-03-31 19:15:54 +02:00
dev_audit/frontend fix: UI remediation Phase 1 (S0-S5) + Phase 2 Sprint 6 shadow system 2026-02-12 10:13:44 +01:00
docs docs: update FEATURE_STATUS.md for v0.102 — gear, live, queue, developer operational 2026-02-20 12:56:55 +01:00
lighthouse-reports BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
public fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
scripts stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
src feat(backend,web): surface RTMP ingest health on the Go Live page 2026-04-16 23:52:36 +02:00
visual-tests stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
.dockerignore BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
.env.example feat(chat): Sprint 4 -- Docker cleanup, frontend migration to Go WS 2026-02-22 20:46:58 +01:00
.env.storybook feat(player): integrate HLS streaming with ABR quality switching 2026-02-22 21:24:40 +01:00
.gitignore fix: UI remediation Phase 1 (S0-S5) + Phase 2 Sprint 6 shadow system 2026-02-12 10:13:44 +01:00
.prettierignore BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
.prettierrc.json BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
all_components.txt docs: update Welcome.mdx and deprecate Kodo references in docs 2026-02-17 17:05:33 +01:00
analyze_lint.py stabilisation commit A 2026-01-07 19:39:21 +01:00
covered_components.txt docs: update Welcome.mdx and deprecate Kodo references in docs 2026-02-17 17:05:33 +01:00
Dockerfile fix(MVP-006): Standardize environment variable names (VITE_API_BASE_URL → VITE_API_URL) 2025-12-22 22:56:37 +01:00
Dockerfile.dev BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
Dockerfile.production chore: consolidate CI, E2E, backend and frontend updates 2026-02-17 16:43:21 +01:00
e2e_test_output.json stabilisation commit A 2026-01-07 19:39:21 +01:00
env.remote-r720.example stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
eslint.config.js fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
full_test_result.txt batch 1 2025-12-22 22:00:50 +01:00
index.html fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
jest.config.js BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
lint_results.txt feat: Visual masterpiece - true light mode & premium UI 2026-01-11 02:32:21 +01:00
lint_results_2.txt feat: Visual masterpiece - true light mode & premium UI 2026-01-11 02:32:21 +01:00
lint_results_3.txt feat: Visual masterpiece - true light mode & premium UI 2026-01-11 02:32:21 +01:00
lint_results_final.txt feat: Visual masterpiece - true light mode & premium UI 2026-01-11 02:32:21 +01:00
lint_results_final_v2.txt feat: Visual masterpiece - true light mode & premium UI 2026-01-11 02:32:21 +01:00
nginx.conf feat: prepare production environment and fix frontend build 2025-12-31 16:27:36 +00:00
nginx.production.conf fix(v0.12.6): apply all pentest remediations — 36 findings across 36 files 2026-03-14 00:44:46 +01:00
openapitools.json api-contracts: install openapi-generator-cli and create type generation script 2026-01-11 16:30:43 +01:00
package.json chore: apply pre-commit hook formatting and cleanup 2026-04-01 01:40:54 +02:00
postcss.config.js BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
README.md feat(web): UI premium Discord/Spotify-like — tokens, shadows, focus, layout 2026-02-08 17:15:58 +01:00
RUNTIME_ISSUES.json [LOGGING] Fix #10: Erreurs silencieuses - Ajout de logs avec contexte pour toutes les erreurs dans core/auth et core/track 2026-01-04 01:44:15 +01:00
tailwind.config.ts refactor: Phase 8 — Update docs, ESLint, Storybook config for SUMI 2026-02-12 02:15:11 +01:00
tsconfig.app.json chore: enable noUncheckedIndexedAccess, isolate ghost MSW handlers, document go-clamd tech debt 2026-02-12 23:12:35 +01:00
tsconfig.json fix(web): enable noUncheckedIndexedAccess in tsconfig 2026-02-11 22:56:26 +01:00
tsconfig.node.json [FE-TYPE-014] fe-type: Add strict TypeScript mode 2025-12-25 15:04:01 +01:00
tsconfig.tsbuildinfo BASE: completing the initial repo state 2025-12-03 22:56:50 +01:00
vite.config.ts fix: stabilize frontend — 98 TS errors to 0, align API endpoints, optimize bundle 2026-03-24 21:18:49 +01:00
vitest.config.ts chore: apply pre-commit hook formatting and cleanup 2026-04-01 01:40:54 +02:00
vitest.shims.d.ts feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
vitest.storybook.config.ts chore: add vitest storybook config generated by pre-commit hook 2026-04-01 01:41:05 +02:00

Veza Frontend

React + TypeScript frontend application for the Veza audio collaboration platform.

Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Backend API running (see veza-backend-api/README.md)

Installation

npm install

Development

npm run dev

The application will be available at http://localhost:5173.

Building

npm run build

Setup Steps

1. Environment Variables

Copy .env.example to .env and configure:

# API Configuration
VITE_API_URL=http://localhost:8080/api/v1
VITE_WS_URL=ws://localhost:8081
VITE_STREAM_URL=http://localhost:8082

# Optional: Enable MSW mocks for development
VITE_USE_MSW=0

See .env.example for all available environment variables.

2. Type Generation

TypeScript types are generated from the OpenAPI specification. To regenerate types:

npm run generate:types

This script:

  • Reads veza-backend-api/openapi.yaml
  • Generates TypeScript types to src/types/generated/
  • Creates barrel exports for easy importing

Note: Types are automatically generated in CI/CD before type checking.

3. Validation

Validate types and schemas:

# Type checking
npm run validate:types

# Schema validation
npm run validate:schemas

# Both
npm run validate:all

Available Scripts

Development

  • npm run dev - Start development server
  • npm run dev:lab - Start with lab environment (real database)
  • npm run dev:mocks - Start with MSW mocks enabled

Building

  • npm run build - Build for production
  • npm run preview - Preview production build

Testing

  • npm test - Run unit tests (Vitest)
  • npm run test:ui - Run tests with UI
  • npm run test:e2e - Run E2E tests (Playwright)

Code Quality

  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues
  • npm run lint:ui - Run ESLint on src/components and src/features only
  • npm run report:arbitrary - Report Tailwind arbitrary values (w-[...], gap-[...], etc.) for migration
  • npm run typecheck - Type check without emitting files
  • npm run fmt - Format code with Prettier

Type Generation & Validation

  • npm run generate:types - Generate TypeScript types from OpenAPI spec
  • npm run validate:schemas - Validate Zod schemas
  • npm run validate:types - Type check
  • npm run validate:all - Run all validations

Project Structure

apps/web/
├── src/
│   ├── components/     # Reusable UI components
│   ├── features/       # Feature modules (auth, tracks, playlists, etc.)
│   ├── hooks/          # Custom React hooks
│   ├── services/       # API clients and services
│   ├── stores/         # Zustand state management (UI state stores)
│   │                   # Note: Feature stores (auth, chat) are in features/*/store/
│   ├── types/          # TypeScript types
│   │   └── generated/  # Auto-generated types from OpenAPI
│   ├── utils/          # Utility functions
│   └── styles/         # Global styles and design tokens
├── e2e/                # End-to-end tests (Playwright)
├── scripts/            # Build and utility scripts
└── public/             # Static assets

Design System

The application uses the Kodo design system. Single source of truth for layout, spacing, shadows, and transitions: docs/DESIGN_TOKENS.md. Shell layout: docs/APP_SHELL.md.

  • Colors: Kodo color palette (see src/styles/COLOR_USAGE.md)
  • Components: Design system components in src/components/ui/
  • Typography: Type scale and hierarchy (see docs/DESIGN_TOKENS.md, src/styles/TYPOGRAPHY_GUIDE.md)
  • Spacing: Spacing scale (see docs/SPACING_GUIDE.md) — no arbitrary values (e.g. w-[300px], gap-[7px]) without justification.

Visual regression: npm run visual:capture, npm run visual:compare, npm run visual:update (see visual-tests/README.md). Arbitrary values report: npm run report:arbitrary to list Tailwind arbitrary patterns for migration. New full-layout page: see docs/FULL_LAYOUT_PAGE.md.

ESLint Rules

The project enforces:

  • Typography: Use type scale classes (text-xs, text-sm, etc.) instead of arbitrary sizes
  • Spacing: Use spacing scale (gap-0 through gap-24) instead of arbitrary values
  • Colors: Use Kodo design system colors instead of Tailwind defaults
  • Components: Use design system Button component instead of native <button>

See eslint.config.js for full rule configuration.

Contributing

  1. Follow the existing code style
  2. Run npm run validate:all before committing
  3. Ensure all tests pass: npm test
  4. Type generation runs automatically in CI/CD

Documentation

  • Architecture Guide: docs/ARCHITECTURE.md (MUST READ)
  • Component Usage: src/components/COMPONENT_USAGE.md
  • Color Usage: src/styles/COLOR_USAGE.md
  • Typography: src/styles/TYPOGRAPHY_GUIDE.md
  • Spacing: src/styles/SPACING_GUIDE.md

Troubleshooting

Type Generation Fails

Ensure veza-backend-api/openapi.yaml exists and is valid:

cd ../../veza-backend-api
swag init  # Generate OpenAPI spec

Build Errors

  1. Clear node_modules and reinstall:

    rm -rf node_modules package-lock.json
    npm install
    
  2. Clear Vite cache:

    rm -rf node_modules/.vite
    

Type Errors

Run type generation and validation:

npm run generate:types
npm run validate:types