Skip to content

datacite/lupo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataCite REST API

Identifier Release Maintainability Test Coverage

Rails API application for managing DataCite providers, clients, prefixes and DOIs. The API uses the JSONAPI specification.

Key Concepts

  • Provider: An organization that manages clients (e.g., a university or research institute).
  • Client: A data center or repository that registers DOIs.
  • DOI: Digital Object Identifier, the core entity managed by the system.
  • Prefix: DOIs are assigned within a prefix (e.g., 10.1234).

Tech Stack

  • Ruby on Rails
  • MySQL
  • OpenSearch (Elasticsearch)
  • Memcached
  • S3 compatible storage (Minio in dev and test)
  • Shoryuken (AWS SQS) for Background Jobs
    • Inline Background Jobs in development and test environments

Development

We use Docker Compose for development to ensure a consistent environment.

Project Structure

  • app/graphql: GraphQL schema, types, mutations, and resolvers.
  • app/models: Core domain logic (Provider, Client, Doi, etc.).
  • app/jobs: Background jobs (Shoryuken).
  • app/serializers: JSONAPI serializers.
  • app/controllers: API controllers.

Prerequisites

  • Docker
  • Docker Compose

Configuration

You do not need a complicated .env file to get started. Reasonable defaults are set for both development and test environments and are loaded automatically by Rails. You can start with an empty .env file or override specific values as needed.

Starting the Application

To build and start the application and its dependencies:

docker-compose -f docker-compose.yml -f docker-compose.local.yml up --build

Database Setup

Once the containers are running, you can set up the database (create, schema load, seed):

docker-compose exec web bundle exec rake db:setup RAILS_ENV=development

Accessing the Application

The application will be available at http://localhost:8065.

Useful endpoints to visit include:

  • http://localhost:8065/dois
  • http://localhost:8065/clients

Running Tests

To run the entire test suite:

docker-compose exec web bundle exec rspec

To run a specific test file:

docker-compose exec web bundle exec rspec spec/models/doi_spec.rb

To run a specific test at a specific line:

docker-compose exec web bundle exec rspec spec/models/doi_spec.rb:10

Linting and Checking

To run code linting:

docker-compose exec web bundle exec rubocop

To run security checks:

docker-compose exec web bundle exec brakeman

To check for vulnerable gem versions:

docker-compose exec web bundle exec bundle-audit check --update

Rails Console

To access the Rails console:

docker-compose exec web env DISABLE_SPRING=true bundle exec rails console

Alternatively, you can open a shell inside the container to run commands:

docker-compose exec web bash

Follow along via Github Issues.

Note on Patches/Pull Requests

  • Fork the project.
  • Write tests for your new feature or a test that reproduces a bug.
  • Implement your feature or make a bug fix.
  • Do not mess with Rakefile, version or history.
  • Commit, push and make a pull request. Bonus points for topical branches.

License

Lupo is released under the MIT License.

Contributors 13

Languages