Skip to content

DANS-KNAW/IST-rda-storage-service

Repository files navigation

DANS Logo RDA LOGO

Micro-service for storing RDA Tiger deposits and annotations

Description

This service is part of the RDA Tiger initiative and is developed by the Data Archiving and Networked Services (DANS) in the Netherlands. This micro-service is responsible for storing various deposits. It includes the following capabilities:

  • CSV seed ingest
  • Annotation creation

Usage and Management

This repo includes two setups: a production setup and a local setup.

Environment Variables Files

The service can use three different .env files: .env.local, .env.development, .env.production.

It is IMPORTANT to note that if multiple .env files are present, it will use them in the following order: local -> development -> production.

The easiest method is to simply copy the needed file from the .env.example file:

cp .env.example .env.local

Local Usage

The following prerequisites are needed for the project:

  • Valid RabbitMQ instance
  • Docker
  • Node/pnpm

Installation

# The service is set up with pnpm, so make sure to install packages with it.
pnpm install

Start the required Services

The required services are included in the docker-compose.yml file. You can start all needed services with the following command:

# Docker only supports .env files by default, so we need to specify the exact file.
docker compose up --env-file .env.local -d

Running the app

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

Seeding

The project includes a rda.zip simply unzip in a directory like csv and then run the following command:

note: Don't forget to replace the <PATH_TO_PROJECT> in the command.

curl -X POST http://localhost:3000/seeding -H "Content-Type: multipart/form-data" $(find <PATH_TO_PROJECT>/IST-rda-storage-service/csv -type f -exec echo -n '-F files=@{};type=text/tab-separated-values ' \;)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published