Files
dyolink/frontend
Amin Mousavi dc10d8dbe3 docs: cut the comments that were not earning their place
I wrote 731 comment lines on this branch against 4,530 lines of code — 14%,
where the rest of the repo runs at 1.8%. CLAUDE.md asks for code that reads
like its surroundings, and this did not.

Removed by genre rather than by taste:

- restating the code, e.g. "JS getUTCDay() numbering: Sunday = 0" above the
  map that literally shows it, and a docblock on startOfWeek explaining that
  it returns the start of the week;
- narrating history — "this used to rebuild the whole map", "left the bar
  recording forever" — which the commit message and git blame already carry;
- saying the same thing in several places: the "cannot record is not a
  denied microphone" reason appeared three times in one file, and the
  "aborting stops a per-minute metered call" reason across three files. Each
  now lives once, where the behaviour it explains lives;
- defending decisions nobody would question, like why toLatinDigits is its
  own module;
- over-explaining defensive branches, three separate comments to distinguish
  null from missing-kind from unrecognised-kind.

What stays is what the code cannot say: the patient-right convention in
toFdi, whose failure mode is a valid code for the wrong tooth; the
"this"-vs-"next" week anchoring; StrictMode re-arming mountedRef; Safari
accepting no mimeType hint; and the invariants whose violation already cost
a bug — the body parser's middleware ordering and the dispatch panel's
auto-fill rules.

Comments only. The diff contains no non-comment line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 23:14:15 +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.