Site — the module and its seams

Site — the module and its seams An architecture diagram generated by Archify. none · site.Deps{} is empty · Deps · other modules' contracts/ · Deps none site.Deps{} is empty Deps admin · native shell · screens.Mount per Resource · consumers · consumer admin · native shell screens.Mount per Resource consumer contracts/ · Service · SiteSettings · 1 event · 1 permission · modules/site contracts/ · Service SiteSettings · 1 event · 1 permission module.go · Module(Deps{}) · rest.Singleton · Nav · modules/site module.go Module(Deps{}) · rest.Singleton · Nav internal/ · Service: Settings · Save · same · publish · modules/site internal/ Service: Settings · Save · same · publish rest.Singleton.Mount · /api/v1/site/settings · GET · PUT · /public · kit/ seams rest.Singleton.Mount /api/v1/site/settings · GET · PUT · /public admin screens · admin: /admin/site/settings · kit/ seams admin screens admin: /admin/site/settings events · site.settings_updated · Save, on change · kit/ seams events site.settings_updated · Save, on change jobs · none · kit/ seams jobs none migrations/000018_site · site_settings · FORCE RLS · kit/ seams migrations/000018_site site_settings · FORCE RLS Singleton · Events NewService Routes: settings.Mount crud over Tx[Tenant] events.Publish Jobs: nil Resource Deps{} api.Resources() modules/site kit/ seams Deps · other modules' contracts/ consumers Legend Frontend Backend Database Message bus

Promises

  • • site:manage guards the read, the PUT, the screens and the nav entry; GET …/public asks for nothing, answers Title, Nav, Theme
  • • site.settings_updated from Save, on the first save and on a change, in the caller's transaction; saving the same says nothing

Needs

  • • Deps is empty: a site carries its tenant id, which row-level security matches on; configuration: none
  • • Load answers the defaults (theme system, #2563eb) rather than a 404; a PUT replaces the whole row and crud.Reset drops its id

Proof

  • • contracts/sitetest: the fake and the real service pass one suite; internal tests: one row per tenant, the event with its change
  • • module_test: GET and PUT and nothing else; the public face carries no tagline, slug or colour; no browser journey