Install Phoenix 1.4.0 for MacOS

Install Elixir

$ brew install elixir

Install/Update Mix

$ mix local.hex

Install Phoenix

$ mix archive.install hex phx_new 1.4.0

Create new Phoenix API

$ mix phx.new my-app --no-webpack --no-html

Run Interactive Mode

$ iex -S mix # run recompile() for any change
$ MIX_ENV=test iex -S mix

Seed Data

$ mix run priv/repo/seeds.exs

Create Docs

$ mix docs

Recommended Shortcuts

# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"test": ["ecto.create --quiet", "ecto.migrate", "test"]
s: ["server"], # Start Web Server
d: ["phx.digest"], # Compile Static Asset
g: ["deps.get"], # Download Elixir/ Erlang Packages
db: ["ecto.migrate"], # Database Migration
r: ["phx.routes"], # Check Routing
m: ["phx.gen.model"], # Generate Model
]
end

Reference

--

--

Let's go invent tomorrow instead of worrying about what happened yesterday.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam00

Let's go invent tomorrow instead of worrying about what happened yesterday.