Skip to content

awestbro/phoenix-starter

Repository files navigation

Phoenix Starter

Screenshot

Open source starter project for Phoenix framework. This is a slightly modified default Phoenix setup with the addition of webpack and yarn for frontend asset management rather than brunch. It also includes a basic user registration module covering common cases like user activation and forgotten passwords.

Libraries included

Elixir:

Front end:

Variations

The turbolinks branch contains a setup for turbolinks and stimiulusjs.

Installation

Tested with:

  • Erlang/OTP 21
  • Elixir 1.6.6
  • Yarn 1.7.0

To start your Phoenix server:

  • 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 && yarn install
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Make it your own!

To make this app your own, do a case-sensitive find/ replace in this folder for MyApp => NewName and myapp => newname. You will also have to replace two folder structures under lib/myapp* and test/myapp*

Development

I love development in Elixir and Phoenix. Well thought out libraries help you iterate on ideas quickly and safely with beautiful helper functions.

One of my favorite tools is the Bamboo development plugin which lets you send and view emails on a development server without actually sending the emails:

Email workflow

Deployment

I personally use Gitlab for deploying personal private projects. Therefore there's an included gitlab-ci.yml file with an example of how to test/ build/ deploy in a CI/CD environment. If you're using CircleCI/ Travis/ whatever just copy install steps from there into their format.

This project does rely on some environment variables for api keys etc. So you will need to supply your application with the following environment variables at runtime:

  • DATABASE_URL
  • GUARDIAN_SECRET
  • MAILGUN_API_KEY
  • POOL_SIZE
  • SECRET_KEY_BASE

Check the config/prod.exs

I use heroku at the moment for deployment, for other deployment options check out phoenix deployment guides.

Learn more about Phoenix

About

Elixir | Phoenix | Webpack | Bulma

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published