# oleoneto/django-clite architecture

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

- Interactive diagram: https://gitdiagram.com/oleoneto/django-clite
- Repository: https://github.com/oleoneto/django-clite

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) CLI Core Layer
- Command Parser & Router
- Logger System
- Extension Management

b) Command Groups
- Generate Commands
- Destroy Commands
- New Commands

c) Core Services
- Field Parser
- Git Integration
- Template Engine

d) Extension Systems
- Plugin Discovery
- Template Override System

##### Component Relationships

Following interactions:

**CLI Entry Point**
- ↓
**Command Router ←→ Plugin Discovery System**
- ↓
**Command Groups (Generate/Destroy/New)**
- ↓
**Core Services Layer**
- ↓
**Template Engine ←→ Template Override System**

##### Implementation Details

Technical elements:
- Click framework integration
- Template processing pipeline
- Field parser factory pattern
- Git integration protocols

##### Additional Notes

- How the system handles template overrides
- Plugin discovery mechanism
- Demonstrate command group hierarchy
- Error handling flow

This will provide a comprehensive view of the system while maintaining clarity about its core functionality as a Django project management tool.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph CLI["CLI Layer"]
        Entry["CLI Entry Point"]
        Router["Command Parser & Router"]:::core
        Logger["Logger System"]:::core
        ExtMgmt["Extension Management"]:::core
    end

    subgraph Commands["Command Groups"]
        Generate["Generate Commands"]:::command
        Destroy["Destroy Commands"]:::command
        New["New Commands"]:::command
    end

    subgraph Services["Core Services"]
        FieldParser["Field Parser"]:::service
        GitIntegration["Git Integration"]:::service
        TemplateEngine["Template Engine"]:::service
    end

    subgraph Extensions["Extension Systems"]
        PluginDiscovery["Plugin Discovery"]:::extension
        TemplateOverride["Template Override System"]:::extension
    end

    subgraph Templates["Template System"]
        BaseTemplates[("Base Templates")]:::template
        ModelTemplates[("Model Templates")]:::template
        ViewTemplates[("View Templates")]:::template
        AdminTemplates[("Admin Templates")]:::template
    end

    Entry --> Router
    Router --> Logger
    Router --> ExtMgmt
    Router --> Generate
    Router --> Destroy
    Router --> New

    Generate --> FieldParser
    Generate --> TemplateEngine
    Destroy --> GitIntegration
    New --> TemplateEngine

    ExtMgmt --> PluginDiscovery
    ExtMgmt --> TemplateOverride

    TemplateEngine --> BaseTemplates
    TemplateEngine --> ModelTemplates
    TemplateEngine --> ViewTemplates
    TemplateEngine --> AdminTemplates

    TemplateOverride --> TemplateEngine

    %% Click Events
    click Router "https://github.com/oleoneto/django-clite/blob/main/django_clite/cli/cli.py"
    click Logger "https://github.com/oleoneto/django-clite/blob/main/django_clite/core/logger.py"
    click ExtMgmt "https://github.com/oleoneto/django-clite/blob/main/django_clite/extensions/__init__.py"
    click Generate "https://github.com/oleoneto/django-clite/blob/main/django_clite/commands/generate/main.py"
    click Destroy "https://github.com/oleoneto/django-clite/blob/main/django_clite/commands/destroy/main.py"
    click New "https://github.com/oleoneto/django-clite/blob/main/django_clite/commands/new/main.py"
    click FieldParser "https://github.com/oleoneto/django-clite/blob/main/django_clite/core/field_parser/factory.py"
    click GitIntegration "https://github.com/oleoneto/django-clite/blob/main/django_clite/core/git/git.py"
    click TemplateEngine "https://github.com/oleoneto/django-clite/tree/main/django_clite/template_files"
    click PluginDiscovery "https://github.com/oleoneto/django-clite/blob/main/django_clite/extensions/discoverable.py"
    click TemplateOverride "https://github.com/oleoneto/django-clite/blob/main/django_clite/extensions/combined.py"
    click BaseTemplates "https://github.com/oleoneto/django-clite/tree/main/django_clite/template_files"
    click ModelTemplates "https://github.com/oleoneto/django-clite/tree/main/django_clite/template_files/models"
    click ViewTemplates "https://github.com/oleoneto/django-clite/tree/main/django_clite/template_files/views"
    click AdminTemplates "https://github.com/oleoneto/django-clite/tree/main/django_clite/template_files/admin"

    %% Styles
    classDef core fill:#2196F3,color:white
    classDef command fill:#4CAF50,color:white
    classDef service fill:#9C27B0,color:white
    classDef extension fill:#FFC107,color:black
    classDef template fill:#607D8B,color:white

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        CommandComp["Command Module"]:::command
        ServiceComp["Service"]:::service
        ExtensionComp["Extension Point"]:::extension
        TemplateComp["Template Storage"]:::template
    end
```
