# Design ## Stack - **Language:** TypeScript everywhere, `strict`. - **Server:** one Cloudflare Worker. It has a small hand-written router (method + path pattern with `:params`) and no framework. - **Storage:** - Cloudflare D1 (`DB`) for accounts, sessions, videos, comments, reactions and views - Cloudflare R2 (`MEDIA`) for video files and thumbnails - Workers Rate Limiting for the three limits - **Client:** React 18 with `react-router-dom` 6, built with Vite into `dist/`. Plain CSS in one `style.css`, with CSS variables for both themes. - **Recording:** browser `getDisplayMedia`, `getUserMedia`, `` and `captureStream`, `AudioContext`, `MediaRecorder`, plus `fix-webm-duration` (MIT) to write the duration into WebM headers. - **Cutting:** `mediabunny` 1.66 (MPL-2.0; WebCodecs demux, decode, encode and MP4 mux), imported dynamically so it is a separate chunk loaded only when a cut is made; the real-time fallback uses `