System Architecture Overview
Introduction
Section titled “Introduction”Aether is built on hexagonal architecture (ports and adapters) with strict constitutional governance ensuring maintainability, testability, and long-term system integrity.
Core Principles
Section titled “Core Principles”Hexagonal Architecture
Section titled “Hexagonal Architecture”The system is organized into four distinct layers with clear boundaries:
UI Layer → Application Layer → Core Domain → Infrastructure Layer
- Core Domain: Pure business logic, zero external dependencies
- Application Layer: Orchestrates domain logic for use cases
- Infrastructure: Implements repository interfaces using Prisma
- UI Layer: React components, Next.js pages, tRPC queries
Plugin Isolation
Section titled “Plugin Isolation”Plugins are completely isolated from the web application:
- No direct imports from
apps/web/src - All shared UI from
@aether/ui - Extension-only interface
- Database independence
Data Flow
Section titled “Data Flow”Read Flow
Section titled “Read Flow”User → tRPC query → Application service → Repository interface → Prisma → Database
Write Flow
Section titled “Write Flow”User → tRPC mutation → Application service → Domain entity validation → Repository → Database → Event dispatch
Key Benefits
Section titled “Key Benefits”- Testability: Pure domain logic is easy to test
- Maintainability: Clear boundaries make changes predictable
- Flexibility: Swap infrastructure without touching domain
- Plugin Safety: Isolated plugins cannot break core system
- Long-term Stability: Constitutional rules prevent architectural decay