veza/apps/web
senke b8eed72f96 feat(webrtc): coturn ICE config endpoint + frontend wiring + ops template (v1.0.9 item 1.2)
Closes FUNCTIONAL_AUDIT.md §4 #1: WebRTC 1:1 calls had working
signaling but no NAT traversal, so calls between two peers behind
symmetric NAT (corporate firewalls, mobile carrier CGNAT, Incus
container default networking) failed silently after the SDP exchange.

Backend:
  - GET /api/v1/config/webrtc (public) returns {iceServers: [...]}
    built from WEBRTC_STUN_URLS / WEBRTC_TURN_URLS / *_USERNAME /
    *_CREDENTIAL env vars. Half-config (URLs without creds, or vice
    versa) deliberately omits the TURN block — a half-configured TURN
    surfaces auth errors at call time instead of falling back cleanly
    to STUN-only.
  - 4 handler tests cover the matrix.

Frontend:
  - services/api/webrtcConfig.ts caches the config for the page
    lifetime and falls back to the historical hardcoded Google STUN
    if the fetch fails.
  - useWebRTC fetches at mount, hands iceServers synchronously to
    every RTCPeerConnection, exposes a {hasTurn, loaded} hint.
  - CallButton tooltip warns up-front when TURN isn't configured
    instead of letting calls time out silently.

Ops:
  - infra/coturn/turnserver.conf — annotated template with the SSRF-
    safe denied-peer-ip ranges, prometheus exporter, TLS for TURNS,
    static lt-cred-mech (REST-secret rotation deferred to v1.1).
  - infra/coturn/README.md — Incus deploy walkthrough, smoke test
    via turnutils_uclient, capacity rules of thumb.
  - docs/ENV_VARIABLES.md gains a 13bis. WebRTC ICE servers section.

Coturn deployment itself is a separate ops action — this commit lands
the plumbing so the deploy can light up the path with zero code
changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 23:38:42 +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 chore(web): install orval + mutator for OpenAPI code generation (v1.0.8 P1) 2026-04-24 00:18:14 +02:00
scripts chore(web): drop legacy openapi-generator-cli — orval is the single source (v1.0.8 B9) 2026-04-26 00:02:58 +02:00
src feat(webrtc): coturn ICE config endpoint + frontend wiring + ops template (v1.0.9 item 1.2) 2026-04-26 23:38:42 +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
.size-limit.json chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp 2026-04-20 20:33:40 +02: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 chore(web): install orval + mutator for OpenAPI code generation (v1.0.8 P1) 2026-04-24 00:18:14 +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
lostpixel.config.ts chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp 2026-04-20 20:33:40 +02: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
orval.config.ts chore(web): install orval + mutator for OpenAPI code generation (v1.0.8 P1) 2026-04-24 00:18:14 +02:00
package.json chore(deps): install fast-check for property-based tests 2026-04-26 01:31:37 +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
stryker.config.mjs chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp 2026-04-20 20:33:40 +02: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