NOTE: This won't work with Postgres > 9.6, because postgrex
needs to be updated, which requires updates to many other packages. This is a problem when deploying to Heroku.
Web application to make school classroom directories. Built with Elixir and Phoenix.
mix ecto.setup
This will create a default user with email test@example.com
and a password of secret
(configurable in priv/repo/seeds.exs
). Login and delete this user and create a user with a secure password.
Next, create Classes
and Buses
from within the admin interface. Those models will populate selection options on the main data entry page. At this point users can enter their information and the directory can be generated.
The main data entry point is served from /
, it does not require a login. All administration is done from the /admin
url, these paths do require a user login.
The app can send email to inform the maintainer that a new entry has been received. To use this feature, define the environment variables described below. The application uses Mailgun to send email.
Define the following environment variables to enable certain features
HTTPS_HOST
: hostname to use in theconfig/prod.exs
as theurl:host
name for forcing sslMAILGUN_DOMAIN
: as specified in the Mailgun control panel, something likehttps://api.mailgun.net/v3/sandbox-our-domain.mailgun.org
MAILGUN_API_KEY
: as specified in the Mailgun control panelNOTIFY_EMAIL_TO
andNOTIFY_EMAIL_FROM
: also need to be defined to use the Mailgun interfaceSUPPORT_EMAIL
: if defined, adds a line of help text with amailto
link in to the top of the page
Follow this guide: http://www.phoenixframework.org/docs/heroku
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set POOL_SIZE=18
mix phoenix.gen.secret
heroku config:set HTTPS_HOST="XXXX"
heroku config:set SECRET_KEY_BASE="XXXX"
heroku config:set MAILGUN_DOMAIN="XXXX"
heroku config:set MAILGUN_API_KEY="XXXX"
heroku config:set NOTIFY_EMAIL_TO="XXXX"
heroku config:set NOTIFY_EMAIL_FROM="XXXX"
heroku config:set SUPPORT_EMAIL="XXXX"
heroku run mix ecto.create
(apparently you can ignore the errors...)heroku run mix ecto.migrate
heroku run "POOL_SIZE=2 mix run priv/repo/seeds.exs"
- Log in with default credentials and set a real password
See the LICENSE file for license rights and limitations (MIT).