# mehedijaman/modular architecture

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

- Interactive diagram: https://gitdiagram.com/mehedijaman/modular
- Repository: https://github.com/mehedijaman/modular

## Overview

##### Main Components

a) Core Framework Layer:
- Laravel Backend (Base)
- Vue.js Frontend
- Inertia.js Bridge
- Tailwind CSS Styling

b) Modular Architecture:
- Module System
- Service Providers
- Core Modules:
- ACL (Access Control)
- AdminAuth
- Dashboard
- Support
- User

c) Component Architecture:
- Custom Vue Components
- Form Components
- DataTable Components
- UI Components
- Overlay Components

**┌─ Client Layer ─────────────────────────────┐**
- Vue.js Components                          │
- Auth Components                         │
- DataTable Components                    │
- Form Components                         │
- Menu Components                         │
- Overlay Components                      │
- Bridge Layer ─────────────────────────────┤
- Inertia.js                                │
- Backend Layer ────────────────────────────┤
- Laravel Framework                          │
- Module System                          │
- ACL Module                          │
- AdminAuth Module                    │
- Dashboard Module                    │
- Support Module                      │
- User Module                         │
- Core Services                          │
- ┘

##### Key Relationships to Highlight

- Bidirectional communication between Vue components and Laravel backend through Inertia.js
- Module dependencies and interactions
- ACL system's integration with other modules
- How the Support module provides base functionality to other modules

##### Important Elements

- Command system for module generation
- Translation system
- Testing framework integration
- Frontend build pipeline
- Module generation system
- Service provider registration flow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Layer"]
        direction TB
        VueComponents["Vue.js Components"]:::frontend
        AuthComp["Auth Components"]:::frontend
        DataTableComp["DataTable Components"]:::frontend
        FormComp["Form Components"]:::frontend
        MenuComp["Menu Components"]:::frontend
        OverlayComp["Overlay Components"]:::frontend
        
        VueComponents --> AuthComp & DataTableComp & FormComp & MenuComp & OverlayComp
    end

    subgraph Bridge["Bridge Layer"]
        direction TB
        Inertia["Inertia.js"]:::bridge
    end

    subgraph Backend["Backend Layer"]
        direction TB
        Laravel["Laravel Framework"]:::backend
        
        subgraph ModuleSystem["Module System"]
            direction TB
            ACL["ACL Module"]:::module
            AdminAuth["AdminAuth Module"]:::module
            Dashboard["Dashboard Module"]:::module
            Support["Support Module"]:::module
            User["User Module"]:::module
        end
        
        subgraph CoreServices["Core Services"]
            direction TB
            ServiceProvider["Main Service Provider"]:::service
            ModuleGen["Module Generation"]:::service
            BaseControllers["Base Controllers"]:::service
            BaseModel["Base Model"]:::service
        end
        
        Laravel --> ModuleSystem
        Laravel --> CoreServices
    end

    subgraph BuildSystem["Build System"]
        direction TB
        Vite["Vite Config"]:::build
        Tailwind["Tailwind Config"]:::build
        MainJS["Main JS Entry"]:::build
    end

    subgraph Testing["Testing Framework"]
        direction TB
        TestCase["Base Test Case"]:::test
        ModuleTests["Module Tests"]:::test
        CommandTests["Command Tests"]:::test
    end

    Client <--> Bridge
    Bridge <--> Backend
    BuildSystem --> Client
    Testing --> Backend

    %% Click Events
    click AuthComp "https://github.com/mehedijaman/modular/tree/main/stubs/resources/js/Components/Auth/"
    click DataTableComp "https://github.com/mehedijaman/modular/tree/main/stubs/resources/js/Components/DataTable/"
    click FormComp "https://github.com/mehedijaman/modular/tree/main/stubs/resources/js/Components/Form/"
    click MenuComp "https://github.com/mehedijaman/modular/tree/main/stubs/resources/js/Components/Menu/"
    click OverlayComp "https://github.com/mehedijaman/modular/tree/main/stubs/resources/js/Components/Overlay/"
    click ACL "https://github.com/mehedijaman/modular/tree/main/stubs/modules/Acl/"
    click AdminAuth "https://github.com/mehedijaman/modular/tree/main/stubs/modules/AdminAuth/"
    click Dashboard "https://github.com/mehedijaman/modular/tree/main/stubs/modules/Dashboard/"
    click Support "https://github.com/mehedijaman/modular/tree/main/stubs/modules/Support/"
    click User "https://github.com/mehedijaman/modular/tree/main/stubs/modules/User/"
    click ServiceProvider "https://github.com/mehedijaman/modular/blob/main/src/ModularServiceProvider.php"
    click ModuleGen "https://github.com/mehedijaman/modular/tree/main/src/Console/"
    click BaseControllers "https://github.com/mehedijaman/modular/tree/main/stubs/modules/Support/Http/Controllers/"
    click BaseModel "https://github.com/mehedijaman/modular/blob/main/stubs/modules/Support/Models/BaseModel.php"
    click Vite "https://github.com/mehedijaman/modular/blob/main/stubs/stack-configs/vite.config.js"
    click Tailwind "https://github.com/mehedijaman/modular/blob/main/stubs/stack-configs/tailwind.config.cjs"
    click MainJS "https://github.com/mehedijaman/modular/blob/main/stubs/resources/js/app.js"
    click TestCase "https://github.com/mehedijaman/modular/blob/main/tests/TestCase.php"
    click ModuleTests "https://github.com/mehedijaman/modular/tree/main/stubs/modules/*/Tests/"
    click CommandTests "https://github.com/mehedijaman/modular/tree/main/tests/Console/"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef bridge fill:#9b59b6,stroke:#8e44ad,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef module fill:#e67e22,stroke:#d35400,color:white
    classDef service fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef build fill:#f1c40f,stroke:#f39c12,color:black
    classDef test fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Components"]:::frontend
        BridgeL["Bridge Layer"]:::bridge
        BackendL["Backend Components"]:::backend
        ModuleL["Modules"]:::module
        ServiceL["Services"]:::service
        BuildL["Build System"]:::build
        TestL["Testing"]:::test
    end
```
