For more information check our official website
Here we describe how to build this project on Microsoft Windows using Visual Studio Code. Similar requirements have to be meet to build this project in Linux or when using any other IDE.
- Start a shell (cmd.exe)
- Navigate to your PostgreSQL installation path
$postgres
(i.e.C:\[USERPATH]\bin\pgsql
) - Go into the
\bin
subdirectory (cd bin
) - Create a data directory (
mkdir data
) - Start PostgreSQL
pg_ctl.exe start -D "C:\[USERPATH]\bin\pgsql\data"
- Create the datalinker database
createdb.exe datalinker
- Create the user datalinker
- Use
misc/generate_database.sql
to generate all tables and views in the datalinker database (psql -U postgres -d datalinker -a -f misc/generate_database.sql
)
- Start Visual Studio Code
- Install two Extensions (fifth icon on the left bar):
2.1 Gradle Tasks (richardwillis.vscode-gradle)
2.1 npm (eg2.vscode-npm-script) - Update
server\application.properties
3.1. Fill inspring.datasource.username
andspring.datasource.password
using the PostgreSQL data
3.2. Updaterdmo.token
andrdmo.url
to point to a previous setup RDMO server - In Source Control (third icon on the left bar)
4.1. Clone repository: https://github.com/mamodar/datalinker
4.2. Select a local folder to clone code to (no server!)
4.3. Open folder in Visual Studio Code - Go to Terminal, Run task:
npm: build -web
- Start database (if not started already)
1.1. Start a shell (cmd.exe)
1.2. Navigate to your PostgreSQL installation path (i.e.C:\[USERPATH]\bin\pgsql
)
1.3. Start PostgreSQLpg_ctl.exe start -D "C:\[USERPATH]\bin\pgsql\data"
- Start backend
2.1. In Visual Studio Code: Got to Terminal in the Taskbar at the top
2.2. Run task:gradle:server:bootRun
- Start frontend
3.1. In Visual Studio Code: Got to Terminal in the Taskbar at the top
3.2. Run task:npm: start -web
- Open a browser at http://localhost:4200/
Here we describe how to run the DataLinker on an Ubuntu 18.04 LTS server.
For the DataLinker we need an apache server, a JRE, and a postgreSQL database.
To install these packages on Debian/Ubuntu use:
sudo apt install apache2 postgresql openjdk-11-jre
For the required packages of RDMO see the RDMO documentation. We suggest that to create a RDMO instance first before starting the DataLinker instance.
Connect to your server and login into postgres sudo -u postgres psql postgres
, in postgres:
- create the datalinker database
CREATE DATABASE datalinker;
- connect to the datalinker database
\connect datalinker
- create a datalinker postgres user
CREATE ROLE datalinker;
- set a password for the datalinker user
\password datalinker
- create all tables, views, and functions by calling the content of the file
misc\generate_database.sql
. - quit postgres
\q
- in
web\src\environments\environment.prod.ts
setappUrl:
to the URL of your server. - build the frontend
npm buildprod
orng build --prod
- copy the files in
web\dist\web
to the apache web folder on your server (usually/var/www/html/
)
- create a non-sudo user datalinker on the server
sudo adduser datalinker --home /srv/datalinker
- build the backend
gradle datalinker:server bootJar
- copy the jar from
server/build/libs
to the home directory of the datalinker user - copy
server/application.properties
to the home directory of the datalinker user - open the copied application.properties in a text editor
5.1. setspring.datasource.username
andspring.datasource.password
to the datalinker user created in psql
5.2. setrdmo.url
andrdmo.token
to the URL of your RDMO instance and add the correct token
5.3. setdspace.url
,dspace.collection
,dspace.user
anddspace.password
to the correct values of your dspace/edoc instance. 5.3. setzenodo.url
andzenodo.access_token
to the correct values of zenodo. - start the backend as
nohup java -jar server-0.0.3-SNAPSHOT.jar -Dspring.config.location=/application.properties -Xms512m -Xmx2g -d64 > log 2> err &
6.1. make sure the user datalinker is running the process
To install and configure RDMO please refer to the RDMO documentation.