- Getting Started: Backend & Frontend
- Getting Started: Data Pipeline
- Technical Stack
- Legacy Instructions
- Debian-based Linux or macOS
- Docker v25 (with Docker Compose v2)
- Java Development Kit (JDK) 19
- Node.js v20 (with npm v10)
git clone https://github.com/MTES-MCT/monitorenv.git
cd monitorenv
make dev-install
make dev-init-infra-env
In a first CLI tab, for the Backend (in project root):
make dev-run-back-with-infra
In a second CLI tab, for the Frontend:
make dev-run-front
- Debian-based Linux or macOS
- Docker v25 (with Docker Compose v2)
- Python v3.10 (with Poetry)
if you have a mac with apple chipset please check the checkbox in docker dashboard
Allow the default Docker socket to be used (requires password)
in settings/advanced
- install Peotry (follow online documentation, it changes really often)
- run
cd datascience
andpoetry install
For example :
pytest --pdb tests/ -k test_load_competence_cross_areas -s
- Databases
- PostgreSQL
- GeoServer
- Backend
- Language: Kotlin
- Framework: Spring
- ORM: Hibernate
- Testing: JUnit, Mockito
- Documentation: Swagger
- Frontend
- Language: TypeScript
- Framework: React (with Vite)
- UI: Rsuite (mostly customized via monitor-ui)
- Testing: Jest, Cypress, Puppeteer
- Data Pipeline
- Language: Python (with Poetry)
- Workflow: Prefect
- Testing: Pytest
Important
These instructions must be cleaned, updated and clarified. They are kept here in the meantime.
- Infrastructure:
- Docker
- Backend:
- Kotlin
- Spring
- PostgreSQL
- Geoserver
- Frontend:
- React (Vite)
- OpenLayers
- Rsuite
- Data pipeline:
- Python 3.10
- Poetry
- Prefect
- npm
- openjdk (osx:
brew install openjdk
) - postgres (only
psql
is required. osx:brew install libpq
) - docker + docker-compose
- python 3.10 + poetry
Optionally create and modify ./.env.local
SENTRY_DSN is an environment variable used by Sentry to identify the application. It is used by both the frontend and
backend. It is defined in the .env
file and injected into the frontend application via the ./public/env.js
file.
If SENTRY_DSN
is set, the backend logs will automatically be sent.
make dev-install
: install frontend dependencies
make dev-run-front
: starts the frontend development server
The browser will automatically open at the URL http://localhost:3000
Before pushing a commit, check the linting with npm run test:lint
Variable injection is done with import-meta-env
.
Environment variables are injected in the frontend on runtime.
.env.frontend.example
filters the environment variables that are injected in the frontend.
The same system is used to generate a .env
file for the backend in development mode.
Command make dev-init-infra-env
generates a .env
file which is exported for each make command.
Start the backend:
make dev-run-back-with-infra
:
- optionally removes previous docker instances
- creates a docker instance of the database + geoserver
- launches the development backend server
The backend is then accessible at http://localhost:8880 by default. A Swagger interface is available at the URL: http://localhost:8880/swagger-ui.html
It may be necessary to load context data for frontend development and configure Geoserver to distribute this data.
To restart the backend without recreating the database and geoserver containers, run the command make dev-run-back