-
Notifications
You must be signed in to change notification settings - Fork 1
Setting up a local environment
This section contains details of setting up a working development environment.
- JDK 13+
-
Maven (or you can use
mvnw
provided in the project) - Docker
- Docker Compose
You'll find all default versions and credentials for dependencies in the backend/docker/.env file.
Below you'll find all dependencies that have to be run before starting the application.
To start the default database:
cd docker
docker-compose -f docker-compose-database.yml up -d
The database will be available for the backend module under the jdbc:postgresql://localhost:5432/efficientmvpexample
url.
Below you'll find all dependencies that can be run to facilitate working on the application.
If you want to test the monitoring services remember to run the application in docker as well:
cd docker
docker-compose -f docker-compose-database.yml -f docker-compose-app.yml -f docker-compose-monitoring.yml up -d
To start an automatically configured SonarQube instance:
cd docker
docker-compose -f docker-compose-sonar.yml up -d
This command starts two services: sonarqube
and sonarqube_config
. It's important to start them both together the first time. sonarqube_config
uses the default SonarQube credentials to import custom profiles for code analysis. Since SonarQube requires password change on the first time a user logs in there is no point in running sonarqube_config
again on the same environment. Running it again when profiles has been already imported is redundant even if you adjust the credentials.
To stop all dependencies:
cd docker
docker-compose -f docker-compose-database.yml -f docker-compose-app.yml -f docker-compose-monitoring.yml down
You can add --volumes
option if you want to remove all named volumes.
What docker services are run for each dependency category mentioned above:
Database | SonarQube | Monitoring |
---|---|---|
postgres | sonarqube | prometheus |
sonarqube_config | promtail | |
loki | ||
grafana |
Result of the docker ps
command when all dependencies and the app are running as docker services:
Make sure to run the Spring Boot application with the dev
and init
profiles during development. Otherwise, some configuration may be incorrect (invalid database connection, not being able to populate the database with data, etc.). The monitoring services will work correctly if the application is ran in a docker container configured in the docker-compose-app.yml file.
- Node.js version that you specify in the
frontend-maven-plugin
configuration - Angular requires an active or maintenance LTS version of Node.js. For the reference, you can check out this unofficial compatibility matrix.
You can use Node Verion Manager to see which version is available on your environment:
nvm ls
Eficient MVP example
Documentation