How kushagra-2006/template-playground works
Accord Project Template Playground lets users edit TemplateMark, Concerto models, logic, and JSON data, then run templates for a live agreement preview. The central runtime path is the application shell into the editor workspace and shared state, which coordinates rendering in an isolated sandbox; users can also export/share work, configure AI assistance, and follow learning modules. The graph reflects README capabilities and the supplied source index/excerpts; some UI and service details are unsampled, so their connections are omitted where not evidenced.
Main entry points: MainContainer.tsx Editor workspace · store.ts Playground state · App.tsx Application shell · RebuildSandboxFrame.tsx Rendering sandbox frame
Components 27
Playground UI
- Application shell
src/App.tsx - Editor workspace
src/pages/MainContainer.tsx - Learning content
src/pages/LearnNow.tsx - Navigation
src/components/Navbar.tsx - Guided tour
src/components/Tour.ts
Template Authoring
- Concerto model editor
src/editors/ConcertoEditor.tsx - JSON data editor
src/editors/JSONEditor.tsx - TemplateMark editor
src/editors/MarkdownEditor.tsx - Logic editor
src/editors/LogicEditor.tsx - Logic source handling
src/editors/logicSource.ts - Markdown editor context
src/contexts/MarkdownEditorContext.tsx - Markdown commands
src/utils/markdownEditorUtils.ts
Execution and Preview
- Rendering sandbox frame
src/components/RebuildSandboxFrame.tsx - Sandbox coordinator
src/store/rebuildSandbox.ts - Sandbox message protocol
src/constants/rebuildSandbox.ts - Render worker
src/sandbox/rebuild.worker.ts - Template render pipeline
src/sandbox/rebuildPipeline.ts - Bundled model loader
src/utils/modelCache.ts - Agreement preview and export
src/components/designV2/PreviewPane.tsx
Assistant and State
- Playground state
src/store/store.ts - Template import and archive
src/utils/templateArchive.ts - AI chat panel
src/components/AIChatPanel.tsx - AI chat relay
src/ai-assistant/chatRelay.ts - LLM providers
src/ai-assistant/llmProviders.ts - Assistant types
src/types/components/AIAssistant.types.ts
Other components
- Playground user
- LLM provider services
Connections 31
- Playground user → Application shell: opens
- Application shell → Editor workspace: routes to
src/App.tsx - Application shell → Learning content: routes to
src/App.tsx - Application shell → Navigation: renders
src/App.tsx - Playground user → Editor workspace: edits templates
- Editor workspace → Concerto model editor: renders
src/pages/MainContainer.tsx - Editor workspace → JSON data editor: renders
src/pages/MainContainer.tsx - Editor workspace → TemplateMark editor: renders
src/pages/MainContainer.tsx - Editor workspace → Logic editor: renders
src/pages/MainContainer.tsx - Editor workspace → Playground state: reads state
src/pages/MainContainer.tsx - Playground state → Template import and archive: imports templates
src/store/store.ts - Playground state → Sandbox coordinator: coordinates rendering
src/store/store.ts - Playground state → Assistant types: uses types
src/store/store.ts - Logic editor → Logic source handling: uses source
- TemplateMark editor → Markdown editor context: shares commands
- Markdown editor context → Markdown commands: supports commands
src/editors/editorsContainer/markdownCommands.ts - Editor workspace → AI chat panel: renders
src/pages/MainContainer.tsx - AI chat panel → AI chat relay: sends chat
src/components/AIChatPanel.tsx - AI chat relay → LLM providers: delegates
- LLM providers → LLM provider services: calls provider
src/ai-assistant/llmProviders.ts - Playground state → LLM providers: configures execution
src/store/store.ts - Editor workspace → Rendering sandbox frame: hosts rendering
src/pages/MainContainer.tsx - Sandbox coordinator → Rendering sandbox frame: sends render requests
- Rendering sandbox frame → Render worker: relays messages
- Render worker → Template render pipeline: runs pipeline
src/sandbox/rebuild.worker.ts - Template render pipeline → Bundled model loader: loads models
src/sandbox/rebuildPipeline.ts - Editor workspace → Agreement preview and export: shows result
- Playground user → Agreement preview and export: views and exports
- Playground user → Learning content: follows modules
- Playground user → Guided tour: starts guided tour
- Navigation → Guided tour: offers tour