Learn the Monolith
Understand what happens between the layers
Section titled “Understand what happens between the layers”A button click becomes an HTTP request. A dependency identifies the user. A service applies a rule. A transaction changes the database. A response returns to the browser.
This course slows that journey down. Each lesson takes one part of a server-rendered Python monolith, shows the code, and follows what actually runs. Concrete values, repeated snippets, and execution traces let you study the connection between the parts.
The recurring example is a generic document-review application built with FastAPI, Jinja, HTML, vanilla JavaScript, Pydantic, SQLAlchemy, SQLite, and Alembic. The lessons are a curriculum for understanding that stack. You can read them without assembling an application.
Created and curated by Max Braglia. Originally written with ChatGPT for breakfast reading, then corrected and refined with Codex. Read the story.
The curriculum
Section titled “The curriculum”Read in order, revisit a familiar topic, or search for an explanation or code identifier. Every lesson has its own section links and contents list.
The request lifecycle
Section titled “The request lifecycle”- 01 · From Browser to Route and Back
- 02 · Middleware Wraps the Request Lifecycle
- 03 · Authentication Through a Session Cookie
- 04 · Authorization and Resource Ownership
Inside the application
Section titled “Inside the application”- 05 · APIRouter and a Multi-File Application
- 06 · Depends and the Dependency Graph
- 07 · Pydantic at the HTTP Boundary
- 08 · The Service Layer
Persistent data
Section titled “Persistent data”Browser interactions
Section titled “Browser interactions”- 11 · A Button Click, fetch, and a Page That Updates
- 12 · Promises, await, Timeouts, and Cancellation
- 13 · Polling for Document-Review Status
- 14 · Starting Background Work Without Carrying the Request With It
Live communication
Section titled “Live communication”- 15 · Server-Sent Events and One-Way Live Status Updates
- 16 · WebSockets and a Live Review Room — optional extension
- 17 · Two Event Loops, asyncio, and What await Really Does