fs / phoenix-base

Skeleton for new Phoenix applications
http://www.flatstack.com/open-source/
MIT License
4 stars 3 forks source link

Phoenix Base

Build Status Test Coverage Code Climate

Phoenix Base is the base Phoenix app template used at Flatstack. It's based on Elixir 1.5 and Phoenix 1.2.

Application libs

Development libs

Testing libs

Scripts

Getting Started

Prepare dependencies

Elixir v1.5 and Postgres should be installed.

Bootstrap application

  1. Clone application as new project with original repository named "phoenix-base".

    git clone git://github.com/fs/phoenix-base.git --origin phoenix-base [MY-NEW-PROJECT]
  2. Create your new repo on GitHub and push master into it. Make sure master branch is tracking origin repo.

    git remote add origin git@github.com:[MY-GITHUB-ACCOUNT]/[MY-NEW-PROJECT].git
    git push -u origin master
  3. Run setup script

    bin/setup
  4. Run test and quality suits to make sure all dependencies are satisfied and applications works correctly before making changes.

    bin/ci
  5. Run app

    bin/server
  6. Update README

    Do not forget to update application README.md file with detailed information based on the existing template.

    mv doc/README_TEMPLATE.md README.md
    # update README.md
    git commit -am "Update README.md"

Deployment

Elixir Release Manager

Use ./bin/build script to build Elixir application release.

Heroku

You can use Elixir buildpack for Heroku to be deployed:

heroku create --addons=heroku-postgresql,sendgrid,newrelic,rollbar --remote staging phoenix-base-example --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"
heroku config:add HOST="phoenix-base-example.herokuapp.com"
git push staging master
heroku open

EDeliver

You can use EDeliver to deploy Erlang releases on remote hosts. Provide .deliver/config configuration first:

  cp ~./.deliver/config.example ~/.deliver/config
  ./bin/deploy

Code style

All Elixir code should be written following Elixir Style Guide.

Architecture

Please follow the next project structure:

Debugging

Testing

Hound tests require phantomjs started in WebDriver mode:

phantomjs --wd

Credits

Phoenix Base was written and maintained by by Flatstack with the help of our contributors.