Architecture Decision Records — ITLab.Template.Next
ADRs são snapshots imutáveis de uma decisão arquitetural. Cada arquivo documenta uma decisão num ponto-no-tempo: contexto, trade-offs considerados, escolha feita, consequências. Quando uma decisão for revisitada ou substituída, não edite o ADR original — abra um novo que aponta para o anterior como Superseded.
ADRs do template (separados dos do DevPack que vivem em ~/.nuget/packages/itlab.template.devpack/{version}/devpack-docs/adrs/):
- ADR-001 — Vertical slices as canonical layout (non-negotiable)
- ADR-002 — English-only identifiers and comments in source code
- ADR-003 — JWT Bearer config-driven authentication (no placeholder gate) — Superseded by ADR-006
- ADR-004 — DB-backed role/permission resolution with IMemoryCache
- ADR-005 —
examples/ships as opt-in reference, not viadotnet newdefault - ADR-006 — Local ASP.NET Identity + dual-scheme (BFF cookie + Bearer JWKS) as default
- ADR-007 — Frontend SPA servido same-origin pela API (monorepo, shadcn/ui)
- ADR-008 — CSRF: anonymous token issuance + authenticated-only gating
- ADR-009 — Multi-tenancy row-level claim-based (hybrid resolution)
- ADR-010 — Membership 1 user → N tenants via
TenantUserjoin + active tenant selection - ADR-011 — Domain/subdomain tenant resolution (opt-in) + host-vs-token cross-check
- ADR-012 — Per-tenant authentication settings (substrate; local provider only for now)
- ADR-013 —
PermissionActionas a first-class entity withIsConsole/IsSystem - ADR-014 — Apply migrations on startup, opt-in per environment
- ADR-015 — Cross-tenant user administration by permission (no host scope) + operational/system permission poles
- ADR-016 — TOTP second factor at sign-in (opt-in)
- ADR-017 — Service callers by registered client certificate (mTLS)
- ADR-018 — Scaffold options as template symbols (
--bff-routes,--hosting) - ADR-019 — Four screen archetypes and one section container (SPA design system) — Superseded by ADR-021
- ADR-020 — Every table in the schema of its domain grouping;
dboholds only__EFMigrationsHistory - ADR-021 — Padrão de UI do Guardian como canon do SPA (Clássico + Portal)
- ADR-022 — Every migration carries its SQL script; DbMigrator ships as a local tool; production applies the scripts
- ADR-023 — Canonical consumption of hierarchical settings
- ADR-024 — User preferences as settings of the
Userlevel - ADR-025 — The migration that drops
TenantSettingsapplies late updates only - ADR-026 — Second factor decided per tenant (settings
Mfa.Mode/Mfa.EnforceFrom; refresh keeps the token's tenant) - ADR-027 — Business time zone and currency per tenant (settings
Business.TimeZone/Business.Currency; the SPA reads them after sign-in) - ADR-028 — Per-tenant e-mail sender (settings
Email.Sender.*/Email.ReplyTo; the account's mail carries its invitation tenant) - ADR-029 — Session lifetime and lockout per tenant (settings
Session.*/Lockout.*; the strictest of the account's tenants locks it) - ADR-030 — Password policy per tenant (settings
Password.*; the strictest of the account's active tenants, never below a fixed floor)
Quando adicionar um ADR:
- Numere sequencialmente (
NNN-slug.md). - Status:
Accepted(default),Superseded by ADR-XXX,Deprecated. - Estrutura: Context → Decision → Consequences → Alternatives considered (opcional).
- Indexe aqui.