Skip to content

digitalnatives/course_planner

Repository files navigation

Build Status codebeat badge Coverage Status

Course Planner

Development Setup

Local

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with cd assets; npm install; cd ..
  • Start Phoenix endpoint with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Production Setup

Heroku

  1. Deploy Deploy with the previous Heroku button. Make sure to setup the environment variable ENDPOINT_URL_HOST in the deploy page. For example, if the selected App name is course-planner, then the ENDPOINT_URL_HOST should be course-planner.herokuapp.com.
  2. Create a SendGrid API Key and add it to the environment variable SENDGRID_API_KEY in the Heroku Settings tab.

Gigalixir

For more details, see the Gigalixir quick start

  1. Clone this repository
  git clone https://github.com/digitalnatives/course_planner.git
  1. Go to the project directory
  cd course_planner
  1. Install gigalixir CLI (requires python 2.7)
  pip install gigalixir
  1. Login with your Gigalixir account
  gigalixir login
  1. Create the application your-app-name, which should be unique
  APP_NAME=$(gigalixir create --name your-app-name)
  1. Create the database, and wait its state to become AVAILABLE.
  gigalixir create_database $APP_NAME
  gigalixir databases $APP_NAME
  1. Set the environment variables
  gigalixir set_config $APP_NAME DATABASE_URL $YOUR_DB_URL
  gigalixir set_config $APP_NAME SENDGRID_API_KEY $YOUR_SENDGRID_API_KEY
  gigalixir set_config $APP_NAME EMAIL_FROM_NAME $EMAIL_FROM_NAME
  gigalixir set_config $APP_NAME EMAIL_FROM_EMAIL $EMAIL_FROM_EMAIL
  1. Deploy the code
  git push gigalixir master
  1. Run the data seed
  gigalixir run $APP_NAME Elixir.CoursePlanner.ReleaseTasks seed