System Architecture
The architectural blueprint of SveltyCMS — from the Svelte 5 (Runes) engine to the DB-agnostic adapter pattern.
On this page
This folder explains the engine. It is the right place when you are changing server hooks, content compilation, caching, or tenancy. It is the wrong place to learn the product: that is Concepts, then a guide for the task.
SveltyCMS keeps a short request path for cached reads, compiles collections through ContentSync, and recovers through a state machine (IDLE → READY, or DEGRADED when a dependency is down). The pages below are the detail.
🏗️ Core Engine & Lifecycle
The heart of SveltyCMS — from the reactive Svelte 5 engine to the request processing pipeline.
- ⚙️ Server Hooks & Lanes — O(1) request lane router + READY/SETUP middleware pipeline.
- 🔀 Two-Plane Core — Wire Plane vs Domain Plane: which reads take the compiled fast path, and why it may only decline.
- 🧬 Multi-Core Cluster Design — node:cluster state partition, pub/sub gap, sizing from measured ceilings.
- 🚀 Performance Architecture — Lane table, turbo GET, findPage/count cache, operator guide.
- 🔄 Initialization Workflow — The step-by-step startup process for the CMS.
- 🧪 Self-Healing State — The system’s resilience state machine (IDLE → READY).
- 📁 Code Structure — Directory organization and internal module boundaries.
- 🛡️ Security Overview — Protecting against SSRF, command injection, and CSRF.
🗄️ Database & Data Architecture
Database agnosticism and unified data modeling.
- 📊 Database Adapters — Overview of the unified query abstraction.
- 🍃 MongoDB Implementation — Native Mongoose integration.
- 🔌 PostgreSQL Implementation — Native DDL and Drizzle integration.
- 📦 SQLite (Edge-Ready) — Native Bun driver for local deployments.
- 🧬 Content Type System — Fields, widgets, and schema mapping.
- 📐 Schema Model — Relation ids, ownership, exact columns, actions, and renames. A full-document update stays the durable commit.
- 🪝 Schema Lifecycle Hooks —
resolveInput,validate,beforeOperation,afterOperation, plusbeforeValidate/afterValidateon create and update. - 📬 Transactional Outbox — Atomic events with content mutations + webhook fan-out.
- 📋 Validation & Feedback — Real-time E2E verification logic.
- 📊 Data Operations — Six-domain architecture for config promotion, content packages, migrations, importers, backups, and content sync.
📦 Content & Collections
The modular reconciler and reactive content delivery system.
- 📦 Content System — The modular reconciler, initializer, and reactive polling.
- 🧱 Collection Builder — The UI-driven schema management engine.
- 🧪 Self-Healing State — The system’s resilience state machine (IDLE → READY).
- 🗺️ URL Patterns — Dynamic routing and path resolution strategy.
- 🚀 Compilation Pipeline — Transform path for collection definitions.
🧩 Modularity & Extensions
How SveltyCMS handles widgets, plugins, and custom logic.
- 🧩 Widget Architecture — The 3-pillar strategy (Definition, Input, Display).
- 🔌 Plugin Architecture — The hook-based extension system.
- 🗄️ Plugin Storage — Shared JSON record store (zero per-plugin tables).
- 📦 Media Hub — Storage adapters, AI processing, and focal point management.
- ☁️ Cloud Storage — Integration with AWS S3, Google Cloud, and DigitalOcean.
- 🛒 E-Commerce Overview — Keep core light: opt-in plugin + field/dashboard widgets + gated
/api/commerce(not a store kernel).
🌐 Multilingual & Internationalization
Zero-runtime overhead internationalization using Paraglide JS.
- 🌍 Language Architecture — Multi-locale routing and message compilation.
- 🔤 Data Loading — How translated content is loaded efficiently.
🎨 Frontend & UI System
Design tokens, screen state, and preloading strategies.
- 💎 Aesthetics & Design — Modern UX principles and Tailwind v4 design tokens.
- 🖥️ UI & Screen State — Responsive layout management.
- 💨 Hover Preloading — Sub-millisecond navigation via predictive fetching.
- 🛎️ Toast & Notification — The global user feedback system.
🛡️ Authentication & User Management
Identity, tenancy, and authorization flows.
- 🔐 Authentication System — OAuth, 2FA, and passkey architecture.
- 👥 Multi-Tenancy — Native
tenantIdscoping for physical data isolation. - 🏷️ Tokens & Cache — JWT management and session invalidation.
- 👤 User Overview — Role-based access control (RBAC).
📡 Monitoring & Telemetry
System visibility and performance tracking.
- 📡 Telemetry Ecology — The global health and usage tracking network.
- 📊 Metrics Implementation — Back-end metric collection and reporting.
- 📝 Logger Levels — Level-gated logging: right signal, low cost, no spam.
Next Steps: Review the Request Lifecycle to see how every API call is gated by the 15-stage middleware pipeline.