08 — Stack and technologies
The doctrine isn’t tied to any programming language — but the choice of stack decides the two things that matter most when working with an assistant: how cheap a mistake is and how easy it is to test. The table of defaults in chapter 08 is a sensible starting point, not dogma. You depart from it deliberately — and write down why. Below is what stands behind those choices.
Why these defaults
SQLite — The simplest database — the whole thing lives in one file, with no separate server. A great default to start: zero configuration, easy backup (you copy the file). As you grow, you migrate up. more in the glossary → ↗
Every row of the table follows the same logic: start with the simplest thing that carries today’s requirement, and have an explicit growth path.
- Python — A popular, readable programming language — The Craft’s default for scripts, data and the back end. A proven default: lots of ready tools and libraries, easy to drive with AI. more in the glossary → for the backend, scripts and data — because it reads like prose (easy to review for both a person and the assistant), comes with “batteries included” and covers the API — An agreed way for two programs to talk to each other — one asks, the other answers in a set format. Through an API your app connects to outside services (payments, maps, AI). Treat an API key like a password. more in the glossary →, scripts and data work in one language. Fewer contexts to hold in your head. FastAPI adds types, validation and an automatic API description — a free contract between front end and back end (12).
- Another language when the task fits it better — Go, Rust, Kotlin or TypeScript/Node (more below). The rule is “one language per layer”, not “Python always”.
- SQLite to start — zero administration, one file, great for an MVP and an always-on server. You don’t start with a distributed database “because it’ll grow one day”. PostgreSQL — A solid, “grown-up” database for bigger apps — runs as a separate server. The default step after SQLite, when you need many concurrent users and advanced features. more in the glossary → comes in when concurrent writes, roles or complex relations start to hurt — and it’s worth anticipating the move in the data model from the start (11).
- Server-rendered HTML and a little plain JS — the less JavaScript, the faster the page and the cheaper the upkeep (13). A Framework — A ready-made skeleton with the basic parts of an app, which you build on instead of starting from scratch. It saves work but adds a dependency and weight — the doctrine reaches for one only when the interaction needs it. more in the glossary → like Next.js only when the interaction truly needs it.
- Cache — A temporarily remembered result, so the same thing isn’t computed again on every request. Speeds the app up, but can be a trap: a stale cache shows old data. more in the glossary → and queue: none — until measured traffic forces them. Redis “just in case” is one more service to watch, back up and update.
- Docker / container — Packaging an app with everything it needs so it runs the same on every computer. Kills “works on my machine” — the same environment locally and on the server. more in the glossary → where dependencies hurt — the same image locally, in CI (continuous integration) — Automation that builds the project and runs the tests by itself after every change to the repository. A bug shows up minutes after the commit, not a week later in production. more in the glossary → and in Environment (dev / prod) — Separate places where the app runs: “dev” for safe tests, “prod” for real users. Dev is a playground, prod is where real users are — the rules for each are completely different. more in the glossary → makes “works on my machine” disappear. But a single script with no dependencies doesn’t need a container; Docker is a tool, not a ritual.
One icon set
Lucide only ↗
It sounds like a detail, but mixing icon libraries shows immediately: different stroke weights, different corner radii, different proportions — the interface looks stitched together from pieces. One set (Lucide) kept in a single sprite file gives consistent geometry and one place where a new icon gets added. This website follows exactly that rule.
The monolith as the default architecture
The Monolith — An app built as one whole (one deploy, one database), not a patchwork of separate services. A simple, cheap default to start — easy to grasp. You split it only when scale really demands. more in the glossary → is the default architecture: ↗
One application (pages, API, background jobs) and one database on one server is a system you can hold in your head: one Deploy — Releasing a new version of the app “live”, where real people use it. It’s the moment a change reaches real people — which is why it happens only on an explicit “deploy”. more in the glossary →, one log, one Backup — A copy of your data saved earlier, which you return to when something goes wrong. It’s the only way to undo a change to data — code comes back from git, data only from a backup. more in the glossary →, one Rollback — Reverting a change to the previous, working state — “Ctrl+Z” for a deployment. When a new version breaks production, a rollback restores the previous one in seconds instead of fixing in a panic. more in the glossary →. Finding a bug means reading one process, not stitching together traces from several services scattered across a network.
Splitting into microservices or Serverless — A model where you don’t manage a server — the code runs itself when someone needs it, and sleeps when not. You pay per use, it scales itself. The trap: a “cold start” — the first call can be slower. more in the glossary → functions adds things: network communication, versioned contracts between services and a whole new class of failures (service A works, B doesn’t, and C waits forever — 14). You take on those costs when a metric forces them: traffic, team size, the need to isolate failures — not because “that’s how it’s done now”.
The default hosting is one VPS — A rented piece of a cloud server “just for you”, where you put an app “live”. Predictable cost and full control. One VPS easily carries a few small projects. more in the glossary → with nginx — A program at the front of the server that takes traffic from the internet and routes it to your app. Handles HTTPS, serves static files, balances traffic — the server’s proven “reception desk”. more in the glossary → (proxy, certificates) and a process manager: cheap, predictable, fully under your control and with no “cold start”. Serverless with scale-to-zero makes sense for uneven or global traffic, when a few seconds’ delay on the first request is acceptable — a deliberate cost/latency trade-off, written down as a decision (12).
A language matched to the task
The language is chosen by fit, not by habit. ↗
Python is the default because it has the widest ecosystem for scripts, data and gluing AI services together — but since version 1.1.2 the doctrine says outright that it’s a default, not a dogma. Another language wins when a concrete need decides it:
- Go — concurrent network services and deployment as a single static binary, with no interpreter to install on the server.
- Rust — hot paths where every millisecond and memory safety count.
- Kotlin — when the library you need lives in the JVM world, or you’re building for Android.
- TypeScript/Node — when the web layer is in JavaScript anyway.
Two safeguards protect against both extremes. First: a language change goes into an architecture decision record (ADR (decision record) — A short note: what we chose, why, and which alternatives we rejected (Architecture Decision Record). Six months later nobody has to guess whether a decision was deliberate and whether it’s safe to change. more in the glossary →) together with what decided it — a measured number or the name of the missing library. Second: rewriting something “because it’ll be faster” needs a measurement first, showing that the language is what’s slow, not a database query or a missing cache (13). And one more: one language per layer, not one per mood — each extra language is a separate set of tools, tests and traps to maintain.
You can see the consequence in chapter 17: the ready-made Guard — A test that enforces a project rule (e.g. “every module is in the AI_README”) and stops the commit when it’s broken. A rule without a guard is only a wish — a long session will break it in good faith. more in the glossary → are written in pytest as a reference implementation, and a project in another language ports the same spec to its own test runner.
Testability over trends
Testable from the first line beats trendy. ↗
This is the most important criterion for choosing technology. A tool you can’t easily cover with fast, repeatable tests is a bad choice — even if it’s riding a wave. When working with an assistant it matters twice over: tests are how the assistant proves a change works (03). A technology that makes that harder makes the whole collaboration harder.
Boring and mature over new: ↗
A mature technology has a rich ecosystem, good documentation and — especially important when working with AI — plenty of examples the assistant learned from. A novelty from three months ago means fewer proven answers, more guessing and more mistakes in places nobody has described yet. A stack chosen “for the CV” solves the author’s problem, not the project’s.
Reproducibility and secrets
Reproducible environments: ↗
Pinned dependency versions (a lock file) and a virtual environment or container image make “it worked yesterday” stop being a mystery. Without pinning, one new library version quietly installed during the next deploy can break something nobody touched. A consistent formatter and type hints Push / pull — Push sends your commits to the remote repository; pull fetches changes from there into your copy. A push is an “outward” action — in The Craft it needs explicit consent, like a deploy. more in the glossary → the same way: predictable code is cheaper to review (02).
Secrets live in env or a secret store — never in the Repository (repo) — A store of the whole project’s code together with its full history of changes — who changed what and when. The repo is the project’s memory: code, documentation and change history in one place. more in the glossary →. ↗
A password or API key committed even once stays in git history forever — deleting the file in a later Commit — A saved, labelled point in the project’s history — a confirmation of a specific batch of changes. Small, described commits make a history you can return to any working state from. more in the glossary → doesn’t erase it. If the repository is ever public (or someone clones it), the key is compromised. So secrets live in environment variables or a dedicated secret store, and the repo holds only a template file with empty values (e.g. .env.example).
A decision with its reasons
Every non-default choice gets an ADR: ↗
An ADR (Architecture Decision Record) is a short note: what we chose, why, and which alternatives we rejected. You write one only where you depart from the default stack — default choices need no justification. Six months later the next session (a person or the assistant) doesn’t have to guess whether PostgreSQL was a considered decision or an accident — and whether it can safely be changed (01).