Skip to content

backspace/prison-rideshare-api

Repository files navigation

Prison Rideshare pipeline status Coverage Status

This is a database to track reïmbursements and miscellania for a prison rideshare project. It serves the API for the Ember UI.

It’s intended to replace an increasingly unwieldy and brittle set of spreadsheets.

The initial target feature set will cover:

  • coördinators recording ride requests
  • ride-givers completing reports on their rides
  • collecting and calculating gas and food expenses from the reports
  • tracking reïmbursements of expenses

It’s currently specific to Bar None’s prison rideshare project but if you’re interested in adapting it, please let us know, we are interested in making it useful for others!

Deployment

This can be deployed to various environments but Dokku is the current iteration.

Set up

dokku apps:create rideshare-api
dokku buildpacks:add rideshare-api https://github.com/gigalixir/gigalixir-buildpack-elixir.git

dokku postgres:create rideshare-api
dokku postgres:link rideshare-api rideshare-api

Add environment variables

  • DATABASE_URL (set automatically by postgres:link)
  • GAS_PRICE_ENDPOINT: fetched to determine daily gas prices
  • GUARDIAN_SECRET, PERSON_GUARDIAN_SECRET: use mix phx.gen.secret to generate
  • MAILGUN_DOMAIN, MAILGUN_KEY: to send transactional email (ride reports, calendar links, warnings)
  • ORIGIN_HOST: domain application will be served at
  • SECRET_KEY_BASE: use mix phx.gen.secret to generate
  • SENTRY_DSN: for error-monitoring
dokku config:set rideshare-api \
  GAS_PRICE_ENDPOINT= \
  GUARDIAN_SECRET= \
  MAILGUN_DOMAIN= \
  MAILGUN_KEY= \
  ORIGIN_HOST= \
  PERSON_GUARDIAN_SECRET= \
  SECRET_KEY_BASE= \
  SENTRY_DSN=

Currently hardcoded:

  • currency

Deploy

git remote add [remote name] dokku@[host]:rideshare-api
git push [remote name] primary

Running

To start your Phoenix app:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with npm install
  • Start Phoenix endpoint with mix phoenix.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

About

A database for a prison rideshare project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published