Commit e9e448be authored by Guillaume Cornut's avatar Guillaume Cornut
Browse files

chore: Update README.md for backend development.

parent b8cbd130
......@@ -8,10 +8,9 @@ Look at the [contribution guide](CONTRIBUTING.md).
## Install development environment
### Install node and npm
install nvm
- Install `node` and `npm`
go to :
Installation via `nvm` is recommended for easier control of installed version:
https://github.com/creationix/nvm
```sh
......@@ -19,33 +18,51 @@ nvm install 10.13.0
nvm use v10.13.0
```
### Install Angular CLI
- Install Angular CLI
```sh
npm install -g @angular/cli@7.0.6
```
### Install JS dependencies
- Install JS dependencies
```sh
cd frontend
npm install
```
### Install Java JDK8
- Install latest Java JDK8
See instructions for your operating system
See latest instructions for your operating system.
- (Optional) Install `docker` and `docker-compose`
If you want to run an Elasticsearch and Kibana instance on your machine.
You can use your favorite package manager for that
## Run backend development server
If you just need access to API (to run the Angular serve on top) without the frontend interface, you can run:
First make sure you have access to an Elasticsearch HTTP API server on `http://127.0.0.1:9200` (either via ssh tunneling or by running a local server).
If you want to run an Elasticsearch server on your development machine you can use the `docker`/`docker-compose` configuration like so:
```sh
docker-compose up
```
> This will launch an Elasticsearch server (with port forwarding `9200` and `9300`) and a Kibana server (with port forwarding `5601`)
> **Warning**: This repository does not automatically index data into Elasticsearch, you need to prepare your indices beforehand.
If you just need access to API (to run the `ng serve` on top of it), you can run:
```sh
./gradlew bootRun
```
Otherwise, for the complete server (backend API + frontend interface), you can run:
Otherwise, for the complete server (backend APIs + frontend interface), you can run:
```sh
./gradlew assemble && java -jar backend/build/libs/gpds.jar
......@@ -78,3 +95,33 @@ If you want to run the GitLab CI locally, you have to follow this steps:
```sh
gitlab-runner exec docker test
```
## Spring Cloud config
On bootstrap, the application will try to connect to a remote Spring Cloud config server
to fetch its configuration.
The details of this remote server are filled in the `bootstrap.yml` file.
By default, it tries to connect to the remote server on http://localhost:8888
but it can of course be changed, or even configured via the `SPRING_CONFIG_URI` environment variable.
It will try to fetch the configuration for the application name `rare`, and the default profile.
If such a configuration is not found, it will then fallback to the local `application.yml` properties.
To avoid running the Spring Cloud config server every time when developing the application,
all the properties are still available in `application.yml` even if they are configured on the remote Spring Cloud server as well.
> **TODO**: Create a sping cloud configuration git repository and update the following section:
> If you want to use the Spring Cloud config app locally,
see https://forgemia.inra.fr/urgi-is/data-discovery-config
> The configuration is currently only read on startup,
meaning the application has to be reboot if the configuration is changed on the Spring Cloud server.
For a dynamic reload without restarting the application,
see http://cloud.spring.io/spring-cloud-static/Finchley.SR1/single/spring-cloud.html#refresh-scope
to check what has to be changed.
> In case of testing configuration from the config server, one may use a dedicated branch on `data-discovery-config` project
and append the `--spring.cloud.config.label=<branch name to test>` parameter when starting the application's executable jar.
More info on how pass a parameter to a Spring Boot app:
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment