jonnifyelixir
F5 · Pragmatic Programming / F5.01 · foundations

F5 · the approach · module 1

A running Portal from day one

The first pragmatic decision is the cheapest and the most important: the system runs from the start. Rather than build the Portal in the dark for months and wire up a web layer at the end, you stand it up behind a thin Elixir web server on day one — a handful of lines that answer real HTTP requests by calling the engine — and then grow the engine underneath it. The server is deliberately minimal, and it is meant to be thrown away: in F6 it is replaced by Phoenix, which calls the same engine. Nothing about the Portal logic changes when that happens, because the web was never allowed to reach into it.

This module sets the approach: the course-wide roadmap the Portal travels, the thin web server that runs it today, and the seam that lets Phoenix take over later without a rewrite.

One swappable part

THE BROWSER GET /enroll WEB LAYER · replaceable thin Elixir web server ENGINE CORE · untouched Portal.Engine · dispatch / query

[ thin Elixir web server ]
The web layer runs the Portal today — small, and built to be thrown away.

Why start thin

A working skeleton beats a perfect plan. Once one request can travel from a browser to the engine and back, you have something to demo, something to test against, and a frame every later module drops into. The cost of starting thin is a server you will discard; the cost of not starting thin is months with nothing that runs. The roadmap below is the whole journey — select a stage to see what it delivers and where it sits.

The development roadmap · select a stage

templating HTML / EEx done web server thin, Elixir F5.01 · here Portal the engine F5.02–F5.09 Phoenix + LiveView F6 Fly production out of scope start thin, keep it running, grow the engine, then change the front end

stage: Simple web server

where: F5.01 (here)

You are not building a web server; you are building the Portal. The server is scaffolding that lets the Portal run while it is built — valuable precisely because it is cheap to stand up and cheap to replace.

Three deep dives

In order: the roadmap and the case for starting thin; the minimal web server that runs the Portal today; and the discipline that keeps the web a replaceable detail so F6 can swap in Phoenix.

F5.01.1
The development roadmap
HTML templating → simple web server → Portal logic → Phoenix → Fly — the whole journey, and why you start thin.
F5.01.2
A thin web server in Elixir
A Plug.Router behind Bandit: each route turns a request into a call on Portal.Engine and sends the result.
F5.01.3
A web layer built for replacement
Every route only calls dispatch/1 and query/2, so Phoenix slots into the same seam in F6 with the engine untouched.

F4 · the store was built

F4 left a branded CHAMP store that keeps and keys entities. That is a part, not a product — nothing serves it yet.

F5 · make it run

A thin server puts the Portal on a port today; the rest of F5 grows the engine behind it while it keeps running.

Start with the development roadmap, then the thin web server, then building it for replacement. The next module, F5.02 — Modeling the Portal domain, gives the engine its first real shape. See also the design brief: the blueprint.

References

Starting with a running system, and the tools that make a thin Elixir server small.

Sources

Related in this course