Architecture

High-level architecture overview of Bengal

7 pages in this section

Bengal SSG follows a modular architecture with clear separation of concerns to avoid "God objects" and maintain high performance even with large sites.

High-Level Architecture

graph TB subgraph "Entry Points" CLI[CLI<br/>bengal/cli/] Server[Dev Server<br/>bengal/server/] end subgraph "Core Build Pipeline" Discovery[Discovery<br/>bengal/discovery/] Orchestration[Orchestration<br/>bengal/orchestration/] Rendering[Rendering<br/>bengal/rendering/] PostProcess[Post-Processing<br/>bengal/postprocess/] end subgraph "Object Model" Site[Site<br/>bengal/core/site.py] Pages[Pages<br/>bengal/core/page/] Sections[Sections<br/>bengal/core/section.py] Assets[Assets<br/>bengal/core/asset/] Menus[Menus<br/>bengal/core/menu.py] end subgraph "Supporting Systems" Cache[Build Cache<br/>bengal/cache/] Health[Health Checks<br/>bengal/health/] Autodoc[Autodoc<br/>bengal/autodoc/] Config[Config<br/>bengal/config/] Analysis[Analysis<br/>bengal/analysis/] Fonts[Fonts<br/>bengal/fonts/] end CLI --> Site Server --> Site Site --> Discovery Discovery --> Pages Discovery --> Sections Discovery --> Assets Site --> Orchestration Orchestration --> Menus Orchestration --> Rendering Menus -.->|"used by"| Rendering Rendering --> PostProcess Cache -.->|"cache checks"| Orchestration Health -.->|"validation"| PostProcess Autodoc -.->|"generates"| Pages Config -.->|"configuration"| Site Analysis -.->|"analyzes"| Site Fonts -.->|"downloads/generates"| Assets

Key Flows:

  1. Build: CLI → Site → Discovery → Orchestration → [Menus + Rendering] → Post-Process
  2. Menu Building: Orchestration builds menus → Rendering uses menus in templates
  3. Cache: Build Cache checks file changes and dependencies before rebuilding
  4. Autodoc: Generate Python/CLI docs → treated as regular content pages
  5. Dev Server: Watch files → trigger incremental rebuilds → serve output

In This Section

Core Architecture Data models, build coordination, and core principles 7 pages
Subsystems Specialized feature subsystems 5 pages
Tooling & CLI Developer tools, CLI, server, and configuration 5 pages
Design Principles Core patterns and philosophies guiding Bengal's architecture.
Related Pages