This is a starter kit that combines :
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.
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.
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.
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 thediv#helloWorld
anchor expectationweb/templates/page/index.html.eex
to make the test passweb/static/js/app.js
to make your Elm program works with your new anchorbrunch-config.js
to make Elm still compile to JS
Ready to run in production? Please check Phoenix deployment guides.
npm start
to start the phoenix servernpm test
to run back & front testsnpm run test:back
to run back-end testsnpm run test:back:watch
to run back-end tests in watch modenpm run test:front
to run front-end testsnpm run test:front:watch
to run front-end tests in watch modenpm run deploy
to create a production-ready build
-
Phoenix guide: http://phoenixframework.org/docs/overview
-
Phoenix docs: https://hexdocs.pm/phoenix
-
Elm guide: https://guide.elm-lang.org/
-
Elm docs: http://elm-lang.org/docs