This is a simple webserver using Elixir Phoenix and Elm. Here is an example of the result.
- Phoenix
- Elm
- Elm Phoenix Socket
- ES6
- ESLint
- Prettier
- Webpack
- PostCSS
- SCSS
- Tachyons
- Live reloading
- Elm environment flags
- Ready to deploy to Heroku
- Clone repo
mix deps.get
mix ecto.create && mix ecto.migrate
yarn install
cp env.example .env
mix phoenix.server
Visit localhost:4000
in your browser.
Test with mix test
.
The frontend is built with Webpack. This is taken care of for you when starting phoenix.
Phoenix uses the PostgreSQL database. I recommend using the docker container. It must be running before you run the command mix ecto.create
.
- Elixir in
lib/
andweb/
- Elm in
web/elm
- SCSS in
web/static/scss
- Public files in
web/static/assets
- Fonts in
web/static/fonts
This template is setup to deploy to Heroku.
heroku create
heroku config:set SECRET_KEY_BASE=$(mix phoenix.gen.secret)
heroku config:set WEBSOCKET_URL="wss://YOUR-HEROKU-APP.herokuapp.com/socket/websocket"
heroku addons:create heroku-postgresql:hobby-dev
heroku buildpacks:set https://github.com/gjaldon/phoenix-static-buildpack
heroku buildpacks:add --index 1 https://github.com/HashNuke/heroku-buildpack-elixir
heroku run "POOL_SIZE=2 mix ecto.migrate"