Vitruvyan Docs
Web UI — Overview
Last updated: Mar 11, 2026 11:30 UTC
Status: ✅ Foundation Complete
Location:vitruvyan-core/ui/
Introduction
The Vitruvyan Web UI is a domain-agnostic interface framework built on the principle of adapter-driven UX. Inspired by the Mercator UI Constitutional architecture, it separates cognitive backend state from visual representation through a strict contract system.
Philosophy
The UI follows 17 constitutional principles established in the Costituzione UI:
- Separation of Thought and Visualization — Backend computes, UI visualizes
- Adapter as UX Unit — Each conversation type has a dedicated adapter
- Renderer Stability — Infrastructure components are feature-blind
- Components as Tools — No business logic in visual primitives
- Explainability as Domain — VEE (Vitruvyan Explainability Engine) is first-class
!!! quote "Article II — The Adapter is the UX Unit" "Each conversation type (intent classification) must correspond to a dedicated adapter that knows how to transform backend cognitive state into narrative, evidence, and explainability."
See Philosophy for complete constitutional text.
Architecture Pattern
Three-Layer Contract System
| Layer | Purpose | Contract |
|---|---|---|
| UIContract | Canonical payload structure | UIResponsePayload interface |
| AdapterContract | Backend state → UI transformation | BaseAdapter abstract class |
| DomainPluginContract | Domain extension mechanism | DomainPluginRegistry |
See Contracts for detailed interface documentation.
Stack & Technology
| Category | Technology | Version |
|---|---|---|
| Framework | Next.js (App Router) | 15.1.7 |
| UI Library | React | 18.3.1 |
| Component Library | Radix UI | Latest |
| Styling | Tailwind CSS | 3.4.x |
| Type System | TypeScript | 5.x |
| Icons | lucide-react | Latest |
See Stack for complete technology breakdown.
Core Components
Chat Module
Domain-agnostic chat orchestration:
- Chat.jsx (183 LOC) — Main orchestrator
- ChatMessage.jsx (145 LOC) — Message renderer
- ChatInput.jsx — Input with validation
- DocumentUpload.jsx — Attach documents to messages (see Long Context)
- MessageFeedback.jsx — Thumbs up/down (see Plasticity)
- ThinkingSteps.jsx — Backend reasoning display
Response Infrastructure
Canonical rendering layer:
- VitruvyanResponseRenderer.jsx (336 LOC) — Main renderer
- EvidenceSectionRenderer.jsx — Evidence accordion builder
- Fixed render flow: Narrative → Follow-ups → Accordions → VEE
Composites
Reusable narrative blocks:
- NarrativeBlock — Markdown + VEE annotations
- EvidenceAccordion — Collapsible evidence sections
- FollowUpChips — Interactive follow-up suggestions
- IntentBadge — Intent classification display
Explainability (VEE)
Three-level stratification:
- Technical — For engineers (5-15s read)
- Detailed — For analysts (30-60s read)
- Contextualized — For domain experts (120-180s read)
Adapter System
Adapters transform backend state into UI-compatible payloads.
Base Adapter
All adapters extend BaseAdapter from contracts/AdapterContract.ts:
Adapter Registry
Domain Plugin System
Domains extend the UI without modifying core code:
See Contracts for plugin interface details.
Quick Start
1. Install Dependencies
2. Configure Environment
Required variables:
3. Run Development Server
Open http://localhost:3000.
4. Create an Adapter
5. Register Adapter
Design System
Tokens
Centralized design tokens in components/theme/tokens.js:
Typography
- Font: Inconsolata (monospace)
- Weights: 400 (regular), 600 (semi-bold), 700 (bold)
Components
Built on Radix UI primitives:
- Accordion
- Dialog
- Tooltip
- Tabs
File Structure
Current Status
| Component | Status | Lines |
|---|---|---|
| Contracts | ✅ Complete | 820 |
| Chat Module | ✅ Complete | ~500 |
| Document Upload | ✅ Complete | ~100 |
| Plasticity Feedback | ✅ Complete | ~150 |
| Renderer | ✅ Complete | ~600 |
| Composites | ✅ Complete | ~400 |
| Explainability | ✅ Complete | ~300 |
| Adapters (examples) | ✅ Complete | 290 |
| Documentation | ✅ Complete | 1,040 |
Total: 42 files, ~5,650 lines of code
Next Steps
Week 1
- Create finance domain plugin (
vitruvyan_core/domains/finance/ui/) - Test chat module with conversational adapter
- Add shadcn/ui primitives (Button, Input, Accordion)
Month 1
- Create energy domain plugin
- TypeScript configuration (tsconfig.json)
- Test suite (Jest + React Testing Library)
Quarter 1
- Build facility vertical UI
- Performance optimization (virtualization, lazy loading)
- Accessibility audit (WCAG 2.1 AA)
- Storybook component documentation
References
- UI Philosophy — Constitutional principles
- Contracts — TypeScript interface documentation
- Stack — Technology breakdown
- UI README — Complete technical guide
- Costituzione UI — 17 articles (Italian)
- Setup Report — Implementation details
Contributing
When working on the UI:
- Read the Constitution — Understand the 17 immutable principles
- Use adapters — Never add business logic to components
- Respect contracts — All payloads must match
UIResponsePayload - Test adapters — Unit test every adapter's
map()function - Document VEE — Every feature needs 3-level explainability
Last updated: Feb 20, 2026 21:00 UTC