- macOS or Linux
- Ruby version that matches the
.ruby-version
file. (rbenv is recommended for managing Ruby versions) - Node 18 (nvm is likewise recommended)
- Postgres (this template is confirmed to work with Postgres 18, but any reasonably recent version should work)
- Heroku CLI (optional, if you want to deploy on Heroku)
- Create a Postgres user by running
createuser [username] -d
. - Launch
psql
and create a database for your project, and set it to be owned by the user you created in step 1. - Create an
.env
file in the root folder of this project, following the format of.env.example
. - For the
SECRET_KEY_BASE
env parameter, you can generate a secure value by runningbundle exec rails secret
. - Run
bundle install
to install the gems from the Gemfile. - Run
npm run build
, which installs Node dependencies and builds the browser app. - Create an app on Heroku.
- Now you should be able to deploy to Heroku as covered in their docs.
Use bundle exec rake start
to start a live development build.
To install Flow types run yarn flow-typed install
. To run Flow server run yarn flow
.
Note: Currently, Flow is throwing errors for most files. Instead of updating these all at once, we should fix the Flow errors as other changes are made to the files. Eventually, we should convert this code-base to Typescript.
To run via Docker requires a IIIF Cloud instance as well. This can be run as a separate Docker application, or pointed to a IIIF Cloud application hosted somewhere else. All that's required is the IIIF_CLOUD_*
environment variables are set properly and a MapTiler account/API key.
To run via a Docker container (for development or production) set your environment variables in .env
, you can use .env.example
as a template. If an image has not yet been built, run docker compose up --build
to build the image and start the container. Subsequent starts of the container can be done with docker compose up
if no code changes have been made.
Use the following command the schedule daily backups in a Heroku environment:
heroku pg:backups:schedule DATABASE_URL --at '00:00 America/New_York' --app my-app
See Heroku's retention policy for backups.