For development purposes, frontend GUI and backend APIs have been separated and runs onto 2 different runtime servers.
- Frontend is an Angular 8 application served by
ng serve
with livereload enabled, - Backend is a Spring Boot application served by Boot internal server
To run the dependencies we rely on (MongoDB and Keycloak)
we recommend using Docker. We provide some useful scripts in the /dev
folder of the
repository root that pull the correct versions and auto-configure them.
- NodeJS (version >= 16.0) and associated tools : NPM and ng-cli (
npm i -g @angular/cli
) - Java Development Kit (version >= 17) and Apache Maven (version >= 3.5)
If you chose to run MongoDB and Keycloak via containers, you'll need to open a first terminal and run:
$ cd dev
$ ./start-mongodb-docker.sh
# or ./start-mongodb-podman.sh if you prefer Podman
MongoDB is started on port 27017
.
Keycloak is optional depending on your will to try out authentication and authorization features. If you need Keycloak, open a second terminal and run:
$ cd dev
$ ./start-keycloak.sh
# or ./start-keycloak-podman.sh if you prefer Podman
Keycloak is started on port 8180
.
In a terminal, start frontend GUI server using NG :
$ cd src/main/webapp
$ npm install --force
$ ng serve
Server is started on port 4200
. Open a new browser tab pointing to http://localhost:4200
where application is hosted.
with Keycloak:
$ mvn spring-boot:run
with Keycloak disabled:
$ KEYCLOAK_ENABLED=false mvn spring-boot:run
Server is started on port 8080
and will be used as API endpoints root by frontend GUI (URLs starting by http://localhost:4200/api
will be in fact proxied to port 8080
).
We use Spotless to format our Java code. Spotless is configured using an Eclipse
code style file, which is located at eclipse-formatter.xml
in the root folder of this repository. Spotless check is automatically
triggered during the build process, but you can also run it manually using the following command:
$ mvn spotless:apply