Skip to content
SprecherEast
Issue 128

documentation: Architecture map, conventions, glossary and data model; fix stale docs

Back to our plan
Done
documentationfrontendcmspriority: high

Type

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.md names sprecher-east.org as the live domain (it is sprechereast.com, see #105), lists a payload-oauth2 plugin that isn't installed, and doesn't mention the SMTP email adapter or the Turnstile robot check.
  • HANDOFF.md describes 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:

  1. README.md: the target structure (a modular monolith: one folder per business area under src/modules/, cross-cutting code in src/platform/, routes only in src/app/), the dependency rules, and where each kind of code goes.
  2. conventions.md: naming (files, folders, functions, types, tests), module entry files (index.ts client-safe, server.ts server-only), when to add an interface, file size limit (250 lines), test placement.
  3. glossary.md: business terms defined once (upcoming, past, published, draft, resident, editor, admin, category, cancelled).
  4. data-model.md: each Payload collection and global, its key fields, relations, and who may read or write it.
  5. 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.ts and the collection configs on main (every collection and global listed, with its read and write access).
  • Not done: CLAUDE.md has no stale domain, no uninstalled plugin, and links to the architecture docs.
  • Not done: HANDOFF.md no 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

See it on GitHub, opens in a new tab