- React Router (framework) with Vite builder - React framework and build tool
- TypeScript - strongly typed programming language built on JavaScript
- Testing Library and Vitest - testing utilities and framework
- ESLint - TypeScript, JavaScript, TSX, JSON and Markdown linter
- ESLint Stylistic and Perfectionist - ESLint plugins for code style and formatting
- Stylelint - CSS style linter
- Husky + lint-staged - git hooks to ensure code quality and standards
This project is part of the City of Amsterdam and aims to comply with the Development Standards.
The user interface is build with the Amsterdam Design System.
Git commits should follow the Conventional Commits specification.
- Node.js - the latest long-term support (LTS) version (see
enginesinpackage.jsonfor current version) - PNPM - performant Node.js package manager (see
enginesandpackageManagerinpackage.jsonfor current version) - Corepack - manage bridge between Node.js and PNPM
- Make - build automation tool
- Docker - container platform for development and deployment (optional for development)
Tip: PNPM can be used as Node.js version manager with
pnpm env. See PNPM Node.js version management. We recommend to remove any Node.js installations on your system and then install PNPM with a standalone script. Then install the current Node.js LTS version and Corepack withpnpm env use -g lts && pnpm add -g corepack. Use Corepack to keep PNPM up-to-date in the project:corepack use pnpm@latest.
Many instructions in this README use Make to simplify commands. Check the Makefile for the actual commands.
This app can be developed, build and run for production locally or in Docker containers. Check the Makefile, the Dockerfile and the docker-compose.yaml to learn more.
You can develop locally (A) or in a Docker container (B).
Install the dependencies and run the app in a dev server with live reloading:
make dev-localYour application will be available at http://localhost:5173.
Start the development server with live reloading in a Docker container:
make devThe application will be available at http://localhost:5173.
The project uses Testing Library and Vitest for unit, integration and snapshot testing.
To do: add test plan.
Run all tests once:
make testContinuously run the test suite and watch for file changes:
make test-watchCheck test coverage:
make test-coverageThen open test/coverage/index.html to view the coverage report in a browser.
This project uses ESLint to lint and type-check code with the TypeScript ESLint, React, JSON and Markdown plugins. For code style and formatting the Stylistic and Perfectionist plugins are used.
For CSS linting we use Stylelint.
Run the linters and formatters once:
make lintFix all auto-fixable issues:
make lint-fixLocally install the dependencies and build for production:
make build-localYou can deploy yourself (A) or push a Docker container (B).
If you're familiar with deploying Node applications, the built-in app server is production-ready.
Make sure to deploy the output of make build-local
├── package.json
├── pnpm-lock.yaml
├── build/
│ ├── client/ # Static assets
│ └── server/ # Server-side codeTo locally start the production server:
make app-local # This also builds the application.Build and start the production server in a Docker container:
make appThe application will be available at http://localhost:3000.
To clean everything up run:
make clean
# or to only bring down Docker containers do:
make clean-docker
# or to only clean local files do:
make clean-localNote:
node_modulesand.react-routermay have been created due to volume mapping with a Docker container. It might not be possible to remove them without root privileges. If this happens dosudo rm -Rf .react-router node_modulesmanually.
Built with ❤️ by developers of the City of Amsterdam using React Router.