Module 2 — Project setup & reproducibility
Estimated: 1 week · Syllabus · ← Module 1 · Next → Module 3
Concepts
Section titled “Concepts”- Reproducible environments. The property that anyone, anywhere, anytime gets identical
behavior. Achieved through dependency pinning (lockfiles), environment isolation (venvs /
local
node_modules/ containers), and explicit runtime versions. - Dependency management theory. Semantic version ranges vs. exact pins; the difference between your declared dependencies and the resolved dependency graph a lockfile captures. Transitive dependencies are where reproducibility quietly breaks.
- Configuration & secrets. The twelve-factor principle: config lives in the environment,
not the code. Secrets never touch version control. Committed
.env.exampledocuments the shape without the values. - Project structure conventions. Predictable layout (
src/,tests/,config/,docs/) reduces cognitive load — people find things where they expect. Language ecosystems have idioms; follow them. - Task automation. npm scripts (or a
justfile) turn tribal knowledge into one-word commands (npm run dev / test / lint / format / db:migrate). This is executable documentation. - Editor parity.
.editorconfig+ committed workspace settings keep VS Code and Antigravity consistent (whitespace, line endings, formatter-on-save). For a TS project, commit ESLint + Prettier config so both editors format identically.
Practice
Section titled “Practice”Scaffold Project B (FeeForge):
- Stack: Next.js + TypeScript (
create-next-appwith the App Router). - Package manager:
pnpm(fast, strict, disk-efficient) with its lockfile committed; pin the Node version via.nvmrc/engines. - Database: Postgres via Supabase or Neon (free managed tier); Prisma or Drizzle for schema + migrations.
- Structure: keep the fee-calculation domain in a pure module (
src/domain/fee/) with zero framework/DB imports — this is the coupling boundary from Module 1 made real. Thensrc/app/(routes/UI),src/lib/(db, API clients),tests/,docs/. - Config hygiene:
.env.example(DB URL,ANTHROPIC_API_KEY),.gitignore,.editorconfig, ESLint + Prettier,tsconfiginstrictmode. - A
READMEwith the four essentials (what / install / run / test).
Milestone
Section titled “Milestone”☐ git clone → pnpm install → pnpm dev boots the app, and pnpm test runs a trivial
passing test against the fee module. Reproducibility proven, and the pure-domain boundary
exists from day one.
(working notes go here)