Dominik Krzemiński

Zapis decyzji 0001Przyjęta

`/content` is the single source of truth

Ta strona nie została jeszcze przetłumaczona — czytasz angielski oryginał.

Context

The site has two first-class audiences: a human reader and a machine consumer (AI crawler, MCP client, retrieval agent). Both need the same facts — bio, projects, stack, experience. The obvious failure mode is maintaining those facts twice: once in the Astro front end and once in the .NET backend that serves the machine surfaces. Two copies drift, and the drift is invisible until an agent confidently reports something that the website no longer says.

Decision

A single directory, /content, at the repo root holds every fact about me as Markdown with typed frontmatter. It is the only place any such fact exists.

  • Astro builds pages from it through content collections with Zod schemas.
  • The .NET solution (Portfolio.Content) parses the same files with mirrored records and serves them over MCP and the retrieval API.
  • Neither side stores a derived copy. Anything that looks like a second list — an aggregated technology view, for instance — is computed as a join at read time.

/content sits at the repo root rather than inside apps/web, because it belongs to both consumers symmetrically. Putting it inside either application would make the other a second-class citizen of its own source data.

Consequences

  • The Astro dev server needs vite.server.fs.allow widened to the repo root, since the content lives outside the app directory.
  • Content changes require no code changes in either application.
  • Two independent parsers read the same corpus, which is a liability unless drift is actively policed. ADR 0002 covers how.
  • Adding a third consumer later (a CV generator, an RSS feed) is a read, not a migration.

Alternatives rejected

Content inside apps/web, .NET reads the built output. Couples the backend to Astro’s build artefacts and their version-specific shape, and makes the backend unbuildable without first building the front end.

A database or CMS as the source of truth. Loses reviewable diffs, makes the content unavailable at build time, and adds a runtime dependency to a site whose entire point is being static and fast.

Wszystkie notatki