NodeJS in the Frontend¶
Node.js is used as the runtime for development tooling, package management and local builds for the frontend application. The project uses Node to run Vite, linters, test runners and TypeScript compilation.
Key uses¶
- Development server:
viteis run from thedevscript inapp/frontend/package.jsonand requires Node.js to execute. - Build: production bundling and TypeScript build (
tsc -b && vite build) are executed via Node. - Tests and tooling:
vitestfor unit tests,eslintfor linting and supporting dev dependencies are installed through npm/yarn.
Useful scripts (from app/frontend/package.json)¶
dev— start Vite dev server (fast HMR).build— run TypeScript build and then produce production assets with Vite.test/test:browser— run unit tests (and browser tests when configured).lint— run ESLint across the frontend source.
Local environment¶
- Node version: the project doesn’t pin a Node version in the repo; use a modern LTS (>= 18) matching the versions of the libraries in
package.json. - Install dependencies from within
app/frontendwith your package manager of choice (npm/yarn/pnpm).
Where to look in the repo
app/frontend/package.json— scripts and dependencies.app/frontend/vite.config.tsandapp/frontend/tsconfig*.json— build configuration.
Notes
- Environment variables for runtime are provided by Vite rather than Node-specific .env handling. See
app/frontend/src/config.tsxfor howVITE_API_URLis consumed in the app.