The frontend requires a running instance of the kilometracker-backend API. Configure its URL via the
API_BASE_URL environment variable before starting the dev server. See Environment variables for details.Prerequisites
Before you begin, make sure you have the following installed:- Node.js >= 18 — nodejs.org
- npm (bundled with Node.js) or pnpm
- A running KilomeTracker backend — local or hosted (e.g., Railway, Render)
Setup steps
Create the environment file
Create a See Environment variables for a full reference of all variables and how to configure them for production.
.env.local file in the project root with the backend URL:Start the development server
/dashboard. Unauthenticated requests to protected routes are redirected to / (login).Available scripts
| Command | Description |
|---|---|
npm run dev | Start the Next.js development server on http://localhost:3000 |
npm run build | Compile a production build |
npm start | Start the production server (requires a prior build) |
npm run lint | Run ESLint across the codebase |
npm test | Run Vitest unit tests (single run) |
npm run test:watch | Run Vitest in watch mode |
npm run test:coverage | Run Vitest with a V8 coverage report |
npm run test:e2e | Run Playwright end-to-end tests |
TypeScript path aliases
The project uses a@/* path alias that maps to ./src/*. Always use this alias for imports — never use relative paths.
tsconfig.json and works across all files in src/.