Part C — Platform Architecture: Introduction
⚠ STACK-DECISION CURRENCY BANNER — ADR-0003 (supersedes ADR-0002), Primary Steward verdict, 2026-06-26.
Frontend: Next.js (React) — one app, all audiences. ERP pages: Server Components (data-sovereign). Donor/Audit/Board: Client Components. Public: SSG. Backend: FastAPI · PostgreSQL · asyncpg raw SQL, no ORM (Backend Option D). Source of truth:03_PLATFORM/docs/decisions/ADR-0003-Greenfield-Stack-Decision.md.
§I — The Foundation
Every constitutional domain model requires an operational substrate. The thirteen base domains and eight certified extensions that constitute VGSF's institutional ontology are, in themselves, technology-agnostic: they describe categories of reality — Person, Place, Event, Obligation, Authority — not database schemas or API endpoints. But constitutional trustworthiness is not established by doctrine alone. It is established by doctrine made computationally real: by the platform decisions that determine where domain records live, how they are protected from deletion, how authority is enforced before any action executes, and how the institution's data remains sovereign across the full arc of the institution's life.
Part C of Book II concerns those platform decisions. Not as information technology preferences, and not as implementation details delegated to engineers at the moment of system construction, but as constitutional commitments — choices ratified by the Constitutional Architecture Council and binding on every implementation, every domain, and every future technology generation. When the G8 Platform Architecture declared that no domain record may ever be deleted [P1.§3.Law G8-2], this was not a data governance policy: it was a constitutional act, with the same force as any provision of the Foundational Constitution. When G9 declared PostgreSQL as the constitutionally mandated database [P2.§1], it was not selecting a product from a procurement catalogue: it was determining that the conservation laws enforced by database triggers and the entity sovereignty enforced by Row-Level Security are the only technically verifiable implementations of constitutional invariants that no application-layer approach can match.
The difference between a platform preference and a platform commitment is precisely the difference between "PostgreSQL is our database" and "PostgreSQL is our constitutional substrate." A preference may be revised whenever a more convenient alternative appears. A commitment may only be changed through an explicit, Primary Steward-authorized constitutional program that demonstrates — by evidence — that the replacement satisfies all constitutional requirements at equivalent or greater maturity. The entire body of doctrine consolidated in Part C has this force of commitment. It was not assembled from engineering opinion. It was produced by constitutional architects, subjected to adversarial audit by independent tribunals [P1.§5], and ratified by the Primary Steward.
§II — The Architecture
Part C covers six chapters, corresponding to the six constitutional platform layers on which the domain model operates.
Chapter P1 (Constitutional Platform Philosophy) establishes the foundational declarations: the platform supremacy principle, the ten constitutional platform laws (G8-1 through G8-10), the technology independence doctrine, and the G8–G8A–G9 doctrine lineage that produced the complete platform architecture. P1 is the philosophical ground from which all subsequent chapters derive their authority.
Chapter P2 (Database Architecture) establishes PostgreSQL as the constitutional substrate. It specifies the schema isolation model (one PostgreSQL schema per domain: ref001, ref002, and so on), the Row-Level Security architecture that enforces entity data sovereignty at the database layer, the append-only ledger doctrine that supports domain conservation invariants, the no-delete trigger that fires for every session including direct database access, and the registry governance model for controlled vocabularies.
Chapter P3 (Backend Service Architecture) establishes the service and API layer — the constitutional contract between the database and any consumer. The foundational doctrine here is PROHIB-001: authority checks are performed at the API middleware layer, never in application code. P3 specifies the Hybrid Constitutional Architecture (Modular Monolith with Domain Modules, Internal Event Bus, and Federation Adapter Layer), the FastAPI implementation reference, and the search and workflow doctrine.
Chapter P4 (Frontend Architecture) establishes the user-facing constitutional layer. The constitutional UI model declares that the UI is a constitutional instrument: it may not expose data or actions that violate the domain model. P4 specifies the Next.js App Router architecture (React Server Components for ERP pages — authorization enforced server-side before any HTML is produced; raw financial records never exist as client-side JavaScript state; Client Components for interactive portal sections; SSG for public pages — selected for all VGSF digital products per ADR-0003, superseding the prior HTMX + Jinja2 model of ADR-0002), the object workspace model (every constitutional object has a workspace with universal tabs), the five-layer navigation doctrine, the application shell anatomy, the dashboard and intelligence model, and the design system constitution.
Chapter P5 (Security and Authority Architecture) establishes the authority and accountability layer. AGBAC (Authority-Grant-Based Access Control), the Four-Eyes Doctrine for financial transactions, the PROHIB-001 enforcement implementation, the authentication architecture, the audit and traceability architecture, the AI governance constitution, and the adversarial audit findings that tested and confirmed the platform's constitutional soundness — all are established here.
Chapter P6 (Deployment Architecture) establishes the infrastructure doctrine that makes the platform operational and reproducible. The five deployment levels (M1 through M5), the data sovereignty model, the disaster recovery doctrine, the field office support model, the federation deployment topology, and the constitutional rule that deployment architecture must be self-hostable and must match organizational maturity — these constitute the platform's operational constitution.
§III — Why This Matters
The failures that result from the absence of constitutional platform doctrine are not hypothetical. The G0 historical ERP analysis identified them in VGSF's own operational history: duplicate party records because no unified identity substrate existed, test records polluting production data because no lifecycle governance was in place, financial transactions without audit trails because no append-only audit architecture had been constituted, governance decisions without authority chains because no REF008 grant model was enforced at any system layer. These are the direct consequences of building applications without constitutional platform commitments.
Without PROHIB-001 — the requirement that authority checks execute at the API middleware layer and nowhere else — authorization logic scatters into application code across every module, every screen, every workflow. In that scattered condition, it is untestable (no single point at which authority enforcement can be verified), undiscoverable (no constitutional mechanism for confirming that a given action requires a given grant), and inconsistent (different developers implement different interpretations of the same authority requirement). The adversarial audit [P5.§7] confirmed that no alternative placement of authority enforcement satisfies the constitutional verifiability requirement.
Without the append-only ledger doctrine, the REF005.S1 conservation invariant — balance = Σ(recorded transitions) — cannot be maintained. If records can be deleted, the ledger cannot be reconstructed, and the invariant cannot be proven to hold. The domain model's most formally significant achievement, the Resource conservation law, depends entirely on the platform's commitment to append-only permanence.
Without the Four-Eyes Doctrine [P5.§4], financial transactions above threshold lack the separation of duties that makes VGSF's donor stewardship obligation computationally real. Without deployment doctrine [P6], the platform exists only locally, cannot be institutionally replicated, cannot survive hardware failure within the constitutional RPO and RTO commitments, and cannot evolve from a single-entity deployment to a global federation without a rebuild that risks historical data loss.
§IV — Key Constitutional Decisions
1. Why PostgreSQL, not an ORM abstraction or an alternative database. The constitutional requirements — Row-Level Security for entity sovereignty, database-level triggers for no-delete enforcement, pgaudit for database-level audit capture, schema namespacing for domain boundary enforcement, and ACID transactions for cross-domain atomic operations — cannot be satisfied simultaneously by any other evaluated database technology. CockroachDB scored 58/100 against these criteria; PostgreSQL scored 99/100 [P2.§7]. The constitutional verdict is not a performance preference: it is a determination that the five constitutional requirements can only be jointly satisfied by PostgreSQL. This law may be amended only by the Constitutional Architecture Council with evidence that a replacement satisfies all five requirements at equivalent maturity [P1.§2.Law G9-1].
2. Why PROHIB-001: authority at the API layer, not the application layer. Authorization logic embedded in application code produces three constitutional failures: it is untestable (no single point of enforcement can be verified), undiscoverable (there is no authoritative inventory of which actions require which grants), and inconsistent (each developer produces a different implementation of the same requirement). The constitutional solution — require_authority() called as the first operation in every service method that modifies domain data, before any database operation — is the only arrangement that is universally verifiable, discoverable through code review, and consistent across all domains [P3.§6].
3. Why AGBAC over RBAC. Role-Based Access Control assigns static role labels to users and grants access based on role membership. Authority-Grant-Based Access Control (AGBAC) assigns specific, scoped, temporally bounded, document-backed authority grants to specific Parties. The constitutional requirements — authority grants must expire and be renewed [P5.§2], must carry a basis document [P5.§2], must be revocable immediately [P5.§3], and must produce an immutable grant record linking every action to a specific constitutional authorization — cannot be satisfied by RBAC. AGBAC is not a more complex version of RBAC: it is the technical expression of REF008 (Authority Domain), which is itself a certified constitutional domain. Authority in VGSF's constitutional model is a first-class institutional reality, not a configuration setting [P5.§1].
4. Why append-only ledgers: the permanence doctrine. The constitutional prohibition on deletion [P1.§3.Law G8-2] is not a backup policy. It is the computational expression of institutional permanence: the commitment that the domain records of 2025 will be readable by a leader in 2075 with the same fidelity as they carry today. This commitment is enforced at three levels — the database trigger that raises an exception for any DELETE statement on a constitutional table [P2.§5], the application-level soft-delete guard that permits only lifecycle transitions to ARCHIVED or HISTORICAL [P3.§5], and the append-only audit log protected by Row-Level Security from any UPDATE or DELETE [P5.§5]. The conservation law, the historical replay architecture, and the civilizational audit capability all depend on this three-layer permanence enforcement.
5. Why the Four-Eyes Doctrine: financial protection as constitutional ground. The Four-Eyes Principle — that no person may approve, execute, record, and audit the same financial transaction — is derived from the A3 stewardship obligation and is enforced at the service layer, not the UI layer or the API layer [P5.§4]. The service-layer placement is constitutional: it ensures that the check fires regardless of how a request arrives — through the UI, through a direct API call, through a background job, or through a migration script. Financial authority above threshold requires that the approver's Party ID differs from the recorder's Party ID; the system raises ConstitutionalFourEyesViolation if this condition is not satisfied. This protection is not a workflow preference: it is the computational expression of REF008's authority separation requirement applied to the financial domain.
§V — Bridge Forward
Part C establishes the constitutional substrate on which VGSF's domain model operates: the database that enforces conservation laws, the API layer that enforces authority, the frontend that presents the domain model as a constitutional instrument, the security architecture that governs who may do what, and the deployment doctrine that makes the entire platform operational and reproducible. Every certified domain — REF001 through REF014, and their eight certified extensions — operates within the platform that Part C constitutes.
Part D (Module Architecture) establishes what runs on this platform: the 56-module application architecture planned for deployment on the constitutional substrate. Where Part C answers "on what does the institution run?", Part D answers "through what applications does the institution operate?" — the programs, workflows, services, and capabilities that translate the constitutional domain model into the daily operational life of the Vaishvika Gauranga Samaja Foundation.
Compiled by CAP-BOOK2-001 (R-ARCH) — 2026
