Skip to content

nicoespeon/starter-kit-phoenix-elm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter Kit Phoenix + Elm

This is a starter kit that combines :

  • Phoenix v1.2.1, the Elixir web framework, for the back-end
  • Elm v0.18 for the front-end

Getting started

You first need to install Elixir: http://elixir-lang.org/install.html.

You don't have to install Elm as it is installed locally.

Clone or download this repo to initialize your project with these files.

What you've got

Mix is the official Elixir build tool. It runs the Phoenix server and live reload it.

Brunch is the build tool used by Phoenix to deal with front-end stuff. It compiles Elm files into JS when Phoenix server is running. It watches Elm source files, so you've got live reload with Elm files too.

You can test your front-end with elm-test. For convenience, elm-html-test is here so you can test views. Also, elm-test-bdd-style is here to add BDD syntaxic sugar.

Start the app

To start your Phoenix app:

  • Install dependencies with npm install - it will install Elixir deps too
  • Start Phoenix endpoint with npm start

Now you can visit localhost:4000 from your browser.

Customize it

Replace the HelloWorld.elm with your own program.

You'll need to update:

  • web/elm/src/HelloWorld.elm
  • web/elm/src/tests/Tests.elm
  • tests/controller/page_controller_test.exs to change the div#helloWorld anchor expectation
  • web/templates/page/index.html.eex to make the test pass
  • web/static/js/app.js to make your Elm program works with your new anchor
  • brunch-config.js to make Elm still compile to JS

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

Commands

  • npm start to start the phoenix server
  • npm test to run back & front tests
  • npm run test:back to run back-end tests
  • npm run test:back:watch to run back-end tests in watch mode
  • npm run test:front to run front-end tests
  • npm run test:front:watch to run front-end tests in watch mode
  • npm run deploy to create a production-ready build

Learn more

About

A starter kit for projects with Phoenix + Elm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published