documentation: Architecture map, conventions, glossary and data model; fix stale docs
Back to our planType
documentation
Summary
Write down how the website's code is organized and how it should be organized, in one place, so that people and AI agents can find their way and make changes in the right spot. Remove the old notes that describe a setup the site no longer uses.
Problem
The repo explains how to work (AGENTS.md, .claude/rules/), but not what the system is. Nothing maps the business areas (events, news, contact, accounts, site pages) to folders, records the data model, or defines shared terms like "upcoming" or "published".
Some docs are wrong today:
CLAUDE.mdnamessprecher-east.orgas the live domain (it issprechereast.com, see #105), lists apayload-oauth2plugin that isn't installed, and doesn't mention the SMTP email adapter or the Turnstile robot check.HANDOFF.mddescribes a Sanity CMS hosted on Vercel, which this site no longer uses.docs/memory/uses "Phase 2" with two other meanings (the move to Payload, the Next.js rebuild).
Proposed fix
Add docs/architecture/ with:
README.md: the target structure (a modular monolith: one folder per business area undersrc/modules/, cross-cutting code insrc/platform/, routes only insrc/app/), the dependency rules, and where each kind of code goes.conventions.md: naming (files, folders, functions, types, tests), module entry files (index.tsclient-safe,server.tsserver-only), when to add an interface, file size limit (250 lines), test placement.glossary.md: business terms defined once (upcoming, past, published, draft, resident, editor, admin, category, cancelled).data-model.md: each Payload collection and global, its key fields, relations, and who may read or write it.decisions/: short records of decisions already made (Turnstile, SMTP via Mailgun, offset paging with no-JS links, no repository layer over Payload).
Fix CLAUDE.md (domain, plugins, email, robot check, link to the architecture docs). Replace HANDOFF.md with a short pointer marked historical. Note in docs/memory/ that "Phase 2" there is historical. Reuse what still applies from draft #100.
The target structure follows the Next.js recommendation of a server-only Data Access Layer for new projects (https://nextjs.org/docs/app/guides/data-security, opens in a new tab) and Martin Fowler's advice to split a growing layered app into domain modules that are layered inside (https://martinfowler.com/bliki/PresentationDomainDataLayering.html, opens in a new tab).
Acceptance criteria
- Not done:
docs/architecture/exists with the five parts above, each short and specific to this repo. - Not done: The data model matches
src/payload-types.tsand the collection configs onmain(every collection and global listed, with its read and write access). - Not done:
CLAUDE.mdhas no stale domain, no uninstalled plugin, and links to the architecture docs. - Not done:
HANDOFF.mdno longer describes Sanity or Vercel as current. - Not done: Docs only: no code changes.
Depends on
Nothing. Step 1 of #127.
Area
frontend, cms
Priority
high
Generated by Claude Code, opens in a new tab