How sitewright-cms/sitewright works
Sitewright is a self-hosted agency website platform: developers author code-first sites, clients edit content in a live preview, and teams publish static sites. Its main workflow runs from the editor through the API and project content into preview/build and deployment. Separate capabilities include AI authoring, MCP access, importing existing sites, CMS data, media, and interactive site components. The graph follows documented capabilities and visible imports; unsampled implementation details are represented only where the README establishes the relationship.
Main entry points: Project.tsx Project editor · build.ts Static site build · app.ts API server · content.ts Project content
Components 25
Authoring and CMS
- Editor application
apps/editor/src/App.tsx - Project editor
apps/editor/src/views/Project.tsx - Dataset manager
apps/editor/src/views/DatasetManager.tsx - Editor API client
apps/editor/src/api.ts - Entry editing
apps/editor/src/lib/entry-form.ts - Project events
apps/editor/src/lib/use-project-events.ts - Dialog UI
apps/editor/src/views/ui/Dialogs.tsx - Modal UI
apps/editor/src/views/ui/Modal.tsx - Tooltip UI
apps/editor/src/views/ui/Tooltip.tsx
Platform API and data
- API server
apps/api/src/http/app.ts - Project content
apps/api/src/repo/content.ts - Platform database
apps/api/src/db/schema.ts - Media storage
apps/api/src/media/storage.ts - Site import
apps/api/src/import/crawl.ts
Preview and publishing
- Draft preview
apps/api/src/http/preview-site-runtime.ts - Static site build
apps/api/src/publish/build.ts - Route planning
packages/core/src/routes.ts - Site deployment
apps/api/src/publish/runner.ts
AI and agent access
- AI authoring agent
apps/api/src/ai/agent-loop.ts - AI provider
apps/api/src/ai/provider.ts - MCP endpoint
packages/mcp/src/server.ts - MCP API client
packages/mcp/src/client.ts
Site capabilities
- Site components
packages/blocks/src/render.ts
Other components
- Agency editor
- External coding agent
Connections 24
- Agency editor → Editor application: authors in
- Editor application → Project editor: opens project
apps/editor/src/App.tsx - Project editor → Editor API client: requests data
- Dataset manager → Editor API client: edits datasets
apps/editor/src/views/DatasetManager.tsx - Dataset manager → Entry editing: uses form
apps/editor/src/views/DatasetManager.tsx - Dataset manager → Project events: subscribes to
apps/editor/src/views/DatasetManager.tsx - Editor application → Dialog UI: uses dialogs
apps/editor/src/App.tsx - Dialog UI → Modal UI: renders
apps/editor/src/views/ui/Dialogs.tsx - Editor API client → API server: sends requests
- API server → Project content: handles content
- Project content → Platform database: reads and writes
- API server → Media storage: stores uploads
- Agency editor → Site import: imports existing site
- Site import → Project content: creates editable project
apps/api/src/http/import-routes.ts - Project editor → Draft preview: views live preview
- Project content → Static site build: builds project
- Static site build → Route planning: plans page routes
- Static site build → Site components: renders components
- Static site build → Site deployment: produces deployable site
- Project editor → AI authoring agent: offers AI authoring
- AI authoring agent → AI provider: uses provider
- External coding agent → MCP endpoint: edits over MCP
- MCP endpoint → MCP API client: calls API client
packages/mcp/src/server.ts - MCP API client → API server: accesses project API