The eLTER Data Harvester is a tool for harvesting data from several external repositories used previously by LTER. It collects data and synchronizes it with eLTER DAR.
- Node.js: >= 20.0.0
- npm: >= 9.0.0
- PostgreSQL: >= 12.0
git clone git@gitlab.ics.muni.cz:514266/data-harvester.git
cd data-harvestercd shared
npm installcd backend
npm installcd ../frontend
npm installCopy the .env.example file into .env file in the backend/ directory, and set up variables. You can set up your FIELDSITES_TOKEN at https://auth.fieldsites.se/login/. DEV_AUTH_TOKEN and PROD_AUTH_TOKEN need to use tokens for given DAR instances with write access to /external-datasets.
Copy the .env.example file into .env file in the frontend/ directory, and set up variables. The VITE_API_URL must use the same port as backend/.env.
You can skip following steps if you wish to use Docker setup. After setting .env file run following commands. The container tests the setup in development mode against https://dar.dev.elter-ri.eu/, so you will need a token for the API in your .env file.
$ docker-compose up -d --build
$ docker-compose upConnect to PostgreSQL, and create a database. You can do it for example the following way:
$ sudo su postgres
$ psql
$ CREATE DATABASE data_harvester_dev; # or use what you put into DEV_DB_NAME in ./backend/.env
$ CREATE DATABASE data_harvester; # or use what you put into DB_NAME in ./backend/.envMigrations are located in backend/migrations/.
cd backend
# run all migrations
npm run migrate upYou can either setup environment in .env or run use NODE_ENV prefix.
cd backend
npm start
# or NODE_ENV=dev npm start / NODE_ENV=prod npm start
# https://dav.elter-ri.eu/ or https://dar.dev.elter-ri.eu/The backend server will start the port specified in PORT environment variable.
In a new terminal:
cd frontend
npm run dev # uses https://dar.dev.elter-ri.eu/ and dev database
npm start # uses https://dar.elter-ri.eu/ and prod databaseWhen the backend server is running, API documentation is available at:
- Swagger UI:
http://localhost:3000/api-docs
The API provides endpoints for:
- Records management
- Rules management
- Harvesting jobs
- OAR management
- DEIMS sites synchronization