# cfwheels/cfwheels architecture

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

- Interactive diagram: https://gitdiagram.com/cfwheels/cfwheels
- Repository: https://github.com/cfwheels/cfwheels

## Overview

##### Main Components

a. Core Framework Components:
- MVC Architecture Layer
- Controllers (app/controllers)
- Models (app/models)
- Views (app/views)
- Configuration Layer (app/config)
- Event Handling System (app/events)
- Plugin System (app/plugins)
- Database Migration System (app/migrator)

b. Infrastructure Components:
- Multiple CFML Engine Support
- Adobe ColdFusion (2018, 2021, 2023)
- Lucee (5, 6)
- Database Support Layer
- SQL Server
- PostgreSQL
- MySQL
- H2

**┌─ Application Layer ─────────────────────┐**
- Views → Controllers → Models            │
- ┬─────────────────────────┘
**┌─ Core Layer ──┴─────────────────────────┐**
- Routing │ Config │ Events │ Plugins     │
- ┬─────────────────────────┘
**┌─ Engine Layer ┴─────────────────────────┐**
- Adobe CF │ Lucee │ Database Adapters    │
- ┘

##### Key Relationships to Highlight

- Request flow: URL → Routing → Controller → Model → View
- Plugin integration points
- Demonstrate database interaction flow
- Event handler triggers
- Configuration inheritance

##### Detailed Component Relationships

**┌─ Request Flow ──────────────────────────────┐**
- URL → Rewrite Rules → Routing → Controller  │
- ↓                                          │
- Model ← Database ← Migration System         │
- ↓                                          │
- View → Layout → Response                    │
- ┘

##### Implementation Notes

- Use standardized UML notation where appropriate
- Notes for important configuration points
- Version compatibility matrix
- Plugin extension points
- Security boundaries

##### Key Features to Emphasize

- Multi-engine support architecture
- Database abstraction layer
- Plugin system architecture
- Environment-specific configuration
- Testing infrastructure
- CLI tooling integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Application
        Views["Views"]
        Controllers["Controllers"]
        Models["Models"]
        Layout["Layout System"]
    end

    subgraph Core
        Config["Configuration"]
        Events["Event System"]
        Plugins["Plugin System"]
        Routes["Routing"]
        Migrations["Database Migrations"]
    end

    subgraph Infrastructure
        subgraph CFML_Engines
            Adobe["Adobe ColdFusion"]
            Lucee["Lucee"]
        end
        
        subgraph Databases
            MSSQL["SQL Server"]
            PostgreSQL["PostgreSQL"]
            MySQL["MySQL"]
            H2["H2"]
        end
    end

    subgraph Development
        Testing["Testing Framework"]
        CLI["CLI Tools"]
        Templates["Templates"]
    end

    %% Request Flow
    Routes --> Controllers
    Controllers --> Models
    Models --> Views
    Views --> Layout

    %% Core Relationships
    Config --> Controllers
    Config --> Models
    Events --> Controllers
    Plugins --> Controllers
    Plugins --> Models
    Models --> Migrations
    Migrations --> Databases

    %% Infrastructure Relationships
    Adobe --> Models
    Lucee --> Models
    Models --> Databases

    %% Development Tools
    CLI --> Templates
    Templates --> Controllers
    Templates --> Models
    Templates --> Views
    Testing --> Controllers
    Testing --> Models

    %% Styling
    classDef core fill:#2374ab
    classDef app fill:#48a9a6
    classDef infra fill:#e4572e
    classDef db fill:#8b5fbf
    classDef dev fill:#a8a8a8

    class Config,Events,Plugins,Routes,Migrations core
    class Views,Controllers,Models,Layout app
    class Adobe,Lucee infra
    class MSSQL,PostgreSQL,MySQL,H2 db
    class Testing,CLI,Templates dev

    %% Click Events
    click Controllers "https://github.com/cfwheels/cfwheels/blob/develop/app/controllers/Controller.cfc"
    click Models "https://github.com/cfwheels/cfwheels/blob/develop/app/models/Model.cfc"
    click Views "https://github.com/cfwheels/cfwheels/tree/develop/app/views/"
    click Layout "https://github.com/cfwheels/cfwheels/blob/develop/app/views/layout.cfm"
    click Config "https://github.com/cfwheels/cfwheels/blob/develop/app/config/settings.cfm"
    click Routes "https://github.com/cfwheels/cfwheels/blob/develop/app/config/routes.cfm"
    click Events "https://github.com/cfwheels/cfwheels/tree/develop/app/events/"
    click Plugins "https://github.com/cfwheels/cfwheels/tree/develop/app/plugins/"
    click Migrations "https://github.com/cfwheels/cfwheels/tree/develop/app/migrator/"
    click Templates "https://github.com/cfwheels/cfwheels/tree/develop/app/snippets/"
    click Testing "https://github.com/cfwheels/cfwheels/tree/develop/tests/Testbox/"
    click Adobe "https://github.com/cfwheels/cfwheels/tree/develop/docker/adobe2021/"
    click Lucee "https://github.com/cfwheels/cfwheels/tree/develop/docker/lucee@6/"
```
