# jplerouzic/coralie architecture

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

- Interactive diagram: https://gitdiagram.com/jplerouzic/coralie
- Repository: https://github.com/jplerouzic/coralie

## Overview

##### Main System Components

a) Controller Layer
- Main controller (controller/htmly.php)
- Class structure under controller/classes
- Dispatch and rendering components

b) Model Layer
- In the middle
- Functionality modules (archive, author, category, posts, comments, etc.)
- Flat-file storage system
- Plugin system

c) View Layer
- At the bottom
- Admin interface and theme system
- Editor component
- Static and dynamic page rendering

##### Key Relationships and Data Flow

- Request flow from user through controller to appropriate model
- Data retrieval from flat-file storage
- View rendering process
- Plugin integration points
- Content serving path

##### Special Components to Highlight

Create distinct sections for:
- Authentication system (model/login)
- Comment system (model/comments)
- RSS functionality (controller/plugins/php-rss-writer)
- Content management (model/content)
- Voice feature (assets/voice)

##### Specific Implementation Details

a) File System Structure
- Content storage (/content/)
- Theme management (/views/theme/)
- Plugin architecture (/controller/plugins/)

b) Core Features
- Markdown processing
- RSS generation
- User management
- Content categorization
- Search functionality

##### Integration Points

Connections for:
- Plugin system (future WordPress plugin compatibility)
- Theme system
- External services
- Voice feature integration

##### Technical Specifications

- PHP 8.1 compatibility
- Apache/PHP hosting requirement
- Flat-file database structure
- Markdown processing capability

Key Considerations:
1. Separation between infrastructure (/controller/), functionality (/model/), and presentation (/views/)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Controller
        MC["Main Controller"]:::controller
        CD["Controller Classes"]:::controller
        PS["Plugin System"]:::plugin
        MP["Markdown Processor"]:::plugin
    end

    subgraph Model
        direction TB
        ML["Model Layer"]:::model
        AS["Authentication System"]:::model
        CS["Comment System"]:::model
        RSS["RSS System"]:::model
        CM["Content Management"]:::model
        PM["Post Management"]:::model
        CAT["Category Management"]:::model
        TM["Tag Management"]:::model
        SF["Search Functionality"]:::model
        SP["Static Pages"]:::model
        UP["User Profiles"]:::model
    end

    subgraph View
        direction TB
        VL["View Layer"]:::view
        AI["Admin Interface"]:::view
        TS["Theme System"]:::view
        EC["Editor Component"]:::view
    end

    subgraph External
        VF["Voice Feature"]:::external
    end

    %% Relationships
    MC --> CD
    MC --> PS
    MC --> MP
    
    CD --> ML
    ML --> AS
    ML --> CS
    ML --> RSS
    ML --> CM
    ML --> PM
    ML --> CAT
    ML --> TM
    ML --> SF
    ML --> SP
    ML --> UP
    
    ML --> VL
    VL --> AI
    VL --> TS
    AI --> EC
    
    PS --> VF
    
    %% Click Events
    click MC "https://github.com/JPLeRouzic/Coralie/blob/main/controller/htmly.php"
    click CD "https://github.com/JPLeRouzic/Coralie/tree/main/controller/classes"
    click PS "https://github.com/JPLeRouzic/Coralie/tree/main/controller/plugins"
    click MP "https://github.com/JPLeRouzic/Coralie/tree/main/controller/plugins/php-markdown"
    click ML "https://github.com/JPLeRouzic/Coralie/tree/main/model"
    click AS "https://github.com/JPLeRouzic/Coralie/tree/main/model/login"
    click CS "https://github.com/JPLeRouzic/Coralie/tree/main/model/comments"
    click RSS "https://github.com/JPLeRouzic/Coralie/tree/main/model/rss"
    click CM "https://github.com/JPLeRouzic/Coralie/tree/main/model/content"
    click PM "https://github.com/JPLeRouzic/Coralie/tree/main/model/posts"
    click CAT "https://github.com/JPLeRouzic/Coralie/tree/main/model/category"
    click TM "https://github.com/JPLeRouzic/Coralie/tree/main/model/tags"
    click SF "https://github.com/JPLeRouzic/Coralie/tree/main/model/search"
    click SP "https://github.com/JPLeRouzic/Coralie/tree/main/model/staticPages"
    click UP "https://github.com/JPLeRouzic/Coralie/tree/main/model/profile"
    click VL "https://github.com/JPLeRouzic/Coralie/tree/main/views"
    click AI "https://github.com/JPLeRouzic/Coralie/tree/main/views/admin"
    click TS "https://github.com/JPLeRouzic/Coralie/tree/main/views/theme"
    click EC "https://github.com/JPLeRouzic/Coralie/tree/main/views/admin/editor"
    click VF "https://github.com/JPLeRouzic/Coralie/tree/main/assets/voice"

    %% Styles
    classDef controller fill:#2374ab
    classDef model fill:#57a773
    classDef view fill:#ff8c42
    classDef plugin fill:#845ec2
    classDef external fill:#gray

    %% Legend
    subgraph Legend
        L1["Controller Components"]:::controller
        L2["Model Components"]:::model
        L3["View Components"]:::view
        L4["Plugin Components"]:::plugin
        L5["External Components"]:::external
    end
```
