# jotredev/adminmkt-free architecture

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

- Interactive diagram: https://gitdiagram.com/jotredev/adminmkt-free
- Repository: https://github.com/jotredev/adminmkt-free

## Overview

##### Main Components
- Frontend Application: Represented by the Next.js app found in the “src/app” directory. Split this into two areas:
- Dashboard Section: Contains pages for home, campaigns management, leads management, pricing, products, transactions.
- Authentication Section: Contains login and register pages.
- UI Components Library: Captured in the “src/components” directory with subdivisions such as charts, forms, pages (each dashboard page’s components), and custom UI elements (e.g., headers, navs, sidebar, cards).
- Global Assets & Styles: Illustrate the “public” folder for images and global styling through “src/app/globals.css”, “tailwind.config.ts”, and support for custom theming via “src/providers” (e.g., theme-provider.tsx).
- Utility & Type Systems: Note “src/lib” for utilities and “src/types” for TypeScript definitions to enforce type safety.
- Build & Configuration Files: Position configuration scripts from files such as “next.config.ts”, “eslint.config.mjs”, “postcss.config.mjs”, “tsconfig.json”, and package management files.

##### Relationships and Interactions
- The Next.js Layer (src/app) functions as the orchestration layer routing requests to the appropriate pages (dashboard or auth).
- Within each page, UI components (found in src/components and its subdirectories) are composed to render tables, charts, cards, forms, etc.
- The Theme Provider and global state provider (in src/providers) wrap the entire application to enable consistent theming and state management across pages.
- Utility functions (src/lib) and type definitions (src/types) support the overall business logic and ensure type consistency across the frontend layers.
- Configuration and build files connect the development/deployment process with the application’s folder structure ensuring smooth build and linting processes.

##### Architectural Patterns and Design Principles
- File-Based Routing: Leveraged by Next.js, where directories under “src/app” directly represent various routes, such as authentication and different dashboard modules.
- Component-Based UI: Emphasize reusability by the many separated UI components grouped by purpose (charts, forms, navigation, etc.).
- Separation of Concerns: The clear division between authentication pages, dashboard pages, shared UI components, providers, and utility functions.
- Theming and Responsiveness: Visual design is controlled centrally using Tailwind CSS and Shadcn, ensuring a responsive and pixel-perfect design.

##### Directions
- External relationships (for example, the browser rendering the UI and the server’s role via Next.js if applicable, even though most interactions are client-side).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser("Browser"):::external

    subgraph "Frontend Application"
        subgraph "Dashboard Pages"
            DH("Dashboard Home"):::page
            CM("Campaigns Management"):::page
            LM("Leads Management"):::page
            P("Pricing"):::page
            PR("Products"):::page
            T("Transactions"):::page
        end
        subgraph "Auth Pages"
            L("Login"):::page
            R("Register"):::page
        end
    end

    subgraph "UI Components Library"
        CH("Charts"):::component
        FO("Forms"):::component
        PC("Pages Components"):::component
        UC("UI Custom"):::component
        UI("UI"):::component
    end

    subgraph "Global Assets & Styles"
        PA("Public Assets"):::assets
        GS("Global Styles"):::assets
        TC("Tailwind Config"):::assets
    end

    subgraph "Providers"
        TP("Theme Provider"):::provider
    end

    subgraph "Utility & Type Systems"
        LU("Lib Utilities"):::utility
        TDs("Type Definitions"):::utility
    end

    subgraph "Build & Configuration Files"
        NC("Next Config"):::config
        EC("ESLint Config"):::config
        PCSS("PostCSS Config"):::config
        TSC("TypeScript Config"):::config
        PF("Package Files"):::config
    end

    %% Relationships and Interactions
    Browser --> L
    Browser --> DH
    L -->|"loginSuccess"| DH

    TP --> L
    TP --> DH

    DH -->|"usesUI"| CH
    DH -->|"utilize"| LU
    DH -->|"typeCheck"| TDs

    PA --> DH
    GS --> DH
    TC --> DH
    PA --> L
    GS --> L
    TC --> L

    NC --> DH
    EC --> DH
    PCSS --> DH
    TSC --> DH
    PF --> DH

    %% Class Definitions for Colors
    classDef page fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef component fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef assets fill:#abebc6,stroke:#27ae60,stroke-width:2px;
    classDef provider fill:#f5b7b1,stroke:#c0392b,stroke-width:2px;
    classDef utility fill:#d2b4de,stroke:#8e44ad,stroke-width:2px;
    classDef config fill:#f9c5d1,stroke:#e74c3c,stroke-width:2px;
    classDef external fill:#f4d03f,stroke:#f39c12,stroke-width:2px;

    %% Click Events
    click DH "https://github.com/jotredev/adminmkt-free/tree/main/src/app/(dashboard)/(home)"
    click CM "https://github.com/jotredev/adminmkt-free/tree/main/src/app/(dashboard)/campaigns-management"
    click LM "https://github.com/jotredev/adminmkt-free/tree/main/src/app/(dashboard)/leads-management"
    click P "https://github.com/jotredev/adminmkt-free/tree/main/src/app/(dashboard)/pricing"
    click PR "https://github.com/jotredev/adminmkt-free/tree/main/src/app/(dashboard)/products"
    click T "https://github.com/jotredev/adminmkt-free/tree/main/src/app/(dashboard)/transactions"
    click L "https://github.com/jotredev/adminmkt-free/tree/main/src/app/auth/login"
    click R "https://github.com/jotredev/adminmkt-free/tree/main/src/app/auth/register"
    click CH "https://github.com/jotredev/adminmkt-free/tree/main/src/components/charts"
    click FO "https://github.com/jotredev/adminmkt-free/tree/main/src/components/forms"
    click PC "https://github.com/jotredev/adminmkt-free/tree/main/src/components/pages"
    click UC "https://github.com/jotredev/adminmkt-free/tree/main/src/components/ui-custom"
    click UI "https://github.com/jotredev/adminmkt-free/tree/main/src/components/ui"
    click PA "https://github.com/jotredev/adminmkt-free/tree/main/public"
    click GS "https://github.com/jotredev/adminmkt-free/blob/main/src/app/globals.css"
    click TC "https://github.com/jotredev/adminmkt-free/blob/main/tailwind.config.ts"
    click TP "https://github.com/jotredev/adminmkt-free/blob/main/src/providers/theme-provider.tsx"
    click LU "https://github.com/jotredev/adminmkt-free/blob/main/src/lib/utils.ts"
    click TDs "https://github.com/jotredev/adminmkt-free/blob/main/src/types/auth.ts"
    click NC "https://github.com/jotredev/adminmkt-free/blob/main/next.config.ts"
    click EC "https://github.com/jotredev/adminmkt-free/blob/main/eslint.config.mjs"
    click PCSS "https://github.com/jotredev/adminmkt-free/blob/main/postcss.config.mjs"
    click TSC "https://github.com/jotredev/adminmkt-free/blob/main/tsconfig.json"
    click PF "https://github.com/jotredev/adminmkt-free/blob/main/package.json"
```
