Rails API application for managing DataCite providers, clients, prefixes and DOIs. The API uses the JSONAPI specification.
- 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).
- 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
We use Docker Compose for development to ensure a consistent environment.
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.
- Docker
- Docker Compose
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.
To build and start the application and its dependencies:
docker-compose -f docker-compose.yml -f docker-compose.local.yml up --buildOnce 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=developmentThe application will be available at http://localhost:8065.
Useful endpoints to visit include:
http://localhost:8065/doishttp://localhost:8065/clients
To run the entire test suite:
docker-compose exec web bundle exec rspecTo run a specific test file:
docker-compose exec web bundle exec rspec spec/models/doi_spec.rbTo run a specific test at a specific line:
docker-compose exec web bundle exec rspec spec/models/doi_spec.rb:10To run code linting:
docker-compose exec web bundle exec rubocopTo run security checks:
docker-compose exec web bundle exec brakemanTo check for vulnerable gem versions:
docker-compose exec web bundle exec bundle-audit check --updateTo access the Rails console:
docker-compose exec web env DISABLE_SPRING=true bundle exec rails consoleAlternatively, you can open a shell inside the container to run commands:
docker-compose exec web bashFollow along via Github Issues.
- 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.
Lupo is released under the MIT License.