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

DocTests
IEx.pry

Recommended Shortcuts

Add the following code to defp aliases do in mix.exs.

# 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

Elixir Official Website
Phoenix Official Website

--

--

--

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

Adam00

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

More from Medium

Display localised date / time information from Phoenix LiveView

Building a simple Calendly clone with Phoenix LiveView (pt. 5)

In Phoenix, how does the router, controller, template, and view code work together to render…

Elixir OTP and CockroachDB