Phoenix is a web framework for Elixir built on top of the Erlang VM (BEAM), created by Chris McCord and developed with the wider Elixir community. It ranks around #27 among web frameworks at roughly 2.4% usage share. It's famous for handling enormous numbers of concurrent real-time connections โ chat, live dashboards, multiplayer features โ with very low resource use, thanks largely to LiveView, which lets developers build real-time interactive UI without writing JavaScript.
A Phoenix controller module maps actions to functions that render a response, following a familiar MVC-style structure.
defmodule MyAppWeb.PageController do
use MyAppWeb, :controller
def index(conn, _params) do
render(conn, :index, page_title: "Home")
end
def show(conn, %{"id" => id}) do
post = Blog.get_post!(id)
render(conn, :show, post: post)
end
end
Install the Phoenix project generator via Mix (Elixir's build tool), then generate and run a new app.
# install the Phoenix app generator
mix archive.install hex phx_new
# create a new Phoenix project
mix phx.new my_app
cd my_app
mix phx.server