# epix-incorporated/adonis architecture

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

- Interactive diagram: https://gitdiagram.com/epix-incorporated/adonis
- Repository: https://github.com/epix-incorporated/adonis

## Overview

##### Project Type and Purpose
- This is an open-source, community-maintained admin/moderation system for Roblox games. It provides both server-side command handling and client-side UI components, delivered as a Roblox Model (`.rbxmx`) or via a Rojo build, and runs entirely within the Roblox runtime (Studio and Game Server).

##### High-Level File Structure Analysis
- Top-Level Folders
- Loader/ – The entrypoint “Adonis_Loader” model under ServerScriptService
– Config (Settings, API, Plugins, Themes)
– Loader.server.luau – reads Config, loads MainModule either remote or local (DebugMode)
- MainModule/ – Core logic split by execution context
– Client/ – Client-side controllers, core functions, remotes, UI library, theming, UI plugins
– Server/ – Server-side command definitions, core services (Admin, HTTP, Logs), third-party dependencies, datastore mocks, Plugins
– Shared/ – Common utilities, data structures, type checking, script‐loading helpers
- Ancillary Files
- build scripts (build.bat, build.sh, aftman.toml, default.project.json)
- CI/CD and lint configs under .github/ and selene.toml
- README.md, CONTRIBUTING.md, LICENSE, SECURITY.md

##### Key README Insights
- Loader Model is inserted in ServerScriptService.
- It can operate in DebugMode to load MainModule locally for development.
- MainModule is fetched by loader remotely in production, or loaded from the hierarchy in DebugMode.
- Configuration is driven entirely by the Settings Module under Loader/Config.

a. Main Components
1. Roblox Runtime
– Client (Players’ game clients)
– Server (Roblox Game Server)
– Core Roblox Services: Players, DataStoreService, HTTPService, RemoteEvents/Functions
2. Adonis Loader
– Config Module (Settings, API, Plugins list, Themes)
– Loader.server.luau
3. Adonis MainModule
– Client Side: Core controllers, UI themes, UI component library (Roact/Winro-based), Remote communication stubs
– Server Side: Command registry, Core (Admin, Anti-Cheat, HTTP wrapper, Logging, Process), Plugin loader, DataStore mocks for testing
– Shared: Utilities, Type checking, Data structures
4. External Dependencies
– Roblox’s DataStoreService (persistent key-value storage)
– Optional HTTP endpoints (Trello API, webhooks)
– Roact, Flipper, Maid, Sift, Signal, Winro (bundled in UI packages)

b. Relationships & Interactions
- Loader → MainModule: loads via `require` from either the network (Production) or local hierarchy (DebugMode)
- Client ↔ Server:
- Client components invoke server commands via RemoteFunctions/RemoteEvents defined in Shared/Remote.luau
- Server processes commands, uses Core and Plugins, writes/reads from DataStoreService
- Server emits updates back to clients (e.g., notification events, UI updates)
- Shared modules are required by both Client and Server to ensure consistency (e.g., Service.luau, Typechecker.luau)
- Config modules drive plugin registration on both Client and Server

c. Architectural Patterns & Principles
- Client-Server Partitioning: clear separation between client UI logic and server authority.
- Plugin Architecture: both client and server load feature modules from a Plugins directory, enabling extensibility.
- Configuration-Driven: central Settings module controls DataStore keys, debug flags, enabled plugins.
- Shared Codebase: common utilities and data models reused across contexts for consistency.

d. Technologies & Frameworks
- Luau (Roblox’s typed Lua dialect)
- Rojo (for local filesystem syncing)
- Roact, Flipper, Maid, Signal, Winro (for client UI components)
- Roblox RemoteEvents/RemoteFunctions (for RPC between client/server)
- Roblox DataStoreService (for persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Loader Entrypoint and Configuration
    subgraph "ServerScriptService"
        Loader["Adonis Loader\nLoader.server.luau"]:::loader
    end
    Loader -->|"DebugMode"| LocalMain["MainModule (Local)"]:::loader
    Loader -->|"Production require"| NetMain["MainModule (Network)"]:::loader

    subgraph "Loader Configuration"
        Settings["Settings.luau"]:::config
        API["API.luau"]:::config
        ConfigPlugins["Plugins (client/server)"]:::config
        Themes["Themes/README.luau"]:::config
    end
    Loader --> Settings
    Loader --> API
    Loader --> ConfigPlugins
    Loader --> Themes

    %% MainModule contexts
    subgraph "MainModule"
        subgraph "Client Context" 
            CClient["Client.luau"]:::client
            CCore["Client/Core\n(Anti, Core, Functions,\nProcess, Remote, UI, Variables)"]:::client
            CDeps["Client/Dependencies\nTheming_Info.luau"]:::client
            CPlugins["Client/Plugins\n(Anti_Cheat, Misc_Features)"]:::client
            CUI["Client/UI\n(Aero, BasicAdmin, Colorize,\nDefault, Mobilius, Modern,\nModernLight, Rounded,\nSteampunk, TransBlack,\nUnity, Windows XP)"]:::client
        end

        subgraph "Server Context"
            SServer["Server.luau"]:::server
            SCommands["Server/Commands\n(Admins, Creators,\nDonors, Fun, HeadAdmins,\nModerators, Players)"]:::server
            SCore["Server/Core\n(Admin, Anti, Commands,\nCore, Functions, HTTP,\nLogs, Process, Remote,\nVariables)"]:::server
            SDeps["Server/Dependencies\n(Assets, DataStoreService mock,\nLoadstring, TrelloAPI, etc)"]:::server
            SPlugins["Server/Plugins\n(Adonis_Agents, Anti_Cheat,\nCross_Server, Debug_Specific,\nFindExistingObjects, Misc_Features,\nServer-SoftShutdown, ServerNewDex,\nTrello, Urgent_Messages)"]:::server
        end

        subgraph "Shared"
            Svc["Service.luau"]:::shared
            TC["Typechecker.luau"]:::shared
            Signal["GoodSignal.luau"]:::shared
            DLL["DoubleLinkedList.luau"]:::shared
            Libs["Other Shared Utilities\n(AudioLib, HashLib,\nKeycodeNames, MatIcons,\nChangelog, Credits)"]:::shared
        end
    end

    %% Data flow and Interactions
    LocalMain --> CClient
    LocalMain --> SServer
    LocalMain --> Svc

    NetMain --> CClient
    NetMain --> SServer
    NetMain --> Svc

    CClient -->|"RemoteEvents/Functions"| SServer
    SServer -->|"writes/reads"| DataStore["DataStoreService"]:::external
    SServer -->|"HTTP calls"| HTTP["HTTPService"]:::external
    SServer -->|"notifications"| CClient

    CClient --> UIFramework["Roact/Flipper/Maid/Signal/Winro"]:::external

    %% Build & CI/CD
    BuildScripts["Build & Packaging\n(build.bat, build.sh,\ndefault.project.json,\naftman.toml)"]:::tools
    CI["CI/CD & Lint\n(.github/workflows, selene.toml,\nlabeler.yml, alerts/publish configs)"]:::tools
    BuildScripts -->|"produces .rbxmx/rojo build"| Loader
    CI --> BuildScripts

    %% Click Events
    click Loader "https://github.com/epix-incorporated/adonis/blob/master/Loader/Loader/Loader.server.luau"
    click Settings "https://github.com/epix-incorporated/adonis/blob/master/Loader/Config/Settings.luau"
    click API "https://github.com/epix-incorporated/adonis/blob/master/Loader/Config/API.luau"
    click ConfigPlugins "https://github.com/epix-incorporated/adonis/tree/master/Loader/Config/Plugins/"
    click Themes "https://github.com/epix-incorporated/adonis/blob/master/Loader/Config/Themes/README.luau"
    click CClient "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Client/Client.luau"
    click CCore "https://github.com/epix-incorporated/adonis/tree/master/MainModule/Client/Core/"
    click CDeps "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Client/Dependencies/Theming_Info [Read].luau"
    click CPlugins "https://github.com/epix-incorporated/adonis/tree/master/MainModule/Client/Plugins/"
    click SServer "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Server/Server.luau"
    click SCommands "https://github.com/epix-incorporated/adonis/tree/master/MainModule/Server/Commands/"
    click SCore "https://github.com/epix-incorporated/adonis/tree/master/MainModule/Server/Core/"
    click SDeps "https://github.com/epix-incorporated/adonis/tree/master/MainModule/Server/Dependencies/"
    click SPlugins "https://github.com/epix-incorporated/adonis/tree/master/MainModule/Server/Plugins/"
    click Svc "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Shared/Service.luau"
    click TC "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Shared/Typechecker.luau"
    click Signal "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Shared/GoodSignal.luau"
    click DLL "https://github.com/epix-incorporated/adonis/blob/master/MainModule/Shared/DoubleLinkedList.luau"

    %% Styles
    classDef loader fill:#FFD580,stroke:#D38B00,color:#000;
    classDef config fill:#FFF2CC,stroke:#D6B656,color:#000;
    classDef client fill:#CFE2F3,stroke:#6D9EEB,color:#000;
    classDef server fill:#F4CCCC,stroke:#CC0000,color:#000;
    classDef shared fill:#D9EAD3,stroke:#6AA84F,color:#000;
    classDef external fill:#EAD1DC,stroke:#A64D79,color:#000;
    classDef tools fill:#E1D5E7,stroke:#8E7CC3,color:#000;
```
