The software system is consists of different deployables. Currently, there are 3 deployables, but the system can easily be extended:
In general to have the software system up and running properly, one should add a reverse proxy (nginx, apache, ...) in front of the three deployables:
+------------------+
| |
| client browser |
| |
+--------+---------+
|
| https://[domain]/[path]
|
+-------------------------------------------------|--------------------------------------------------+
| | |
| +----------v-----------+ |
| | | |
| | reverse proxy | |
| | | |
| +--------+ (nginx/apache/...) +--------+ |
| | | | | |
| | +----------+-----------+ | |
| [path:/occurrences]| | |[path:/api/] |
| | |[path:/admin] | |
| | | | |
| | | | |
| | | |http://localhost:8080/api/ |
| +--------------------------v-+ +-------------v--------------+ +-v--------------------------+ |
| | | | | | | |
| | occurrences web client | | admin web client | | smalldata server | |
| | | | | | | |
| +----------------------------+ +----------------------------+ +----------------------------+ |
| |
+----------------------------------------------------------------------------------------------------+
The reverse proxy needs at least these paths:
/occurrences
→ location of the occurrences web client (e.g.
/var/www/html/occurrences
on debian based systems)/admin
→ location of the admin web client (e.g.
/var/www/html/admin
on debian based systems)/api/
→ proxy pass to where the server runs (e.g.
http://localhost:8080/
with the default config)An example config for nginx:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
proxy_set_header Host $host;
proxy_redirect off;
proxy_pass http://localhost:8080/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /api/ {
rewrite ^ $request_uri;
rewrite ^/api/(.*) $1 break;
return 400;
proxy_pass http://localhost:8080/api/$uri;
}
location /occurrences {
try_files $uri $uri/ =404;
}
location /admin {
try_files $uri $uri/ =404;
}
}
The images of the server are available on http://smalldata.obis.org/images/
./bin/smalldata.server -conf config/config.json
from the root
of the application.
./bin/smalldata.server.bat -conf config/config.json
prerequisites
Java 11 or higher must be installed
how to start
server
-directoryconfig/config.json
is right./gradlew run
prerequisites
node
must be installed latest lts version (10.16.3 or higher)yarn
must be installed lastest versionhow to start
yarn install
yarn start
node
must be installed latest lts version (10.16.3 or higher)yarn
must be installed lastest versionThe occurences and admin web client can be build by running a yarn job on the source repository:
yarn occurrences-app:build
yarn admin-app:build
The homepage
key in package.json
is necessary so the app knows on
which path on the server it resides. This configuration must be set
before making a build. For more information about the homepage
key:
The proxy
key is not used for final builds. It is used for development
(running yarn run
).
After a web client has been built, installing is just making a copy in the right directory, e.g.:
cp -r ./occurrences-app/build/* /var/www/html/occurrences
cp -r ./admin-app/build/* /var/www/html/admin
The location should match the one that\'s configured in your reverse proxy (e.g. nginx, Apache, ...).
If backend server is located on a different server, or you want to
configure a different path than /api
for api calls then you need to
update apiRoot
in the index.html
of the corresponding web
application. This can and should(!) be set on the build output:
<script type="text/javascript">
window.smalldata = {
apiRoot: '/api/'
}
</script>