README.md 3.77 KB
Newer Older
1
2
# FAIDARE: FAIR Data-finder for Agronomic Research
This application provides web services (based on the BrAPI standard) and a web interface with easy to use filters to facilitates the access to plant datasets from a federation of sources.
Raphaël Flores's avatar
Raphaël Flores committed
3
4
5

## How to contribute

6
7
8
9
Look at the [contribution guide](CONTRIBUTING.md).

## Install development environment

10
- Install `node` and `npm`
11

12
Installation via `nvm` is recommended for easier control of installed version:
13
14
15
16
17
18
19
https://github.com/creationix/nvm

```sh
nvm install 10.13.0
nvm use v10.13.0
```

20
- Install Angular CLI
21

22
23
```sh
npm install -g @angular/cli@7.0.6
24
```
25

26
- Install JS dependencies
27

28
29
```sh
cd frontend
30
31
32
npm install
```

33
- Install latest Java JDK8
34

35
36
37
38
39
40
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
41
42
43
44


## Run backend development server

45
46
47
48
49
50
51
52
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
```

53
> This will launch an Elasticsearch server (with port forwarding `9200`) and a Kibana server (with port forwarding `5601`)
54
55
56
57
58

> **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:
59
60
61
62
63

```sh
./gradlew bootRun
```

64
Otherwise, for the complete server (backend APIs + frontend interface), you can run:
65
66

```sh
67
./gradlew assemble && java -jar backend/build/libs/faidare.jar
68
69
```

70
The server should then be accessible at http://localhost:8380/faidare-dev
71

72
73
## Run frontend development server

74
The frontend requests are redirected to the local backend API server (see instructions above to launch) via the
75
Angular proxy.
76
77
78
79
80
81

You can run the development server with the following command:

```sh
cd frontend
ng serve
82
83
84
85
```

## GitLab CI

86
87
88
89
90
When creating merge requests on the ForgeMIA GitLab, the GitLab CI will 
automatically run the tests of the project (no need to do anything).

If you want to run the GitLab CI locally, you have to follow this steps:

91
92
1. [Install gitlab-runner](https://docs.gitlab.com/runner/install/)
2. Run the following command (with the correct GnpIS security token):
93

94
95
96
```sh
gitlab-runner exec docker test 
```
97
98
99
100
101
102
103
104
105
106


## 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.

107
It will try to fetch the configuration for the application name `faidare`, and the default profile.
108
109
110
111
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.

112
The configuration is currently only read on startup,
113
meaning the application has to be rebooted if the configuration is changed on the Spring Cloud server.
114
115
116
117
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.

118
119
If you want to use a Spring Cloud configuration server, please refer to
https://spring.io/guides/gs/centralized-configuration/
120