# robbins23/admin-dashboard-nextjs-typescript-daisyui-template architecture

> Architecture diagram of the GitHub repository robbins23/admin-dashboard-nextjs-typescript-daisyui-template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template
- Repository: https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template

## Overview

##### Main System Components

a) Client-Side (Frontend) Layer:
- Next.js App Router Structure
- Redux State Management
- UI Components Layer
- Authentication Layer

b) Feature Modules:
- Dashboard
- Leads Management
- Settings (Team & Billing)
- Authentication

##### Detailed Component Breakdown

- Separate protected and public routes (as seen in the file structure)
- Store Provider wrapper

B. State Management Layer (Top Section):
- Redux Store with feature slices:
- Header Slice
- Modal Slice
- Right Drawer Slice
- User Slice
- Lead Slice

C. Component Architecture (Left Section):
- Shared Components:
- Cards
- Input Components
- Typography
- Containers:
- Header
- Left Sidebar
- Right Sidebar
- Modal Layout

D. Feature Modules (Right Section):
- Dashboard
- Leads Management
- Settings
- Authentication

##### Interaction Flows

- Authentication flow between public and protected routes
- Redux state management flow
- API communication flow (based on axios initialization)
- Component composition flow

##### Technical Stack Indicators

A technical stack section showing:
- Next.js 14
- TypeScript
- Tailwind CSS + Daisy UI
- Redux Toolkit
- Authentication System

##### Additional Notes

Special considerations:
- Initialization flow from lib/init-app.ts
- Theming system with Daisy UI
- Authentication boundaries
- Modal and drawer system interaction

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Technical Stack"
        TS[Next.js 14 + TypeScript]
        TW[Tailwind CSS + Daisy UI]
        RT[Redux Toolkit]
        Auth[Authentication System]
    end

    subgraph "State Management"
        Store["Redux Store"]:::store
        click Store "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/lib/store.ts"
        StoreProvider["Store Provider"]:::store
        click StoreProvider "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/app/StoreProvider.tsx"
        
        HeaderSlice["Header Slice"]:::slice
        click HeaderSlice "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/features/common/headerSlice.ts"
        ModalSlice["Modal Slice"]:::slice
        click ModalSlice "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/features/common/modalSlice.ts"
        RightDrawerSlice["Right Drawer Slice"]:::slice
        click RightDrawerSlice "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/features/common/rightDrawerSlice.ts"
        UserSlice["User Slice"]:::slice
        click UserSlice "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/features/common/userSlice.ts"
        
        Store --> HeaderSlice
        Store --> ModalSlice
        Store --> RightDrawerSlice
        Store --> UserSlice
    end

    subgraph "Core Application"
        AppRouter["Next.js App Router"]:::core
        click AppRouter "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/app"
        
        subgraph "Routes"
            Protected["Protected Routes"]:::protected
            click Protected "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/app/(protected)"
            Public["Public Routes"]:::public
            click Public "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/app/(public)"
        end
        
        Init["Application Init"]:::init
        click Init "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/lib/init-app.ts"
        AxiosInit["Axios Init"]:::init
        click AxiosInit "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/lib/init-axios.ts"
        
        AuthSystem["Auth System"]:::auth
        click AuthSystem "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/lib/auth.ts"
        AuthProvider["Auth Provider"]:::auth
        click AuthProvider "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/lib/AuthProvider.tsx"
        Login["Login"]:::auth
        click Login "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/app/(public)/login"
    end

    subgraph "UI Components"
        Cards["Cards"]:::ui
        click Cards "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/components/cards"
        InputComponents["Input Components"]:::ui
        click InputComponents "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/components/input"
        Typography["Typography"]:::ui
        click Typography "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/components/typography"
    end

    subgraph "Containers"
        Header["Header"]:::container
        click Header "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/containers/header.tsx"
        LeftSidebar["Left Sidebar"]:::container
        click LeftSidebar "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/containers/left-sidebar.tsx"
        RightSidebar["Right Sidebar"]:::container
        click RightSidebar "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/containers/right-sidebar.tsx"
        ModalLayout["Modal Layout"]:::container
        click ModalLayout "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/blob/main/src/containers/modal-layout.tsx"
    end

    subgraph "Features"
        Dashboard["Dashboard"]:::feature
        click Dashboard "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/features/dashboard"
        Leads["Leads Management"]:::feature
        click Leads "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/features/leads"
        Settings["Settings"]:::feature
        click Settings "https://github.com/robbins23/admin-dashboard-nextjs-typescript-daisyui-template/tree/main/src/features/settings"
    end

    AppRouter --> Protected
    AppRouter --> Public
    Protected --> AuthSystem
    Public --> Login
    AuthSystem --> AuthProvider
    Init --> AxiosInit
    Init --> Store

    %% Styles
    classDef store fill:#90EE90
    classDef slice fill:#98FB98
    classDef core fill:#87CEEB
    classDef protected fill:#FFB6C1
    classDef public fill:#ADD8E6
    classDef init fill:#DDA0DD
    classDef auth fill:#FF6B6B
    classDef ui fill:#F0E68C
    classDef container fill:#D3D3D3
    classDef feature fill:#FFA07A

    %% Legend
    subgraph "Legend"
        L1["Store Components"]:::store
        L2["Core Components"]:::core
        L3["Protected Routes"]:::protected
        L4["Public Routes"]:::public
        L5["Init Components"]:::init
        L6["Auth Components"]:::auth
        L7["UI Components"]:::ui
        L8["Containers"]:::container
        L9["Features"]:::feature
    end
```
