Phoenix Fundamentals

A Phoenix app can basically be boiled down to a function that receives a HTTP request, and returns a response. We'll begin with this premise, and start to understand the important parts involved in this process.

Data is an integral part of virtually any web application, and a great persistence library make a huge difference in performance and maintainability.

Thankfully, the Elixir ecosystem has us covered in spades. Ecto is a thin layer of functions that allow us to build composable queries, validate fields, and seamlessly transform records between our DB and application representations.

One of the places where Elixir and Phoenix leave the competition in the dust is support for soft real time programming. The ability to keep a lightweight Elixir process running for the duration of a user's time in our app, and holding some small amount of state, makes our world far simpler for certain things than it otherwise would be.

Nearly every app we build these days requires some sort of authentication, and probably a user account to go along with it. Even if your app is an oddball and doesn't need this, user accounts provide us with a well-understood set of use cases that will serve as an excellent case study.

Let's put some of our newfound Phoenix knowledge into practice as we implement a secure user account feature set. The goal will be to reduce explicit management of authorization & authentication on a per-resource basis as much as possible.