Skip to content

Latest commit

 

History

History
107 lines (64 loc) · 3.02 KB

README.md

File metadata and controls

107 lines (64 loc) · 3.02 KB

Digital SEL API

Nou blouweþ þe niwe frut . þat late bygan to springe

Þat to is kind eritage . mankunne schal bringe

Travis (.com) Coverage Status

The Digital SEL API the Rails backend of the Digital SEL, a digital humanities project whose aim is to provide a sophisticated, interactive digital edition of the South English Legendary, an important collection of Middle English saints' lives from the Middle Ages.

For more information about the project see the Digital SEL Blog. For a very very early version of the project (written before the maintainer was a software engineer) see the DigitalSEL.org.

If you are new to development and need help, please feel free to reach out to me via Twitter @william_ellet.

Development

Prerequisites

If you are not sure about how to install the prerequisites, follow this guide.

Setup the project for development

Set the appropriate environment variables:

cp .env.example .env

In development, the relavant variables to set are DSEL_DB, DEVISE_JWT_SECRET_KEY, and RAILS_MASTER_KEY. The values can be arbitrary, but to use the development database snapshot, set DSEL_DB to dsel_development.

Install the appropriate prerequsites and libraries

If you do not have Ruby 2.4.4 apparent in rvm list, do rvm install 2.4.4.

Then do gem install bundler.

Next, do bundle install.

After you have your database server running, create and migrate the database:

rails db:create

rails db:migrate

Run the server:

rails s

Run the tests

rspec

Run the linter

rubocop

Run the security audit

Download the latest vulnerability data

bundle-audit check --update

Run bundle-audit

bundle-audit

Database Maintenance

Though database state is not important to the software, it is very important to the project.

Make a snapshot of the database:

Run

make ENV=development snapshot

or copy and paste

pg_dump --no-acl --no-owner --clean dsel_development | gzip > dsel_development`date -u +'%Y-%m-%dT%H-%M-%SZ'`.sql.gz

Restore a snapshot of the database:

gunzip -c $FILENAME | psql dsel_development

API Specs / Postman

A maintianed Postman collection of the API may be found in /postman. Set the environment variable base_url to https://api.digitalsel.com to use the collection against production.