# sakkada/django-cmskit architecture

> Architecture diagram of the GitHub repository sakkada/django-cmskit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakkada/django-cmskit
- Repository: https://github.com/sakkada/django-cmskit

## Overview

##### Main Components

a. Core Components:
- Base CMS Framework Layer
- Models Layer
- Admin Interface
- Views Layer
- Templates System
- Utilities

b. Contrib Packages:
- Areas Module
- Items Module
- Nodes Module

##### Component Relationships

**┌─────────────────────────────────────────────────────┐**
- Django Framework                    │
- ┘
- ↑
**┌─────────────────────────────────────────────────────┐**
- CMS Kit Core                      │
- ┬──────────────┬────────────┬──────────┤
- Base Layer │ Models Layer │   Admin    │  Views   │
- Interface  │          │
- ┴──────────────┴────────────┴──────────┘
- ↑
**┌─────────────────────────────────────────────────────┐**
- Contrib Modules                      │
- ┬─────────────────┬───────────────────┤
- Areas     │     Items       │      Nodes        │
- Module     │    Module       │     Module        │
- ┴─────────────────┴───────────────────┘
- ↑
**┌─────────────────────────────────────────────────────┐**
- Template System                       │
- ┘

##### Specific Component Details

a. Models Layer:
- Inheritance from Django's model system

b. Contrib Modules:
- Relationships between Areas, Items, and Nodes
- Template integration points
- Admin customization points

c. Template System:
- Hierarchy of template inheritance
- Admin templates and node templates

##### Important Elements to Highlight

- Query System: Show the custom query functionality inspired by Wagtail
- Admin Interface: Highlight the admin customization capabilities
- Template Hierarchy: Demonstrate the node-based template structure
- Utility Services: Show how utils connect to other components

##### Implementation Details

- Rectangles: Main components
- Diamonds: Decision points/interfaces

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Django["Django Framework"]
        DjangoCore["Django Core"]
    end

    subgraph Core["CMS Kit Core"]
        Base["Base CMS Framework"]:::core
        ModelsLayer["Models Layer"]:::core
        AdminInterface["Admin Interface"]:::core
        ViewsLayer["Views Layer"]:::core
    end

    subgraph Models["Models Components"]
        BaseModels["Base Models"]:::models
        QuerySystem["Query System"]:::models
        TransInterface["Translation Interface"]:::models
    end

    subgraph Contrib["Contrib Modules"]
        Areas["Areas Module"]:::contrib
        Items["Items Module"]:::contrib
        Nodes["Nodes Module"]:::contrib
    end

    subgraph Templates["Template System"]
        BaseTemplates["Base Templates"]:::template
        NodeTemplates["Node Templates"]:::template
        ItemTemplates["Item Templates"]:::template
        AdminTemplates["Admin Templates"]:::template
    end

    subgraph Utils["Utilities"]
        Pagination["Pagination"]:::util
        QueryString["Query String Utils"]:::util
        AdminUtils["Admin Utils"]:::util
    end

    subgraph Config["Configuration"]
        MainConfig["Main Config"]:::config
        TestSettings["Test Settings"]:::config
    end

    DjangoCore --> Base
    Base --> ModelsLayer
    Base --> AdminInterface
    Base --> ViewsLayer

    ModelsLayer --> BaseModels
    ModelsLayer --> QuerySystem
    ModelsLayer --> TransInterface

    AdminInterface --> AdminTemplates
    AdminInterface --> AdminUtils

    ViewsLayer --> Items
    ViewsLayer --> Nodes

    Items --> ItemTemplates
    Nodes --> NodeTemplates
    
    QuerySystem --> Items
    QuerySystem --> Nodes
    QuerySystem --> Areas

    MainConfig --> Base
    TestSettings --> Base

    %% Click Events
    click Base "https://github.com/sakkada/django-cmskit/blob/master/cmskit/base.py"
    click ModelsLayer "https://github.com/sakkada/django-cmskit/tree/master/cmskit/models/"
    click BaseModels "https://github.com/sakkada/django-cmskit/blob/master/cmskit/models/base.py"
    click QuerySystem "https://github.com/sakkada/django-cmskit/blob/master/cmskit/models/query.py"
    click TransInterface "https://github.com/sakkada/django-cmskit/blob/master/cmskit/models/ti.py"
    click AdminInterface "https://github.com/sakkada/django-cmskit/blob/master/cmskit/admin.py"
    click AdminTemplates "https://github.com/sakkada/django-cmskit/tree/master/cmskit/templates/admin/"
    click AdminUtils "https://github.com/sakkada/django-cmskit/blob/master/cmskit/utils/admin.py"
    click ViewsLayer "https://github.com/sakkada/django-cmskit/blob/master/cmskit/views.py"
    click BaseTemplates "https://github.com/sakkada/django-cmskit/tree/master/cmskit/templates/"
    click NodeTemplates "https://github.com/sakkada/django-cmskit/tree/master/cmskit/templates/nodes/"
    click ItemTemplates "https://github.com/sakkada/django-cmskit/tree/master/cmskit/contrib/items/templates/nodes/"
    click Pagination "https://github.com/sakkada/django-cmskit/blob/master/cmskit/utils/pagination.py"
    click QueryString "https://github.com/sakkada/django-cmskit/blob/master/cmskit/utils/querystring.py"
    click Areas "https://github.com/sakkada/django-cmskit/tree/master/cmskit/contrib/areas/"
    click Items "https://github.com/sakkada/django-cmskit/tree/master/cmskit/contrib/items/"
    click Nodes "https://github.com/sakkada/django-cmskit/tree/master/cmskit/contrib/nodes/"
    click MainConfig "https://github.com/sakkada/django-cmskit/blob/master/cmskit/conf.py"
    click TestSettings "https://github.com/sakkada/django-cmskit/blob/master/cmskit/tests/settings.py"

    %% Styles
    classDef core fill:#2b6cb0,stroke:#1a4971,color:white
    classDef models fill:#3182ce,stroke:#2c5282,color:white
    classDef contrib fill:#48bb78,stroke:#2f855a,color:white
    classDef template fill:#ed8936,stroke:#c05621,color:white
    classDef util fill:#667eea,stroke:#5a67d8,color:white
    classDef config fill:#a0aec0,stroke:#718096,color:white
```
