How elagoht/collage works
Collage is a Go framework for server-side, component-based rendering, with a companion CLI for creating, developing, building, exporting, and serving sites. In the principal workflow, an application registers pages and fragments; an HTTP request is routed and rendered from templates and data, then returned with cache and dependency-tag behavior. Documents and mounted assets are additional serving paths, while plugins extend application behavior. The source excerpts show the public-to-core handoff and key rendering responsibilities; several internal connections are documented in package comments or the README rather than inspected call sites.
Main entry points: handler.go HTTP Request Handler · cli.go Collage CLI · core/app.go Application Orchestrator · collage/app.go Public Application API
Components 24
Application API
- Public Application API
pkg/collage/app.go - Application Orchestrator
internal/core/app.go - Pages And Routes
internal/core/registry.go
Request Serving
- HTTP Request Handler
internal/httpx/handler.go - Locale Router
internal/router/router.go - HTTP Actions
internal/httpx/action.go - Routed Documents
internal/httpx/document.go - Mounted Assets
internal/asset/mount.go
Rendering
- Page Render Engine
internal/render/engine.go - Fragment Rendering
internal/render/fragment.go - Template Engine
internal/template/engine.go - Fragment Data Handlers
internal/types/datasource.go
Caching And Extensions
- Render Cache
internal/cache/cache.go - Dependency Tracking
internal/dependency/tracker.go - Data Cache
internal/datacache/store.go - Plugin Registry And Hooks
internal/plugin/registry.go - CSRF Protection
internal/csrf/csrf.go
Site Tooling
- Collage CLI
internal/cli/cli.go - Project Scaffolding
internal/cli/new.go - Development Loop
internal/cli/dev.go - Static Export
internal/cli/export.go - Build And Static Serve
internal/cli/build.go
Other components
- Site Author
- Site Reader
Connections 23
- Site Author → Public Application API: configures app
README.md - Public Application API → Application Orchestrator: constructs
pkg/collage/app.go - Public Application API → Pages And Routes: registers pages
pkg/collage/app.go - Application Orchestrator → HTTP Request Handler: builds handler
internal/core/app.go - Site Reader → HTTP Request Handler: sends request
internal/httpx/handler.go - HTTP Request Handler → Locale Router: resolves route
internal/httpx/handler.go - HTTP Request Handler → Page Render Engine: renders page
internal/httpx/handler.go - HTTP Request Handler → Render Cache: reads and writes
internal/httpx/handler.go - HTTP Request Handler → Dependency Tracking: tracks tags
internal/httpx/handler.go - HTTP Request Handler → Plugin Registry And Hooks: runs hooks
internal/httpx/handler.go - HTTP Request Handler → CSRF Protection: protects forms
internal/httpx/handler.go - Locale Router → Routed Documents: routes documents
internal/router/router.go - Page Render Engine → Fragment Rendering: renders fragments
internal/render/engine.go - Fragment Rendering → Template Engine: executes templates
internal/render/fragment.go - Fragment Rendering → Fragment Data Handlers: fetches fragment data
internal/render/fragment.go - Page Render Engine → Dependency Tracking: collects dependency tags
internal/render/engine.go - Application Orchestrator → Data Cache: configures data cache
internal/core/app.go - Application Orchestrator → Mounted Assets: configures mounts
internal/core/app.go - Site Author → Collage CLI: runs commands
README.md - Collage CLI → Project Scaffolding: creates project
README.md - Collage CLI → Development Loop: runs development
README.md - Collage CLI → Static Export: exports static site
README.md - Collage CLI → Build And Static Serve: builds or serves
README.md