# devforth/adminforth architecture

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

- Interactive diagram: https://gitdiagram.com/devforth/adminforth
- Repository: https://github.com/devforth/adminforth

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Framework Layer:
- SPA (Vue.js Frontend)
- Server Layer (Express.js)
- Data Connectors Layer
- Plugin System
- Authentication System

b) Integration Layer:
- Database Adapters (Postgres, MongoDB, SQLite, Clickhouse)
- External Service Adapters (OpenAI, AWS SES)

- Client Layer                                         |

- Vue.js SPA     |  |  Custom Pages     |  |  Built-in Components            |      |
- (src/views)     |  |  (custom/*.vue)   |  |  (ResourceForm, ResourceList)   |      |
- ^---------+  +---------^---------+  +----------------^---------------+      |

- Core Framework                                       |

- Auth Module    |  |  REST API Module  |  |  WebSocket Broker               |      |
- (auth.ts)      |  |  (restApi.ts)     |  |  (socketBroker.ts)             |      |
- ^---------+  +---------^---------+  +----------------^---------------+      |

- Plugin System   |  |  Style Generator  |                   |                      |
- (basePlugin.ts) |  |  (styles.ts)      |                   |                      |
- ^---------+  +-------------------+                   |                      |

- Integration Layer                                     |

- Data Connectors  |  |     Adapters      |  |           Plugins               |      |
- Postgres       |  | - OpenAI          |  | - Audit Log                     |      |
- MongoDB        |  | - AWS SES         |  | - Two-Factor Auth              |      |
- SQLite         |  |                   |  | - Rich Editor                   |      |
- Clickhouse     |  |                   |  | - Upload                        |      |

##### Additional Elements

- Component types
- Plugin integration points

##### Technical Details

- Vue.js + Tailwind as frontend framework
- Express.js as backend framework
- Supported databases
- Available plugins
- Authentication methods
- API endpoints structure

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#FF9966,stroke:#333,stroke-width:2px
    classDef core fill:#6699CC,stroke:#333,stroke-width:2px
    classDef integration fill:#99CC99,stroke:#333,stroke-width:2px
    classDef external fill:#CCCCCC,stroke:#333,stroke-width:2px

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        VueSPA["Vue.js SPA"]
        CustomPages["Custom Pages"]
        Components["Built-in Components"]
        ResourceForm["Resource Form"]
        ResourceList["Resource List"]
    end

    %% Core Framework Layer
    subgraph CoreLayer["Core Framework"]
        Auth["Authentication Module"]
        RestAPI["REST API Module"]
        WebSocket["WebSocket Broker"]
        PluginSystem["Plugin System"]
        StyleGen["Style Generator"]
    end

    %% Integration Layer
    subgraph IntegrationLayer["Integration Layer"]
        %% Data Connectors
        subgraph DataConnectors["Data Connectors"]
            Postgres["Postgres"]
            MongoDB["MongoDB"]
            SQLite["SQLite"]
            Clickhouse["Clickhouse"]
        end

        %% External Adapters
        subgraph Adapters["External Adapters"]
            OpenAI["OpenAI"]
            AWSSES["AWS SES"]
        end

        %% Plugins
        subgraph Plugins["Plugins"]
            AuditLog["Audit Log"]
            TwoFactor["Two-Factor Auth"]
            RichEditor["Rich Editor"]
            Upload["Upload"]
        end
    end

    %% Relationships
    VueSPA <--> RestAPI
    CustomPages <--> RestAPI
    Components <--> RestAPI
    RestAPI <--> WebSocket
    Auth <--> RestAPI
    PluginSystem --> CoreLayer
    DataConnectors --> CoreLayer
    Adapters --> CoreLayer
    Plugins --> PluginSystem

    %% Component Styling
    class VueSPA,CustomPages,Components,ResourceForm,ResourceList frontend
    class Auth,RestAPI,WebSocket,PluginSystem,StyleGen core
    class DataConnectors,Adapters,Plugins,AuditLog,TwoFactor,RichEditor,Upload integration
    class OpenAI,AWSSES,Postgres,MongoDB,SQLite,Clickhouse external

    %% Click Events
    click VueSPA "https://github.com/devforth/adminforth/tree/main/adminforth/spa/"
    click Auth "https://github.com/devforth/adminforth/blob/main/adminforth/auth.ts"
    click PluginSystem "https://github.com/devforth/adminforth/blob/main/adminforth/basePlugin.ts"
    click RestAPI "https://github.com/devforth/adminforth/blob/main/adminforth/modules/restApi.ts"
    click WebSocket "https://github.com/devforth/adminforth/blob/main/adminforth/modules/socketBroker.ts"
    click StyleGen "https://github.com/devforth/adminforth/blob/main/adminforth/modules/styleGenerator.ts"
    click Postgres "https://github.com/devforth/adminforth/blob/main/adminforth/dataConnectors/postgres.ts"
    click MongoDB "https://github.com/devforth/adminforth/blob/main/adminforth/dataConnectors/mongo.ts"
    click SQLite "https://github.com/devforth/adminforth/blob/main/adminforth/dataConnectors/sqlite.ts"
    click Clickhouse "https://github.com/devforth/adminforth/blob/main/adminforth/dataConnectors/clickhouse.ts"
    click OpenAI "https://github.com/devforth/adminforth/tree/main/adminforth/adapters/completion-adapter-open-ai-chat-gpt/"
    click AWSSES "https://github.com/devforth/adminforth/tree/main/adminforth/adapters/email-adapter-aws-ses/"
    click AuditLog "https://github.com/devforth/adminforth/tree/main/adminforth/plugins/audit-log/"
    click TwoFactor "https://github.com/devforth/adminforth/tree/main/adminforth/plugins/two-factors-auth/"
    click RichEditor "https://github.com/devforth/adminforth/tree/main/adminforth/plugins/rich-editor/"
    click Upload "https://github.com/devforth/adminforth/tree/main/adminforth/plugins/upload/"
    click ResourceForm "https://github.com/devforth/adminforth/blob/main/adminforth/spa/src/components/ResourceForm.vue"
    click ResourceList "https://github.com/devforth/adminforth/blob/main/adminforth/spa/src/components/ResourceListTable.vue"
```
