# karabinse/fabriq architecture

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

- Interactive diagram: https://gitdiagram.com/karabinse/fabriq
- Repository: https://github.com/karabinse/fabriq

## Overview

Fabriq is a Laravel CMS with a Vue administration SPA and API for managing structured, localized website content. The principal workflow is an editor creating or updating pages and blocks, resolving referenced content for preview or delivery, and publishing changes; related branches cover media, navigation, collaboration, and analytics. The excerpts and source index support several backend relationships, but frontend API wiring and some unsampled subsystems are not verified, so those links are omitted or marked unverified.

Main entry points: [`src/Models/Page.php`](https://github.com/karabinse/fabriq/blob/main/src/Models/Page.php) (Page model), [`src/Http/Controllers/Api/Fabriq/PageController.php`](https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PageController.php) (Page API), [`src/Repositories/EloquentPageRepository.php`](https://github.com/karabinse/fabriq/blob/main/src/Repositories/EloquentPageRepository.php) (Page repository), [`src/RouteRegistrar.php`](https://github.com/karabinse/fabriq/blob/main/src/RouteRegistrar.php) (API routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_spa["Admin SPA<br/>[App.vue]"]
  node_route_api["API routing<br/>[RouteRegistrar.php]"]
  node_page_api["Page API<br/>[PageController.php]"]
  node_resource_api["Resource APIs"]
end

subgraph group_content["Content delivery"]
  node_page_model["Page model<br/>[Page.php]"]
  node_page_repo["Page repository"]
  node_content_context["Content resolver"]
  node_content_data["Live page data<br/>[LivePageData.php]"]
  node_blocks_templates["Blocks and templates<br/>[Block.php]"]
  node_preview_api["Page previews"]
  node_slug_preview["Slug preview"]
end

subgraph group_assets["CMS resources"]
  node_media["Media library"]
  node_menus["Menus and paths"]
  node_collaboration["Comments and presence"]
end

subgraph group_operations["Platform services"]
  node_analytics["Site analytics"]
  node_search_queries["Analytics queries<br/>[TopPagesQuery.php]"]
  node_cache_events["Cache invalidation"]
  node_cache_webhooks["Cache webhooks"]
end

node_editor(("CMS editor"))
node_google_search["Google Search Console"]

node_editor -.->|"edits content"| node_spa
node_route_api -->|"routes pages"| node_page_api
node_route_api -->|"routes resources"| node_resource_api
node_page_api -->|"resolves content"| node_content_context
node_page_api -->|"loads pages"| node_page_model
node_page_repo -->|"queries pages"| node_page_model
node_page_repo -->|"loads blocks"| node_blocks_templates
node_slug_preview -->|"finds preview page"| node_page_repo
node_slug_preview -->|"resolves content"| node_content_context
node_preview_api -->|"loads page"| node_page_model
node_page_model -->|"invalidates references"| node_cache_events
node_cache_webhooks -->|"batches changes"| node_cache_events
node_analytics -->|"builds queries"| node_search_queries
node_analytics -->|"requests analytics"| node_google_search

click node_spa "https://github.com/karabinse/fabriq/blob/main/resources/fabriq/js/App.vue"
click node_route_api "https://github.com/karabinse/fabriq/blob/main/src/RouteRegistrar.php"
click node_page_api "https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PageController.php"
click node_resource_api "https://github.com/karabinse/fabriq/tree/main/src/Http/Controllers/Api/Fabriq"
click node_page_model "https://github.com/karabinse/fabriq/blob/main/src/Models/Page.php"
click node_page_repo "https://github.com/karabinse/fabriq/blob/main/src/Repositories/EloquentPageRepository.php"
click node_content_context "https://github.com/karabinse/fabriq/blob/main/src/ContentGetters/ContentResourceContext.php"
click node_content_data "https://github.com/karabinse/fabriq/blob/main/src/Data/LivePageData.php"
click node_blocks_templates "https://github.com/karabinse/fabriq/blob/main/src/Models/Block.php"
click node_preview_api "https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PagePreviewController.php"
click node_slug_preview "https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PageSlugPreviewController.php"
click node_media "https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/ImageController.php"
click node_menus "https://github.com/karabinse/fabriq/blob/main/src/Repositories/EloquentMenuRepository.php"
click node_collaboration "https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/CommentController.php"
click node_analytics "https://github.com/karabinse/fabriq/blob/main/src/Services/SearchConsoleService.php"
click node_search_queries "https://github.com/karabinse/fabriq/blob/main/src/Search/TopPagesQuery.php"
click node_cache_events "https://github.com/karabinse/fabriq/blob/main/src/Services/BlockReferenceInvalidator.php"
click node_cache_webhooks "https://github.com/karabinse/fabriq/blob/main/src/Listeners/CallCacheBustingWebhook.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_spa,node_route_api,node_page_api,node_resource_api toneBlue
class node_page_model,node_page_repo,node_content_context,node_content_data,node_blocks_templates,node_preview_api,node_slug_preview toneAmber
class node_media,node_menus,node_collaboration toneMint
class node_analytics,node_search_queries,node_cache_events,node_cache_webhooks toneRose
class node_editor,node_google_search toneIndigo
```

## Components

### Administration

- [Admin SPA](https://github.com/karabinse/fabriq/blob/main/resources/fabriq/js/App.vue): `resources/fabriq/js/App.vue`
- [API routing](https://github.com/karabinse/fabriq/blob/main/src/RouteRegistrar.php): `src/RouteRegistrar.php`
- [Page API](https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PageController.php): `src/Http/Controllers/Api/Fabriq/PageController.php`
- [Resource APIs](https://github.com/karabinse/fabriq/tree/main/src/Http/Controllers/Api/Fabriq): `src/Http/Controllers/Api/Fabriq`

### Content delivery

- [Page model](https://github.com/karabinse/fabriq/blob/main/src/Models/Page.php): `src/Models/Page.php`
- [Page repository](https://github.com/karabinse/fabriq/blob/main/src/Repositories/EloquentPageRepository.php): `src/Repositories/EloquentPageRepository.php`
- [Content resolver](https://github.com/karabinse/fabriq/blob/main/src/ContentGetters/ContentResourceContext.php): `src/ContentGetters/ContentResourceContext.php`
- [Live page data](https://github.com/karabinse/fabriq/blob/main/src/Data/LivePageData.php): `src/Data/LivePageData.php`
- [Blocks and templates](https://github.com/karabinse/fabriq/blob/main/src/Models/Block.php): `src/Models/Block.php`
- [Page previews](https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PagePreviewController.php): `src/Http/Controllers/Api/Fabriq/PagePreviewController.php`
- [Slug preview](https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/PageSlugPreviewController.php): `src/Http/Controllers/Api/Fabriq/PageSlugPreviewController.php`

### CMS resources

- [Media library](https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/ImageController.php): `src/Http/Controllers/Api/Fabriq/ImageController.php`
- [Menus and paths](https://github.com/karabinse/fabriq/blob/main/src/Repositories/EloquentMenuRepository.php): `src/Repositories/EloquentMenuRepository.php`
- [Comments and presence](https://github.com/karabinse/fabriq/blob/main/src/Http/Controllers/Api/Fabriq/CommentController.php): `src/Http/Controllers/Api/Fabriq/CommentController.php`

### Platform services

- [Site analytics](https://github.com/karabinse/fabriq/blob/main/src/Services/SearchConsoleService.php): `src/Services/SearchConsoleService.php`
- [Analytics queries](https://github.com/karabinse/fabriq/blob/main/src/Search/TopPagesQuery.php): `src/Search/TopPagesQuery.php`
- [Cache invalidation](https://github.com/karabinse/fabriq/blob/main/src/Services/BlockReferenceInvalidator.php): `src/Services/BlockReferenceInvalidator.php`
- [Cache webhooks](https://github.com/karabinse/fabriq/blob/main/src/Listeners/CallCacheBustingWebhook.php): `src/Listeners/CallCacheBustingWebhook.php`

### Other components

- **CMS editor**
- **Google Search Console**

## Connections

- CMS editor → Admin SPA: edits content
- API routing → Page API: routes pages (evidence: `src/RouteRegistrar.php`)
- API routing → Resource APIs: routes resources (evidence: `src/RouteRegistrar.php`)
- Page API → Content resolver: resolves content (evidence: `src/Http/Controllers/Api/Fabriq/PageController.php`)
- Page API → Page model: loads pages (evidence: `src/Http/Controllers/Api/Fabriq/PageController.php`)
- Page repository → Page model: queries pages (evidence: `src/Repositories/EloquentPageRepository.php`)
- Page repository → Blocks and templates: loads blocks (evidence: `src/Repositories/EloquentPageRepository.php`)
- Slug preview → Page repository: finds preview page (evidence: `src/Http/Controllers/Api/Fabriq/PageSlugPreviewController.php`)
- Slug preview → Content resolver: resolves content (evidence: `src/Http/Controllers/Api/Fabriq/PageSlugPreviewController.php`)
- Page previews → Page model: loads page (evidence: `src/Http/Controllers/Api/Fabriq/PagePreviewController.php`)
- Page model → Cache invalidation: invalidates references (evidence: `src/Models/Page.php`)
- Cache webhooks → Cache invalidation: batches changes (evidence: `src/Listeners/CallCacheBustingWebhook.php`)
- Site analytics → Analytics queries: builds queries (evidence: `src/Services/SearchConsoleService.php`)
- Site analytics → Google Search Console: requests analytics (evidence: `src/Services/SearchConsoleService.php`)
