- Modern JavaScript stack for services: React
- Extensive CI checks (security, style, static analysis, Snyk, DeepScan) to maintain code quality
- Configured testing tools: Playwright, Jest
- This template is based on bulletproof-react
- Much more!
Many front-end developers need to create new projects from scratch and spend a lot of time.
We decided to simplify this exhausting process and create a public template for modern front-end applications. This template is used for all our microservices in VilnaCRM.
This software is distributed under the Creative Commons Zero v1.0 Universal license. Please read LICENSE for information on the software availability and distribution.
Clone locally or use GitHub’s Use this template feature.
Before running the application, make sure the following tools are installed on your machine:
-
Node.js (version 20 or higher). You can download and install Node.js from the official website, or use a version manager like nvm Node Version Manager to easily manage versions.
-
Docker required for containerization and managing isolated environments. Install Docker according to the instructions for your operating system. Follow the guide to ensure Docker is properly configured and running on your machine.
-
Docker Compose is needed to manage multi-container Docker applications. Docker Compose is essential for starting up the development environment and running the services defined in docker-compose.yml.
-
GNU Make 4.0+ is required for the repository Make targets. Linux environments usually already provide a compatible version. On macOS, install a newer Make with Homebrew:
brew install make
If Homebrew installs GNU Make as
gmake, usegmakeanywhere this documentation saysmake. -
Bun used as the package manager (Node.js remains the runtime). Bun uses the
bun.lockfile to keep dependency resolutions consistent while delivering fast installs.
After installing all prerequisites, you can start the application inside a Docker container:
make startWhat Happens When You Run make start:
The command will:
- Build and start the shared local development stack inside Docker containers named
devandmockoon. - Use the dependencies already baked into the dev image (mounted via a named
node_modulesvolume) instead of reinstalling on every start. - Wait for both readiness checks before returning: the frontend dev server and the Mockoon API mock.
- Expose the frontend at port
3000and the mock API at port8080.
First-time setup: run
make create-networkto create the externalcrm-networkbefore usingdocker composedirectly.make startruns this automatically.
After startup completes:
- Frontend: http://localhost:3000
- Mockoon API mock: http://localhost:8080
If you previously used make start expecting only the frontend dev container, update that mental
model now: make start is the full local development entrypoint and starts both the frontend and
Mockoon together.
If you have local shell aliases, editor tasks, or scripts that used to compose older CI commands
manually, replace them with make ci. That target is now the supported contract for pre-push and
GitHub Actions validation.
To view all available commands, run make help:
make helpThe following commands are available when the project is installed locally.
General
make start: starts the application
make create-network: creates the external crm-network (idempotent helper)
make build: builds the application
make format: formats the codebase to ensure consistent style across all files
make update: updates node modules according to the current package.json file
make install: installs node modules according to the current bun.lock file using Bun
make check-node-version: checks if the correct Node.js version is installedLinting & Formatting
make lint-eslint: lints the codebase using eslint rules
make lint-tsc: runs static type checking with TypeScript
make lint-md: lints all markdown files (excluding CHANGELOG.md) using markdownlint
make lint-dup: detects copy/paste duplication with jscpd (thresholds in .jscpd.json)We use dependency-cruiser to enforce module boundaries and prevent circular dependencies.
- Run locally:
make lint-deps - Config:
.dependency-cruiser.js - Key rules: modules cannot import from other modules directly; shared UI components must not depend on feature modules
Testing
make ci: runs the full local CI flow (setup, lint, tests, and prod-side checks)
make test-bats: runs shell-level regression coverage for Makefile targets and CI helper scripts
make test-unit-all: runs unit tests for both client and server environments
make test-unit-client: runs unit tests for the client using Jest
make test-unit-server: runs unit tests for the server using Jest
make test-memory-leak: runs memory leak tests using Memlab
make test-load: executes load tests using the K6 libraryUse make ci as the canonical pre-push validation command:
make ciRunning make ci locally exercises the same checks CI runs across its workflows, so passing it
before pushing means your changes should pass CI.
Use the Bats suite when you need fast regression coverage for Makefile shell flows and the
scripts/ci wrappers without running the full prod-side stack:
make test-batsWhen you add or change a public Make target, update tests/bats/make-target-coverage.tsv in the
same change. Either add or adjust direct Bats coverage for the target, or point the manifest at
the pull-request workflow that already executes the target end to end.
Migration guidance for existing contributors:
- replace older local CI command chains or custom wrappers with
make ci - expect
make cito cover both dev-side and prod-side checks instead of only lint or unit phases - keep any local automation pointed at
make ci
At a user-facing level, make ci runs these phases in order:
- environment setup for the shared dev stack
- lint checks
- dev-side automated tests
- production-like setup for Chromium and the prod stack
- production-side automated tests, including end-to-end, visual, load, memory-leak, and Lighthouse checks
Runs tests inside the Playwright container, targeting the production container:
make test-e2e: full end-to-end tests
make test-e2e-ui: runs UI-specific end-to-end tests
make test-visual: runs general visual regression tests
make test-visual-ui: runs UI-focused visual regression testsFor Swagger E2E tests, the application uses Mockoon to handle API requests. Mockoon serves as a mock API server for both local development and E2E-style workflows. It uses the OpenAPI specification from the user-service repository and runs on port 8080 within the Docker test network. The mock server provides consistent API responses during automated testing without requiring a real backend connection.
For local development, make start brings up Mockoon alongside the frontend stack. Test-oriented
targets such as make test-e2e and make start-prod also bring up the mock server through their
own shared startup paths. For container-level configuration details, see docker-compose.yml and
docker-compose.test.yml.
Lighthouse
make lighthouse-desktop: runs Lighthouse audits in desktop mode
make lighthouse-mobile: runs Lighthouse audits in mobile modeGit
make husky: sets up Husky (Git hooks manager) — run once after cloning the repoStorybook
make storybook-start: starts Storybook UI targeting the dev container
make storybook-build: builds Storybook targeting the dev containerDocker
make down: stops the Docker containers and removes orphaned containers
make stop: stops dev container
make start-prod: builds image and starts the prod container (production mode)
make ps: displays currently running Docker containers with their details
make sh: starts a terminal inside the dev Docker container for manual commands
make logs: shows all logs of dev container
make logs-prod: shows all logs of prd container
make new-logs: shows live logs of the dev container
make wait-for-dev: waits for the dev service to be ready on port 3000
make wait-for-prod: waits for the prod service to be ready on port 3001This project includes a dedicated load testing service using K6, configured via a Docker Compose profile.
Docker Compose profiles let you selectively start groups of services. The load testing service is tagged
with the load profile in docker-compose.test.yml, so it only runs when you explicitly include
that profile.
Using the make command (recommended):
make load-testsThe load testing service waits for the production service to become healthy before starting. Test results will be streamed to the K6 web dashboard and saved under ./test/load/results/.
Available Load Test Scenarios:
- smoke: a quick health check with a small number of virtual users.
- average: simulates a typical daily traffic load.
- stress: pushes the system to its limits to identify breaking points.
- spike: sudden ramp-up of virtual users to test burst handling.
Adjust scenarios and thresholds in ./test/load/config.json.dist as needed.
Start reading at the GitHub wiki. If you're having trouble, head for the troubleshooting guide as it's frequently updated.
You can generate complete API-level documentation by running doc in the top-level
folder, and documentation will appear in the docs folder, though you'll need to have
API-Extractor installed.
If the documentation doesn't cover what you need, search the many questions on Stack Overflow, and before you ask a question, read the troubleshooting guide.
If this isn't passing, is there something you can do to help?
Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately.
See SECURITY and Security advisories on GitHub. Security advisories on GitHub.
Please submit bug reports, suggestions, and pull requests to the GitHub issue tracker. GitHub issue tracker.
We're particularly interested in fixing edge cases, expanding test coverage, and updating translations.
If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it.
Development time and resources for this repository are provided by VilnaCRM, the free and opensource CRM system.
Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to maintainers and contributors – just click the "Sponsor" button on the project page. on the project page. If your company uses this template, consider taking part in the VilnaCRM's enterprise support program.
See changelog.