jonnifyelixir
Contents / F6 · Phoenix Framework

F6 · chapter overview

Phoenix framework

F5 left a supervised engine behind a clean facade — correct, tested, and framework-free, but headless. F6 gives it a real product around it: a learning platform people actually use. We put Phoenix on top of the F5 engine without reaching into it — the endpoint joins the same supervision tree, the router sends requests to controllers and LiveViews, and every handler calls only the Portal facade. Then we take it to the next level: server-rendered HEEx, interactive LiveView with no hand-written JavaScript, real-time updates over PubSub, authentication and sessions, and a release deployed to production — finishing with a live dashboard that streams engine state to many clients at once. The engine never learns that Phoenix exists; that discipline is what makes the platform fast to build and safe to change.

Nine modules, one platform. Each adds a Phoenix capability on top of the same F5 engine, so by the end you have a real, real-time learning product — not nine framework demos.

The platform we’re building

Before the modules, three design pages set the scene: the journey a developer walks in this chapter, the platform we are building on top of the F5 engine, and exactly how Phoenix and LiveView wire onto that engine. Read them first — every module below builds one piece of this picture.

The chapter arc

Read it in order: each module adds one layer to the platform without disturbing the engine beneath it. The first pair stands Phoenix up and routes a request; the second gives it data and domain boundaries with Ecto and contexts; the third renders and makes the UI interactive with HEEx and LiveView; the last three make it real-time, secure, and deployed, ending in a live dashboard. F6.01 is built; the rest are planned, listed so the path is visible from here.

Nine modules · one platform on the F5 engine

01 request 02 routes 03 ecto 04 contexts 05 heex 06 liveview 07 pubsub 08 deploy 09 live lab · real-time stand it up (01–02) · data & domain (03–04) · the UI (05–06) · real-time & ship (07–09)
One platform runs the length of the chapter, built on the F5 engine. F6.01–F6.02 stand Phoenix up and route a request to the facade; F6.03–F6.04 add Ecto and contexts; F6.05–F6.06 render with HEEx and make it interactive with LiveView; F6.07–F6.09 add PubSub real-time, auth and deployment, and a live dashboard streaming engine state to many clients.

Phoenix is not the product; the platform is. This chapter spends every module dressing the same engine, so the framework lands as a tool you aim at a domain, not a thing you build for its own sake.

Module navigation

Each of the nine modules links to its hub and its three deep dives. The arc is the build order — start at F6.01, the request lifecycle, and end at F6.09, the live dashboard.

F6.01built

Architecture & the request lifecycle

endpoint → router → controller → view — how a request travels, and where the Portal facade is called.

  • F6.01.1The request lifecycle
  • F6.01.2The endpoint, supervised
  • F6.01.3Controllers, views & the facade seam
F6.02built

Routing, controllers & plugs

The plug pipeline: scopes, routes, and the middleware that runs before a handler reaches the engine.

  • F6.02.1Routes & verbs
  • F6.02.2Pipelines & scopes
  • F6.02.3Writing a plug
F6.03built

Ecto: schemas, changesets & queries

Data, validation, and the repo — how Ecto becomes one more adapter behind the engine’s port.

  • F6.03.1Schemas & migrations
  • F6.03.2Changesets & validation
  • F6.03.3Queries & the repo
F6.04built

Contexts & domain design

Boundaries that scale — how Phoenix contexts relate to the F5 facade rather than duplicate it.

  • F6.04.1Context boundaries
  • F6.04.2Contexts vs the F5 facade
  • F6.04.3Composing contexts
F6.05built

Templates, components & HEEx

Server-rendered markup: function components, slots, and HEEx that renders from engine state.

  • F6.05.1Templates & assigns
  • F6.05.2Function components & slots
  • F6.05.3Forms & inputs
F6.06built

Phoenix LiveView fundamentals

Interactive UIs without hand-written JavaScript — mount, handle_event, and render over the facade.

  • F6.06.1mount & assigns
  • F6.06.2handle_event & state
  • F6.06.3render & diffs
F6.07built

PubSub, channels & real-time

Live updates over WebSockets: broadcast engine events and push them to every connected client.

  • F6.07.1Broadcasting engine events
  • F6.07.2Subscribing a LiveView
  • F6.07.3Channels & presence
F6.08built

Auth, deployment & going live

Sessions and authentication, releases, and a production deployment that keeps the engine supervised.

  • F6.08.1Sessions & authentication
  • F6.08.2Releases & config
  • F6.08.3Deploying to production
F6.09built

The live dashboard

The lab: real-time LiveView state over a socket, broadcast to many clients via PubSub — the platform, live.

  • F6.09.1Build the dashboard
  • F6.09.2Broadcast engine events
  • F6.09.3Many clients, live

The chapter opens with F6.01 — Architecture & the request lifecycle (built) and closes with the F6.09 live dashboard. It builds on F5 — Pragmatic Programming — the supervised engine and its facade are what Phoenix mounts — and turns that headless engine into a real, real-time learning platform.