Files
dyolink/frontend
Amin Mousavi 6a4c0cb1bb fix(frontend): stop the level meter re-rendering the whole workspace
The meter wrote React state from a requestAnimationFrame loop, and the hook
lives in TreatmentWorkspace — so every frame re-rendered the details editor,
the FDI chart, the lab panel and the history rail. About 7,200 whole-tree
renders across a two-minute recording, while the user is dictating.

Now samples every frame but publishes at LEVEL_POLL_MS, the rate the
elapsed timer already used. Peaks between publishes are carried forward, so
the meter stays responsive to transients rather than sampling at 10 Hz.

Also adds the catch the start path never had: new MediaRecorder() and
recorder.start() both throw on some browsers, and by then the stream is
live. The rejection went unhandled, the UI sat at 'idle' showing nothing,
and the browser's recording indicator stayed lit until unmount.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 23:05:30 +03:30
..

Dyolink — Frontend (Next.js)

Prerequisites

  • Node.js 20+ and npm

First-time setup

  1. Clone the monorepo and go to the frontend app:

    git clone <repository-url> dyolink
    cd dyolink/frontend
    
  2. Install dependencies

    npm install
    
  3. Environment

    Create .env.local in this folder (not committed to git) with the public URLs your browser will use:

    NEXT_PUBLIC_APP_URL=http://localhost:3001
    NEXT_PUBLIC_API_URL=http://localhost:3000/api
    NEXT_PUBLIC_APP_NAME=Dyolink
    
    • Adjust NEXT_PUBLIC_API_URL if the Nest API runs on another host/port.
    • These values are baked in at build time for production images; for local dev, restart npm run dev after changing them.

Run (development)

npm run dev

Open http://localhost:3001 (dev server uses port 3001 so it does not clash with the API on 3000).

Ensure the backend is running and NEXT_PUBLIC_API_URL matches its base URL (including /api if your API is mounted there).

After pulling latest main

git pull
npm install

Useful commands

Command Purpose
npm run dev Development server (port 3001)
npm run build Production build
npm run start Serve production build (port 3000 — used inside Docker)
npm run lint ESLint

Docker

Image build and build-args (NEXT_PUBLIC_*) are documented in the repository root README.md.