https://github.com/datacite/lupo
DataCite REST API
https://github.com/datacite/lupo
doi graphql jsonapi lupo rails-api ruby
Last synced: about 1 month ago
JSON representation
DataCite REST API
- Host: GitHub
- URL: https://github.com/datacite/lupo
- Owner: datacite
- License: mit
- Created: 2017-05-18T14:47:24.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:05:10.000Z (over 1 year ago)
- Last Synced: 2024-10-29T09:22:28.162Z (over 1 year ago)
- Topics: doi, graphql, jsonapi, lupo, rails-api, ruby
- Language: Ruby
- Homepage: https://api.datacite.org
- Size: 15.5 MB
- Stars: 11
- Watchers: 8
- Forks: 8
- Open Issues: 78
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codemeta: codemeta.json
Awesome Lists containing this project
- awesome-starred - datacite/lupo - DataCite REST API (graphql)
README
# DataCite REST API
[](https://doi.org/10.5438/8gb0-v673)

[](https://codeclimate.com/github/datacite/lupo/maintainability) [](https://codeclimate.com/github/datacite/lupo/test_coverage)
Rails API application for managing DataCite providers, clients, prefixes and DOIs. The API uses the [JSONAPI](http://jsonapi.org/) 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:
```bash
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):
```bash
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:
```bash
docker-compose exec web bundle exec rspec
```
To run a specific test file:
```bash
docker-compose exec web bundle exec rspec spec/models/doi_spec.rb
```
To run a specific test at a specific line:
```bash
docker-compose exec web bundle exec rspec spec/models/doi_spec.rb:10
```
### Linting and Checking
To run code linting:
```bash
docker-compose exec web bundle exec rubocop
```
To run security checks:
```bash
docker-compose exec web bundle exec brakeman
```
To check for vulnerable gem versions:
```bash
docker-compose exec web bundle exec bundle-audit check --update
```
### Rails Console
To access the Rails console:
```bash
docker-compose exec web env DISABLE_SPRING=true bundle exec rails console
```
Alternatively, you can open a shell inside the container to run commands:
```bash
docker-compose exec web bash
```
Follow along via [Github Issues](https://github.com/datacite/lupo/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](https://github.com/datacite/lupo/blob/master/LICENSE).