Core Architecture

Data models and build coordination

1 min read 199 words

Foundational data models and build coordination for Bengal's static site generation.

Component Responsibility Module
Site Central container, holds all content bengal/core/site/
Page Single content page with metadata bengal/core/page/
Section Directory container, holds children bengal/core/section/
Asset Static file with processing metadata bengal/core/asset/

Design Principles

  • No God Objects: Each class has single responsibility (Site uses 7 focused mixins)
  • Passive Core: Core models (PageCore, Section) are data-only; Site and Asset provide I/O convenience APIs that orchestrators coordinate
  • Composition over Inheritance: BuildContext passes services between build phases
  • Immutable PageCore: PageCore usesfrozen=Truefor thread-safety and cache integrity (Python 3.14t compatible)

In This Section

Topic Description
Cache Build cache system with Zstandard compression
Content Types Strategy pattern for type-specific behavior
Data Flow How data moves through the build pipeline
Object Model Core data structures and relationships
Orchestration Build phase coordination
Pipeline Rendering pipeline architecture

Seealso

Design Principles — Full architectural guidelines

In This Section

Build Cache How Bengal caches builds for incremental rebuilds
Build Pipeline How Bengal's build pipeline processes content through orchestrators
Content Type Strategies Strategy pattern for content type-specific behavior (sorting, templates, pagination)
Data Flow How data moves through the build pipeline
Object Model Site, Page, Section, and Asset data models.