Understand architecture and extension contracts
Strukt uses one Doc v2 tree as the authoring source of truth. Visual panels and HTML code edit that document through the document store. Server persistence, publication rendering and plugins have separate interfaces so changes can be validated at the correct boundary.
Before you start
Section titled “Before you start”- Read the repository’s architecture and working agreements before editing. Distinguish an internal browser API from a supported external integration contract.
-
Put document shapes in model/contracts and derive TypeScript types from the checked TypeBox schemas. Keep model and serialization logic DOM-free except the injected parse touchpoint. Preserve text, comments, stable IDs and authored head order.
-
Route document mutations through the document store. React reads its projection; do not mutate a Doc returned by a hook. Keep page content, editor preferences and personal layout storage in their respective modules.
-
Use async DbClient operations and transaction callbacks for server persistence so SQLite and PostgreSQL share the same behavior. Validate Host before routing and keep tenant authorization at every resource boundary.
-
For extensions, use the documented plugin manifest/bridge instead of importing private server internals. Existing authenticated
/apiroutes are internal application contracts: they do not imply a public stable SDK or cross-tenant browser access. Test a proposed change through its real boundary.
Check the result
Section titled “Check the result”- The change has one clear owner and passes the relevant architecture, authorization and behavior checks.
Troubleshooting
Section titled “Troubleshooting”If an extension needs a capability the bridge does not expose, design that interface explicitly rather than granting filesystem, database or unrestricted network access inside a route.
Related guides
Section titled “Related guides”Applies to Strukt c02552848c92 · 2026-10-31