# avacms/ava architecture

> Architecture diagram of the GitHub repository avacms/ava, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avacms/ava
- Repository: https://github.com/avacms/ava

## Overview

Ava CMS turns Markdown and HTML files into routed, searchable pages rendered through site themes; its README describes the author-to-index-to-render workflow. The sampled source supports the HTTP entry point, application dispatch, routing, repository/query behavior, rendering, shortcodes, and preview links. Other README-documented capabilities, including bundled plugins and CLI operations, are included at subsystem level where source excerpts were limited; their internal wiring is not inferred.

Main entry points: [`core/Application.php`](https://github.com/avacms/ava/blob/main/core/Application.php) (Application), [`core/Content/Repository.php`](https://github.com/avacms/ava/blob/main/core/Content/Repository.php) (Content repository), [`public/index.php`](https://github.com/avacms/ava/blob/main/public/index.php) (HTTP entry), [`core/Rendering/Engine.php`](https://github.com/avacms/ava/blob/main/core/Rendering/Engine.php) (Rendering engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web delivery"]
  node_front["HTTP entry<br/>[index.php]"]
  node_application["Application<br/>[Application.php]"]
  node_request["Request and response<br/>[Request.php]"]
  node_router["Router<br/>[Router.php]"]
  node_page_cache["Page cache<br/>[WebpageCache.php]"]
end

subgraph group_content["Content system"]
  node_content_files["Content files"]
  node_indexer["Content indexer<br/>[Indexer.php]"]
  node_index_build["Index builder<br/>[IndexBuilder.php]"]
  node_index_store[("Index store<br/>[IndexStore.php]")]
  node_repository["Content repository<br/>[Repository.php]"]
  node_parser["Content parser<br/>[Parser.php]"]
  node_query["Search and queries<br/>[Query.php]"]
  node_query_processor["Query processing<br/>[QueryProcessor.php]"]
end

subgraph group_render["Rendering and themes"]
  node_renderer["Rendering engine<br/>[Engine.php]"]
  node_templates["Theme templates<br/>[index.php]"]
  node_shortcodes["Shortcode engine<br/>[Engine.php]"]
end

subgraph group_extensions["Extensions"]
  node_plugins["Plugins and hooks<br/>[Hooks.php]"]
  node_bundled_plugins["Bundled features"]
  node_site_config["Site configuration<br/>[ava.php]"]
end

subgraph group_ops["Operations"]
  node_cli["CLI commands<br/>[Application.php]"]
  node_preview["Preview links<br/>[PreviewLinks.php]"]
  node_storage[("Storage files")]
end

node_visitor(("Site visitor"))
node_author(("Content author"))
node_cli_user(("CLI user"))

node_author -->|"writes"| node_content_files
node_content_files -->|"scans"| node_indexer
node_indexer -->|"rebuilds"| node_index_build
node_index_build -->|"writes index"| node_index_store
node_visitor -->|"requests page"| node_front
node_front -->|"captures request"| node_request
node_front -->|"handles request"| node_application
node_application -->|"checks cache"| node_page_cache
node_application -->|"dispatches route"| node_router
node_router -->|"resolves content"| node_repository
node_repository -->|"reads index"| node_index_store
node_repository -->|"parses files"| node_parser
node_application -->|"renders response"| node_renderer
node_renderer -->|"processes shortcodes"| node_shortcodes
node_renderer -->|"renders template"| node_templates
node_templates -->|"returns HTML"| node_visitor
node_query -->|"loads items"| node_repository
node_query -->|"filters and scores"| node_query_processor
node_repository -->|"reads index data"| node_storage
node_page_cache -->|"reads and writes"| node_storage
node_site_config -->|"configures"| node_application
node_application -->|"applies hooks"| node_plugins
node_bundled_plugins -.->|"registers hooks"| node_plugins
node_cli_user -->|"runs commands"| node_cli
node_cli -->|"rebuilds index"| node_indexer
node_cli -->|"creates preview"| node_preview
node_preview -->|"resolves route"| node_repository

click node_front "https://github.com/avacms/ava/blob/main/public/index.php"
click node_application "https://github.com/avacms/ava/blob/main/core/Application.php"
click node_request "https://github.com/avacms/ava/blob/main/core/Http/Request.php"
click node_router "https://github.com/avacms/ava/blob/main/core/Routing/Router.php"
click node_page_cache "https://github.com/avacms/ava/blob/main/core/Http/WebpageCache.php"
click node_indexer "https://github.com/avacms/ava/blob/main/core/Content/Indexer.php"
click node_index_build "https://github.com/avacms/ava/blob/main/core/Content/Index/IndexBuilder.php"
click node_index_store "https://github.com/avacms/ava/blob/main/core/Content/Index/IndexStore.php"
click node_repository "https://github.com/avacms/ava/blob/main/core/Content/Repository.php"
click node_parser "https://github.com/avacms/ava/blob/main/core/Content/Parser.php"
click node_query "https://github.com/avacms/ava/blob/main/core/Content/Query.php"
click node_query_processor "https://github.com/avacms/ava/blob/main/core/Content/QueryProcessor.php"
click node_renderer "https://github.com/avacms/ava/blob/main/core/Rendering/Engine.php"
click node_templates "https://github.com/avacms/ava/blob/main/app/themes/default/templates/index.php"
click node_shortcodes "https://github.com/avacms/ava/blob/main/core/Shortcodes/Engine.php"
click node_plugins "https://github.com/avacms/ava/blob/main/core/Plugins/Hooks.php"
click node_bundled_plugins "https://github.com/avacms/ava/tree/main/app/plugins"
click node_site_config "https://github.com/avacms/ava/blob/main/app/config/ava.php"
click node_cli "https://github.com/avacms/ava/blob/main/core/Cli/Application.php"
click node_preview "https://github.com/avacms/ava/blob/main/core/Routing/PreviewLinks.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_front,node_application,node_request,node_router,node_page_cache,node_cli_user toneBlue
class node_content_files,node_indexer,node_index_build,node_index_store,node_repository,node_parser,node_query,node_query_processor toneAmber
class node_renderer,node_templates,node_shortcodes toneMint
class node_plugins,node_bundled_plugins,node_site_config toneRose
class node_cli,node_preview,node_storage,node_visitor,node_author toneIndigo
```

## Components

### Web delivery

- [HTTP entry](https://github.com/avacms/ava/blob/main/public/index.php): `public/index.php`
- [Application](https://github.com/avacms/ava/blob/main/core/Application.php): `core/Application.php`
- [Request and response](https://github.com/avacms/ava/blob/main/core/Http/Request.php): `core/Http/Request.php`
- [Router](https://github.com/avacms/ava/blob/main/core/Routing/Router.php): `core/Routing/Router.php`
- [Page cache](https://github.com/avacms/ava/blob/main/core/Http/WebpageCache.php): `core/Http/WebpageCache.php`

### Content system

- **Content files**
- [Content indexer](https://github.com/avacms/ava/blob/main/core/Content/Indexer.php): `core/Content/Indexer.php`
- [Index builder](https://github.com/avacms/ava/blob/main/core/Content/Index/IndexBuilder.php): `core/Content/Index/IndexBuilder.php`
- [Index store](https://github.com/avacms/ava/blob/main/core/Content/Index/IndexStore.php): `core/Content/Index/IndexStore.php`
- [Content repository](https://github.com/avacms/ava/blob/main/core/Content/Repository.php): `core/Content/Repository.php`
- [Content parser](https://github.com/avacms/ava/blob/main/core/Content/Parser.php): `core/Content/Parser.php`
- [Search and queries](https://github.com/avacms/ava/blob/main/core/Content/Query.php): `core/Content/Query.php`
- [Query processing](https://github.com/avacms/ava/blob/main/core/Content/QueryProcessor.php): `core/Content/QueryProcessor.php`

### Rendering and themes

- [Rendering engine](https://github.com/avacms/ava/blob/main/core/Rendering/Engine.php): `core/Rendering/Engine.php`
- [Theme templates](https://github.com/avacms/ava/blob/main/app/themes/default/templates/index.php): `app/themes/default/templates/index.php`
- [Shortcode engine](https://github.com/avacms/ava/blob/main/core/Shortcodes/Engine.php): `core/Shortcodes/Engine.php`

### Extensions

- [Plugins and hooks](https://github.com/avacms/ava/blob/main/core/Plugins/Hooks.php): `core/Plugins/Hooks.php`
- [Bundled features](https://github.com/avacms/ava/tree/main/app/plugins): `app/plugins`
- [Site configuration](https://github.com/avacms/ava/blob/main/app/config/ava.php): `app/config/ava.php`

### Operations

- [CLI commands](https://github.com/avacms/ava/blob/main/core/Cli/Application.php): `core/Cli/Application.php`
- [Preview links](https://github.com/avacms/ava/blob/main/core/Routing/PreviewLinks.php): `core/Routing/PreviewLinks.php`
- **Storage files**

### Other components

- **Site visitor**
- **Content author**
- **CLI user**

## Connections

- Content author → Content files: writes
- Content files → Content indexer: scans
- Content indexer → Index builder: rebuilds
- Index builder → Index store: writes index
- Site visitor → HTTP entry: requests page
- HTTP entry → Request and response: captures request
- HTTP entry → Application: handles request
- Application → Page cache: checks cache
- Application → Router: dispatches route
- Router → Content repository: resolves content
- Content repository → Index store: reads index
- Content repository → Content parser: parses files
- Application → Rendering engine: renders response
- Rendering engine → Shortcode engine: processes shortcodes
- Rendering engine → Theme templates: renders template
- Theme templates → Site visitor: returns HTML
- Search and queries → Content repository: loads items
- Search and queries → Query processing: filters and scores
- Content repository → Storage files: reads index data
- Page cache → Storage files: reads and writes
- Site configuration → Application: configures
- Application → Plugins and hooks: applies hooks
- Bundled features → Plugins and hooks: registers hooks
- CLI user → CLI commands: runs commands
- CLI commands → Content indexer: rebuilds index
- CLI commands → Preview links: creates preview
- Preview links → Content repository: resolves route
