Skip to content

Module 2 — Project setup & reproducibility

Estimated: 1 week · Syllabus · ← Module 1 · Next → Module 3

  • 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.example documents 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.

Scaffold Project B (FeeForge):

  • Stack: Next.js + TypeScript (create-next-app with 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. Then src/app/ (routes/UI), src/lib/ (db, API clients), tests/, docs/.
  • Config hygiene: .env.example (DB URL, ANTHROPIC_API_KEY), .gitignore, .editorconfig, ESLint + Prettier, tsconfig in strict mode.
  • A README with the four essentials (what / install / run / test).

git clonepnpm installpnpm 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)