Skip to content

VGSF CONSTITUTION BOOK II — PART C: PLATFORM ARCHITECTURE
Chapter 4 of 6 in this Part

P4 — Frontend Architecture

Document record
FieldValue
Constitutional SeriesP — Platform Architecture
Source DocumentsFOUNDATION_G9_FRONTEND_ARCHITECTURE.md · FOUNDATION_G8_FRONTEND_EVOLUTION_MODEL.md · FOUNDATION_G8_NAVIGATION_CONSTITUTION.md · FOUNDATION_G8_OBJECT_WORKSPACE_MODEL.md · FOUNDATION_G8_APPLICATION_SHELL_ARCHITECTURE.md · FOUNDATION_G8_DASHBOARD_AND_INTELLIGENCE_MODEL.md · FOUNDATION_G8A_DESIGN_SYSTEM_CONSTITUTION.md — frontend-technology selection in these sources (Astro + React islands) is SUPERSEDED for the ERP by ADR-0003 (Next.js — one app, all audiences); the HTMX + Jinja2 selection (ADR-0002) is itself superseded by ADR-0003; the navigation, workspace, shell, dashboard, and design-system doctrine in these sources remains in force
Source Pathdharma_erp/01_CONSTITUTION/doctrine/G9_CONSTITUTIONAL_TECHNICAL_ARCHITECTURE/ · dharma_erp/01_CONSTITUTION/doctrine/G8_PLATFORM_ARCHITECTURE/ · dharma_erp/01_CONSTITUTION/doctrine/G8A_PLATFORM_COMPLETION/
Version1.0
CertifiedRatified — G8_PLATFORM_CONSTITUTIONALLY_ACCEPTED; G8A_CONSTITUTIONALLY_ACCEPTED (98/100); G9_CONSTITUTIONALLY_ACCEPTED (98/100)
Certifying ProgramConstitutional Architecture Council — G8, G8A, G9 phases
REF DomainN/A — Frontend Architecture Doctrine
Classification TripleN/A — Constitutional Technical Architecture
AmendmentG8A-02 (mobile navigation doctrine); G8A-04 (WORKFLOW-07 AI-augmented); G8A-D04 (Design System Constitution)
Position in BookPart C, Chapter 4 of 6 chapters in this Part

⚠ 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.


P3 established the backend service architecture — the API contract, PROHIB-001, and the service layer that the frontend must consume. P4 now establishes the frontend: the constitutional instrument through which every human actor navigates the domain model, records domain facts, and receives institutional intelligence.


§1 — The Constitutional Frontend Model

The frontend of the Constitutional ERP is not a user interface layer that wraps a backend. It is a constitutional instrument — the means by which the constitutional domain model is made visible and navigable to human actors within the institution.

From this declaration follow five constitutional requirements:

  1. The frontend may not expose data that the actor is not authorized to see. Authorization is enforced at the service layer (PROHIB-001); the frontend must not make API calls outside the actor's authority scope and must not render data received from unauthorized API calls.
  2. The frontend may not expose actions that the constitutional model does not permit. There is no "Delete" button on constitutional records. There is no "bypass approval" option in workflow screens. The UI is constitutionally constrained by the domain model.
  3. The frontend may not modify domain records without an authority grant reference. Every modifying form carries a grant selector (or auto-selects from the actor's active grants). The X-Authority-Grant-ID header is required on every modifying API call.
  4. The frontend may not replace the constitutional domain model with local data structures. There are no "spreadsheet" views that allow users to organize data outside the constitutional schema. All data lives in constitutional domain records.
  5. The frontend must be accessible. Law G8-7 (Navigation Completeness) requires that a user is never lost. Accessibility (WCAG 2.1 AA minimum) is a constitutional requirement: every user, including users with visual, motor, or cognitive differences, must be able to navigate the constitutional instrument.

§2 — The Next.js App Router Architecture: Server Components + Client Components

Next.js (React) App Router is constitutionally selected as the frontend technology for all VGSF digital products (ADR-0003). One Next.js application serves all audiences — ERP staff, donors, auditors, board members, and the public — with rendering strategy differentiated by audience segment and constitutional requirement.

The constitutional appropriateness of this model derives from the recognition that the Constitutional ERP contains fundamentally different rendering situations across its audience segments:

ERP Pages (React Server Components — mandatory): All ERP pages for staff, officers, and administrators use React Server Components. Authorization is enforced on the server before any HTML is produced. The Server Component fetches data from the FastAPI backend using the actor's session credentials, applies the constitutional authority checks via PROHIB-001, and renders HTML on the server. Raw financial records, party data, and domain records never exist as client-side JavaScript state — the Server Component receives authorized data from the API and renders it to HTML before delivery to the browser. This is the strongest constitutional guarantee: the browser receives authority-filtered HTML, not data to be rendered by client JavaScript.

Donor Portal, Audit Portal, Board Portal (React Client Components — interactive sections): Sections of the application requiring rich interactivity — donor dashboards showing giving history with charts, audit data exploration with live filters, board-level intelligence views — are implemented as React Client Components. Client Components receive their initial data from Server Components and use client-side state for local interactivity. The FastAPI backend remains the authoritative data source; Client Components fetch from the API using the actor's JWT. Authorization is enforced at the API layer (PROHIB-001) — never by the Client Component itself.

Public Pages (Static Site Generation — SSG): Public-facing pages (about, programmes, transparency reports, donor landing pages) are statically generated at build time. No constitutional domain records are exposed on public pages without explicit authorization; public pages reference only content approved for public visibility.

The Next.js App Router integrates these three rendering situations in one application:

NEXT.JS APP ROUTER — ONE APPLICATION, ALL AUDIENCES
├── Application Shell (Server Component — renders on server per request)
│   ├── Header bar (entity name, user avatar, notifications) — Server Component
│   ├── Navigation sidebar (links to applications) — Server Component
│   └── Breadcrumb (current location) — Server Component
│
└── Content Area (routing determines rendering strategy)
    ├── ERP pages (/app/*) → React Server Components
    │   ├── Object workspaces → Server Component (auth + data fetch before render)
    │   ├── List views → Server Component (authority-filtered on server)
    │   ├── Audit trail displays → Server Component
    │   └── Report outputs → Server Component
    │
    ├── Portal pages (/portal/*) → Client Components
    │   ├── Donor dashboard → Client Component (interactive charts, giving history)
    │   ├── Audit data exploration → Client Component (live filters, drill-down)
    │   └── Board intelligence view → Client Component (dynamic KPI panels)
    │
    └── Public pages (/public/*) → SSG (statically generated at build time)
        ├── About, programmes, transparency reports
        └── Donor landing pages (no constitutional domain records exposed)

Server-Component Enforcement Rule

Rule 1 — ERP pages MUST use Server Components:
  Authorization is enforced server-side before any HTML is produced.
  Raw financial records never exist as client-side JavaScript state.
  Applies to:
  - All page frames (Application Shell)
  - All object workspace initial renders
  - All list views (Party list, Event list, Document vault)
  - All audit trail, report output, and knowledge article pages

Rule 2 — Client Components are permitted for:
  - Within-portal interactivity (donor dashboard charts, audit data filters)
  - Inline form validation and progressive disclosure
  - Dashboard widgets requiring real-time refresh (polling FastAPI /api/v1/*)
  - Search interfaces requiring instant feedback

Rule 3 — Client Components MUST NOT:
  - Perform authorization decisions independently of the API
  - Cache or store raw domain data in localStorage or sessionStorage
  - Accept domain record IDs from URL parameters without server-side validation

React Server Component Pattern (ERP)

// app/erp/ref001/[partyId]/page.tsx — Server Component
// Runs on the server. No "use client" directive.
// Authorization enforced BEFORE any data is returned from the API.

import { redirect } from 'next/navigation'
import { getServerSession } from '@/lib/auth'
import { fetchAuthorized } from '@/lib/api'

export default async function PartyWorkspacePage({
  params,
}: {
  params: { partyId: string }
}) {
  const session = await getServerSession()
  if (!session) {
    redirect('/login?reason=session_expired')
  }

  // FastAPI enforces PROHIB-001 + RLS (entity GUC + SET ROLE) before returning data.
  // The Server Component receives only authorized, already-filtered domain data.
  const party = await fetchAuthorized(`/api/v1/ref001/${params.partyId}`, session)

  // Rendered to HTML on the server — raw domain data never reaches the browser
  // as JavaScript state; the browser receives authority-filtered HTML.
  return <PartyWorkspace party={party} actor={session.actor} />
}

Client Component Pattern (Portal — interactive sections)

// app/portal/donor/dashboard/page.tsx — Client Component
// "use client" marks this as a Client Component.
// Data is fetched from FastAPI /api/v1/* using the actor's JWT.
// Authorization is enforced by the API (PROHIB-001) — not by this component.

'use client'

import { useState, useEffect } from 'react'
import { useSession } from '@/lib/auth'
import { DonorGivingChart } from '@/components/portal/DonorGivingChart'

export default function DonorDashboard() {
  const { session } = useSession()
  const [givingHistory, setGivingHistory] = useState(null)

  useEffect(() => {
    // FastAPI applies PROHIB-001 + RLS before returning; actor sees only their data
    fetch(`/api/v1/ref007/my-giving-history`, {
      headers: { Authorization: `Bearer ${session.accessToken}` },
    })
      .then(r => r.json())
      .then(data => setGivingHistory(data))
  }, [session])

  return <DonorGivingChart data={givingHistory} />
}

Constitutional distinction — Server Component vs. Client Component: The "data-sovereign ERP content vs. interactive portal section" distinction is realized as React Server Component vs. React Client Component. A Server Component request renders the Application Shell plus content on the server, with authorization enforced before any data reaches the render path. A Client Component section uses the authorized session to call the FastAPI API directly and renders interactivity client-side. In both cases the FastAPI backend enforces PROHIB-001 + RLS as the constitutional authority gate — the frontend enforces nothing independently.


§3 — The Application Shell Architecture

The Application Shell is constitutionally permanent. Law G8-9 declares: "The Application Shell anatomy (Header, Navigation, Breadcrumb, Content Area) is permanent. Technology changes may change the rendering; the shell requirements remain constant."

The shell consists of seven constitutional components (SHELL-01 through SHELL-07):

SHELL-01 — Header Bar

Present on every page. Contains:

  • Entity name and logo
  • Application name (current application)
  • Global search bar (always accessible — Law G8-7)
  • Notification bell (unread count)
  • User avatar (actor's Party name and role)
  • Entity switcher (available at M4+ for federation users)

Constitutional Rule: The header bar is never hidden, even in full-screen content views. A user must always be able to see what entity they are operating within and access global search.

SHELL-02 — Primary Navigation

The left sidebar navigation. Contains links to all 18 constitutional applications the actor is authorized to access. Applications for which the actor holds no authority grant are not displayed (not merely disabled).

Constitutional Rule: Navigation items are rendered server-side. An application that the actor cannot access does not appear in the navigation. This is an additional UI-layer safeguard; the API layer enforces the constitutional authority check regardless of what the navigation displays.

SHELL-03 — Breadcrumb

Displays the current location in the navigation hierarchy. Every breadcrumb item is a clickable link. Format:

[App Name] > [Section] > [Object Type] > [Object Name]
Example:
Registry > Parties > Person > Vrindavana dasa Thakura

Constitutional Rule: Every page has a breadcrumb. A page without a breadcrumb is a constitutional shell violation. Breadcrumbs must accurately reflect the current navigation path and must be consistent with the URL (a bookmarked URL must produce the same breadcrumb).

SHELL-04 — Application Navigation

The secondary navigation within each application. Sections and subsections of the current application. Changes when the actor navigates to a different application.

SHELL-05 — Context Navigation

Filters, grouping controls, and view toggles within list views. Example: "Filter by Lifecycle Status: ACTIVE / ARCHIVED" or "Group by: Department / Pillar". Context navigation does not change the URL; it applies client-side filtering to already-loaded data or modifies the search API call.

SHELL-06 — Content Area

The main content region. Renders either:

  • A list view (for browsing domain records)
  • An object workspace (for viewing and editing a specific record)
  • A dashboard (for intelligence views)
  • A report output (for generated reports)

Constitutional Rule: The content area is always a rendering of constitutional domain data. Free-form content not backed by domain records is not permitted in the content area.

SHELL-07 — Notification Panel

A collapsible panel (slide-in from the right) listing recent notifications. Notifications are displayed in reverse chronological order. Each notification:

  • Links to the domain record it concerns
  • Displays the priority level (P1–P5)
  • Is dismissible (dismissal creates a REF009.C1 interaction record)
  • Is searchable within the panel

Shell Resilience Rules

  • If SHELL-01 (Header) fails to load, the page must display a minimal emergency header with the entity name and a link to the home page
  • If SHELL-02 (Navigation) fails to load, the actor can navigate via breadcrumb and direct URL entry
  • If SHELL-03 (Breadcrumb) fails to load, the URL remains valid for bookmarking
  • No shell component failure must result in a blank page for the actor
  • Shell components are never delivered as client-side partials (they are always part of the server-rendered full-page template, always rendered)

§4 — The Five Navigation Layers

Law G8-7 requires navigation completeness. The constitutional navigation architecture achieves this through five layers:

Layer 1 — Global Navigation: The eight constitutional sections always accessible from the primary navigation sidebar:

  1. Registry (REF001, REF002, REF003)
  2. Finance (REF005, REF007)
  3. Documents (REF006, REF006.X1–X4)
  4. Authority (REF008, REF008.X1–X2)
  5. Operations (REF004, REF010, REF014)
  6. Knowledge (REF013, REF011)
  7. Analytics (dashboards, reports)
  8. Administration (authority grants, registry management, audit)

Layer 2 — Application Navigation: Sections within each of the 18 applications. Example, for APP04 (Finance):

  • Fund Buckets
  • Transactions
  • Obligations
  • Pledges
  • Reports
  • Four-Eyes Queue

Layer 3 — Context Navigation: Filters and grouping within lists. Example, for a Party list:

  • Filter by party_type, lifecycle_status, organization
  • Sort by created_at, name
  • Group by organizational unit

Layer 4 — Object Navigation: Tabs within object workspaces. Described in §5.

Layer 5 — Lifecycle Navigation: Historical state timeline within each object workspace. The History Tab (universal object tab) provides a chronological list of all lifecycle transitions and changes, each linkable by date.

The Breadcrumb Constitution

Canonical pattern:

[Application] > [Section] > [Subsection (if any)] > [Object Type] > [Object Name or ID]

Canonical examples:

Registry > Parties > Person > Vrindavana dasa Thakura
Finance > Fund Buckets > Devotee Welfare Fund
Operations > Events > Temple Programme > Janmasthami 2025
Authority > Grants > EVENT_CREATION_AUTHORITY — Kamala dasi

"Never Lost" Rules:

  1. Every page has a breadcrumb (no exceptions)
  2. Every breadcrumb item is a clickable link
  3. Every object has a permanent, bookmarkable URL (format: /app/{application_code}/{domain}/{record_id})
  4. Global search is always accessible via the header search bar (keyboard shortcut: /)
  5. Browser back button always works (no history manipulation)
  6. Direct URL navigation always works (server renders the correct page for any valid constitutional URL)

Mobile Navigation

G8A-02 establishes the mobile navigation doctrine:

Desktop (>1024px):  Full sidebar navigation (Layer 1 always visible)
Tablet (768–1024px): Collapsible sidebar (toggle via hamburger icon in header)
Mobile (<768px):    Off-canvas navigation (hamburger → full-screen navigation overlay)
                    Layer 1 as off-canvas drawer
                    Layer 4 (object tabs) → horizontal scrollable tab bar
                    Layer 5 (lifecycle) → accordion within History Tab

Constitutional Rule: Mobile navigation must satisfy the same "never lost" requirements as desktop navigation. The hamburger icon must always be visible. The global search must be accessible via a search icon in the mobile header.


§5 — The Universal Object Workspace Model

Every constitutional object — every record in every domain — is presented through a Universal Object Workspace. The structure is constitutionally permanent:

EVERY OBJECT WORKSPACE CONTAINS:
├── Header (name/title, status badge, breadcrumb, action buttons, quick stats)
├── Overview Tab          — Core fields; always first; always default on load
├── Relationships Tab     — REF002 relationships from/to this object
├── History Tab           — Lifecycle timeline; all changes chronologically
├── Documents Tab         — REF006 documents attached to this object
├── Activity Log Tab      — Audit entries; always last; always read-only
└── [Domain-Specific Tabs] — Additional tabs defined by the domain constitution

The Object Header

The workspace header is always visible when an object workspace is open:

[Object Name or Title]                          [Action Buttons: Edit | Submit for Approval | ...]
[Domain Icon] [Object Type] [Lifecycle Status Badge]
[Breadcrumb: Application > Section > Type > Name]
[Quick Stats: created by | created date | version | last modified]

Constitutional Rule: The lifecycle status badge is always visible in the header. No object workspace may hide or minimize the current lifecycle status.

Constitutional Rule: Action buttons are rendered based on the actor's authority grants. An action for which the actor lacks authority does not appear. This is a UI layer safeguard; the API enforces authority regardless.

The Nine Canonical Object Workspaces

WorkspaceDomainDomain-Specific Tabs
Person WorkspaceREF001 (PERSON)Demographics · Contact · Memberships · Roles · Grants Held
Organization WorkspaceREF001 (ORGANIZATION)Profile · Members · Structure · Compliance
Place WorkspaceREF003Location · Events at this Place · Facilities
Event WorkspaceREF004Programme Details · Attendance · Resources Used · Outcomes
Initiative WorkspaceREF014Charter · Projects · Objectives · Indicators · Budget
Project WorkspaceCON-PROJECTScope · Tasks · Budget · Timeline · Deliverables
Case WorkspaceREF010Case Details · Interactions · Services Delivered · Outcomes
Document WorkspaceREF006Content · Approval Status · Versions · References
Knowledge Item WorkspaceREF013Content · Tags · Related Items · Usage Statistics

My Workspace

A special composite workspace — the actor's personal dashboard and task hub:

MY WORKSPACE
├── My Tasks (approval queues, pending obligations, overdue items)
├── My Grants (active authority grants with expiry dates)
├── My Recent Items (last 10 objects accessed)
├── My Notifications (unread, filtered to this actor)
└── My Activity Summary (actions taken in last 30 days)

My Workspace is the default landing page after login for every actor. It is not a domain record; it is a derived view of domain data scoped to the current actor.


§6 — The Five Maturity Stages: Frontend Evolution Model

The constitutional maturity model (Law G8-8) defines what appears at each maturity stage:

Stage M1 — Constitutional Foundation

Required Condition: At least one entity has adopted the Constitutional ERP. REF001, REF002, REF003, REF006, REF008 are partially implemented.

What Appears:

  • Party registration forms (REF001)
  • Relationship recording forms (REF002)
  • Place registration forms (REF003)
  • Basic document upload forms (REF006)
  • Authority grant recording forms (REF008)
  • Simple finance transaction forms (REF007)
  • Party registry list, Document list, Financial transaction list (basic ledger)

What Does NOT Appear: Dashboards (no data density), analytics (not enough history), workflow automation, AI/ML capabilities, federation capabilities.

UI Complexity: Minimal. Forms and lists. Maximum 3 navigation levels. Basic search (name-based only).

Key Milestone: The organization can record its own identity, its parties, and its basic transactions.

Stage M2 — Operational Core

Required Condition: REF004 (Event), CON-PROJECT (Initiative/Project), REF010 (Case), REF009 (Interaction) are operational. At least 3 months of data exists.

What Appears:

  • Personal Dashboard (My Tasks, My Projects, My Cases)
  • Division Dashboard (events this month, active projects, budget utilization)
  • Finance Manager Dashboard (cash position, fund buckets)
  • Approval workflows for Projects and Events
  • Basic notification system (approval requests, due dates)
  • Domain search within each application, basic global search
  • Project utilization report, event attendance report, basic financial reports (cashbook, transaction list), beneficiary reach count

What Does NOT Appear: Longitudinal analytics (need more data history), impact analysis, federation capabilities, AI suggestions.

Key Milestone: The organization can run its operations through the ERP without requiring external spreadsheets for tracking.

Stage M3 — Intelligence Layer

Required Condition: 12+ months of data. REF010 (Case) has longitudinal records. M&E indicators are being recorded. REF013 (Knowledge) has at least 20 items.

What Appears:

  • Trend charts (beneficiary reach over time, event frequency, budget burn rate)
  • Initiative impact scorecard (indicators vs. targets, with trend)
  • Donor lifecycle analysis (giving patterns, lapsed donor detection)
  • Case outcome analysis (how many cases closed with positive outcome)
  • Entity Dashboard (Constitutional Health Score)
  • Pillar Dashboards (all five Pillars)
  • Department Dashboard with KPI progress
  • Historical search (as_of date parameter)
  • Relationship search (graph traversal)
  • Knowledge search (REF013 full-text)
  • Cross-program beneficiary journey report, longitudinal community impact report, governance compliance report, annual impact report

Key Milestone: The organization can make evidence-based decisions using its own historical data.

Stage M4 — Automation and Federation

Required Condition: Multiple entities. Federation infrastructure operational. 2+ years of data.

What Appears:

  • Automated escalation workflows (project overdue → Division Head notified automatically)
  • Automatic compliance calendar reminders (statutory deadlines)
  • Automatic fund bucket alert when balance falls below threshold
  • Automated case review scheduling
  • GPI cross-entity identity resolution interface
  • Federation Dashboard
  • Inter-entity transfer initiation and tracking UI
  • Federation knowledge catalog browser
  • Cross-entity search (with authorization)
  • Predictive budget tracking (burn rate → projected depletion date)
  • Cohort analysis (outcomes for beneficiaries enrolled in same year)
  • Volunteer engagement scoring

Key Milestone: The federation can operate as a coordinated ecosystem rather than disconnected entities.

Stage M5 — Civilizational Intelligence

Required Condition: 5+ years of data. 3+ entities. Federation fully operational. Knowledge catalog rich. M&E data mature.

What Appears:

  • Case worker suggestions (based on similar past cases, what interventions were most effective)
  • Donor next-gift prediction (when is this donor likely to give next, at what amount)
  • Risk detection (which projects are at risk of overrun, based on historical patterns)
  • Knowledge recommendation (you are working on X case type — here are the most relevant knowledge items)
  • Draft generation (AI-assisted drafting of grant reports based on project data)
  • Civilizational Dashboard with multi-decade trends, community transformation indicators, institutional legacy view, generational leadership history
  • Federation AI: cross-entity best practice recommendations, federation impact aggregation with NLP-generated narrative reports

What AI May NEVER Do (applies at all stages, including M5):

  • Make authority decisions (approve a budget, close a case) — AI may suggest, humans must act
  • Create or modify domain records without human authorization
  • Access personal data beyond what the authorizing human can access
  • Override the audit trail

Key Milestone: The organization possesses genuine institutional intelligence — it learns from its own history, across generations.

What Never Changes Across All Five Stages

Regardless of maturity stage, the following are constitutionally permanent from M1:

  1. The Application Shell — same permanent frame
  2. The Navigation Constitution — same five-layer navigation
  3. The Object Workspace Model — same universal object structure
  4. The Audit Architecture — every action always logged, from Day 1
  5. The Lifecycle Preservation Doctrine — nothing is ever deleted
  6. The API Constitution — same grammar, extended as needed
  7. The Registry Governance Model — same controlled vocabularies

§7 — The Eight-Tier Dashboard Hierarchy

The constitutional intelligence architecture is organized around A1's four questions, answered at eight tiers:

A1's Four Questions (applicable at every dashboard tier):

  1. What is the status of our work right now?
  2. Are we achieving our objectives?
  3. Where are we at risk?
  4. What needs my attention today?

The Eight Dashboard Tiers

DASH-01 — Personal Dashboard (My Workspace):
Scope: The individual actor. Content: My tasks, my pending approvals, my authority grants (with expiry warnings), my recently accessed objects, my notifications.

DASH-02 — Role Dashboard:
Scope: The actor's institutional role (Department Head, Finance Officer, Case Worker). Content: Role-relevant KPIs, pending approvals for this role, role-specific queue.

DASH-03 — Division Dashboard:
Scope: One organizational Division. Content: Division events this month, active projects, budget utilization for division programs, division staff overview.

DASH-04 — Department Dashboard:
Scope: One organizational Department. Content: Department KPIs vs. targets, all divisions summary, budget position, compliance calendar.

DASH-05 — Pillar Dashboard:
Scope: One of five organizational Pillars (Governance, Resources, Mission, Support, Development). Content: Pillar programs summary, cross-department impact indicators, pillar budget overview.

DASH-06 — Entity Dashboard (Constitutional Health Score):
Scope: The entire entity. Content: Constitutional health metrics (REF008 grants coverage, audit trail completeness, obligation fulfillment rate, knowledge base growth), entity-wide financial position, initiative portfolio summary.

DASH-07 — Federation Dashboard (M4+):
Scope: All federation member entities. Content: Federation-wide impact aggregation, inter-entity cooperation summary, federation knowledge catalog highlights, cross-entity resource sharing.

DASH-08 — Civilizational Dashboard (M5):
Scope: Multi-decade institutional arc. Content: Generational leadership history, community transformation indicators, multi-decade trend analysis, institutional legacy metrics.


§8 — The Design System Constitution

The Design System Constitution establishes the visual grammar of the Constitutional ERP. Established as G8A-D04.

Typography Hierarchy (Eight Levels)

LevelRoleConstitutional Usage
T1 — DisplayPage titles in marketing or cover contextsNot used in application UI
T2 — H1Application section headingsOnce per page maximum
T3 — H2Major section headings within a workspaceEach major section
T4 — H3Subsection headingsWithin sections
T5 — H4Component headingsWithin cards, panels
T6 — Body LargePrimary body textMain content
T7 — BodyStandard body textDefault text
T8 — CaptionSupporting text, metadata, labelsLabels, timestamps

Constitutional Type Scale: 12 / 14 / 16 / 20 / 24 / 32 / 40 / 48px (ratio: approximately 1.25)

Spacing Doctrine

Base unit: 4px. All spacing values are multiples of 4px:

:root {
  --space-1:  4px;   /* Tight spacing within components */
  --space-2:  8px;   /* Component internal padding */
  --space-3: 12px;   /* Between related elements */
  --space-4: 16px;   /* Standard component padding */
  --space-5: 20px;   /* Between components */
  --space-6: 24px;   /* Section spacing */
  --space-8: 32px;   /* Major section spacing */
  --space-10: 40px;  /* Page section spacing */
  --space-12: 48px;  /* Large spacing (hero sections) */
}

Constitutional Rule: No spacing value may be defined outside the 4px grid. Values like 5px, 7px, 15px, 22px are constitutionally prohibited. If a design requires 15px, it uses 16px (4×4).

Grid Doctrine

12-column grid
Six breakpoints:
  xs:  320px   (minimum supported screen width)
  sm:  480px   (large mobile)
  md:  768px   (tablet)
  lg: 1024px   (desktop)
  xl: 1280px   (large desktop)
  2xl: 1536px  (wide desktop)

Maximum content width: 1280px (centered on larger screens)

Color Doctrine

Lifecycle Status Colors — Constitutionally Frozen:
These colors must not be changed. They are constitutional tokens that carry institutional meaning across all maturity stages, all future technology generations, and all federation members.

:root {
  /* Lifecycle Status Colors — FROZEN — do not change */
  --status-active:      #22c55e;   /* Green — ACTIVE lifecycle status */
  --status-inactive:    #94a3b8;   /* Slate — INACTIVE */
  --status-archived:    #64748b;   /* Darker slate — ARCHIVED */
  --status-historical:  #475569;   /* Dark slate — HISTORICAL */
  --status-suspended:   #ef4444;   /* Red — SUSPENDED */
  --status-pending:     #f59e0b;   /* Amber — PENDING_APPROVAL */
  --status-draft:       #6366f1;   /* Indigo — DRAFT */
}

Constitutional Rule: Status colors are constitutional tokens. They may not be overridden by entity branding or theme customization. Status color consistency is required across all federation members; a user moving between entity dashboards must always be able to identify ACTIVE (green) and SUSPENDED (red) records without re-learning the color scheme.

Pillar Accent Colors:

:root {
  --pillar-governance:  #6366f1;   /* Indigo — Governance Pillar */
  --pillar-resources:   #22c55e;   /* Green — Resources Pillar */
  --pillar-mission:     #f59e0b;   /* Amber — Mission Pillar */
  --pillar-support:     #06b6d4;   /* Cyan — Support Pillar */
  --pillar-development: #ec4899;   /* Pink — Development Pillar */
}

Constitutional Rule: Pillar accent colors may be used as secondary accents in pillar-specific dashboard sections. They are not used as status indicators.

Object Visual Grammar

Every constitutional object card (list view) follows the same visual grammar:

┌─────────────────────────────────────────────────────────────┐
│ [Domain Icon]  [Object Title]              [Status Badge]    │
│ [Object Type label]  [Key Metric 1]  [Key Metric 2]         │
│ [Secondary info line: created by | date | version]           │
└─────────────────────────────────────────────────────────────┘

Form Visual Grammar

Constitutional forms follow a universal grammar:

Label (required — annotated with *)
Input field (with placeholder showing expected format)
Help text (constitutional context — what this field means, constitutional reference)
Validation message (shown only on error, always descriptive)

Constitutional Rule: Help text in constitutional forms must reference the constitutional meaning of the field. Example: for the basis_document_id field, help text reads: "The REF006 document that authorizes this action (Law G8-5). Required for all authority-bearing records." This reinforces constitutional literacy for every actor using the system.

Accessibility Doctrine

WCAG 2.1 AA minimum (target: AAA for high-use paths)
Keyboard navigation: all interactive elements reachable via Tab; focus indicators visible
Screen reader: semantic HTML; aria-labels on icon buttons; role attributes on custom widgets
Color contrast: minimum 4.5:1 for body text; 3:1 for large text and UI components
Motion: prefers-reduced-motion media query honored for all animations

Constitutional Rule: The Constitutional ERP must be fully operable by keyboard alone. A user who cannot use a mouse must be able to record a financial transaction, approve a workflow, and search for a party record using only the keyboard.

Component Library Structure

vgsf_frontend/
├── app/                          # Next.js App Router pages
│   ├── erp/                      # ERP pages — React Server Components
│   │   ├── ref001/[partyId]/page.tsx     # Party workspace (Server Component)
│   │   ├── ref004/[eventId]/page.tsx     # Event workspace (Server Component)
│   │   └── ...
│   ├── portal/                   # Portal pages — Client Components (interactive)
│   │   ├── donor/dashboard/page.tsx      # Donor dashboard (Client Component)
│   │   └── audit/explore/page.tsx        # Audit explorer (Client Component)
│   └── public/                   # Public pages — SSG
│       ├── about/page.tsx
│       └── transparency/page.tsx
│
├── components/
│   ├── constitutional/           # Base constitutional React components
│   │   ├── ObjectCard.tsx         # Universal object card (Server Component)
│   │   ├── ObjectWorkspace.tsx    # Universal workspace shell (Server Component)
│   │   ├── BreadcrumbBar.tsx      # Navigation breadcrumb (Server Component)
│   │   ├── StatusBadge.tsx        # Lifecycle status badge (frozen colors)
│   │   ├── ConstitutionalForm.tsx # Form wrapper with authority grant selector
│   │   └── LifecycleTimeline.tsx  # History tab (Client Component — interactive)
│   ├── domains/                  # Domain-specific React components
│   │   ├── ref001/
│   │   │   ├── PartyCard.tsx
│   │   │   └── PartyWorkspace.tsx
│   │   └── ...
│   ├── shell/                    # Application Shell components (Server Components)
│   │   ├── Header.tsx
│   │   ├── PrimaryNav.tsx
│   │   ├── BreadcrumbBar.tsx
│   │   └── NotificationPanel.tsx  # Client Component (polling /api/v1/notifications)
│   └── dashboards/               # Dashboard widget components
│       ├── PersonalDashboard.tsx  # Server Component (initial render)
│       ├── FinanceSummary.tsx     # Client Component (real-time refresh)
│       └── ConstitutionalHealthScore.tsx  # Server Component

Component Doctrine (Five Rules)

Rule 1 — ERP Pages Use Server Components; No Client-Side Domain Data Fetching for ERP: ERP pages are React Server Components. Authorization is enforced on the server before any data is returned from the FastAPI backend. Client Components are permitted for portal-section interactivity and real-time dashboard widgets; in those cases, data is fetched directly from the FastAPI API using the actor's JWT, and PROHIB-001 enforcement at the API layer is the constitutional authority gate. There is no path by which raw ERP domain data (financial records, party data, authority grants) is fetched and rendered client-side without first passing through the FastAPI authorization layer.

Rule 2 — No Domain Logic in Components: Components render data; they do not compute business logic. A component that calculates a financial balance is unconstitutional. Balances are computed by the service layer and returned in the API response.

Rule 3 — No Authorization Decisions in Components: A component does not decide whether to show a button based on its own understanding of authority. It renders buttons for actions that the API response indicates are available for the current actor.

Rule 4 — All Text Through i18n Keys: No hardcoded English text in components. All user-facing text passes through the internationalization (i18n) layer. This supports multi-language deployment at M4+ without component rewrites.

Rule 5 — Status Badge is Constitutional: The lifecycle status badge renders using the constitutionally frozen status colors. No component may override the status color based on application context.


Constitutional Colophon — P4
This chapter establishes the frontend architecture of the Constitutional ERP: Next.js App Router (ADR-0003) — one application for all audiences — as the constitutional frontend technology, with React Server Components for data-sovereign ERP pages (authorization enforced server-side before any HTML is produced; raw financial records never exist as client-side JavaScript state), React Client Components for interactive portal sections (donor dashboard, audit data exploration), and Static Site Generation for public pages; the application shell anatomy (SHELL-01 through SHELL-07); the five-layer navigation doctrine and the "never lost" rules; the Universal Object Workspace with nine canonical workspace types; the five maturity stages governing what frontend capabilities appear when; the eight-tier dashboard hierarchy from Personal to Civilizational; and the Design System Constitution with frozen lifecycle status colors, typography hierarchy, spacing doctrine, and accessibility requirements.
It operates within Part C under Laws G8-7 (Navigation Completeness), G8-8 (Maturity Discipline), and G8-9 (Shell Permanence): the shell is permanent, the navigation always reveals location, and capabilities appear only when their constitutional maturity conditions are satisfied.
Readers proceeding to P5 — Security and Authority Architecture should carry forward: the frontend is a constitutional instrument, not a security perimeter — all security decisions are made by the service layer (P3, PROHIB-001) and the database layer (P2, RLS); the frontend enforces nothing on its own, and its constitutional obligation is to render faithfully what the authorized API returns.


Test Dharma ERP and tell us what you find.

The trial uses sandboxed demo data across twelve core modules. Look around, try the forms, and review what works and what does not.