Start here
A curriculum for understanding a stack
Section titled “A curriculum for understanding a stack”The purpose of these lessons is to make the movement of data and responsibility visible. We follow a browser request into a server-rendered Python application, through validation, permissions, business logic, and database operations, then back into the page.
The architecture is a modular monolith: related features live in one application codebase, organized into understandable modules. A later worker can run separately while using that same codebase and database. Each part has a specific job.
The core stack is FastAPI, Jinja, HTML, vanilla JavaScript, Pydantic, SQLAlchemy, SQLite, and Alembic. You will also meet HTTP, browser Promises, Python event loops, polling, SSE, WebSockets, and focused integration tests where they help explain the application’s behavior.
What you need to know first
Section titled “What you need to know first”You should recognize basic Python functions, dictionaries, and imports, plus ordinary HTML tags. The lessons explain framework concepts and the JavaScript used in the examples as they appear. A little familiarity with functions and variables will let you concentrate on how the application fits together.
You do not need to install or run the example application to follow the course. There is no companion application to clone.
How the examples work
Section titled “How the examples work”The recurring example is a fictional, generic document-review application. Users belong to organizations; the examples call that boundary a firm and store its identifier as firm_id. Members can view permitted documents, reviewers can start reviews, and administrators have the cross-organization access explicitly described in the policy.
The application evolves gradually. Dictionaries make the first request paths visible, then SQLite provides persistence. A manually refreshed page becomes a polling example, followed by streaming examples that explain other communication choices.
Some snippets are complete small examples. Others are focused excerpts from a module, or deliberately incomplete sketches used to explain a line of code. The surrounding text identifies relevant assumptions. Code fences can repeat a few lines you have already seen so you can read their explanation without scrolling back.
When the data model or mechanism changes, follow the transition described in that lesson. The later durable-job workflow uses Document.review_status and job IDs; earlier examples use Document.status. These are stages of the same teaching example.
Choose a reading path
Section titled “Choose a reading path”First reading: follow lessons 1 through 20. The order builds from the request lifecycle to the application layers, persistence, browser interactions, and reliability.
Earlier concurrency context: after lesson 12, you can read lesson 17 for a deeper explanation of the browser and Python event loops. Its live-note examples are explained again in their original context later in the series.
Core workflow: lesson 16 is an optional WebSocket extension. You can follow the integrated document-review workflow in lesson 18 without implementing that room.
Returning to a topic: use search, the lesson sidebar, or a page’s contents list. Search includes lesson explanations and code; a name such as get_authorized_document can take you back to the relevant example.
Technical assumptions
Section titled “Technical assumptions”The examples use Python 3.13 syntax, Pydantic 2, SQLAlchemy 2, and FastAPI’s native SSE interface, introduced in FastAPI 0.135.0. SQLite-specific details are called out where they affect behavior.
The editorial checks use isolated examples and temporary databases. An excerpt’s focused checks do not promise a fully implemented production application. The lessons identify boundaries such as CSRF protection, worker recovery, permission changes, and transport reconnection as they become relevant.