# biznessology/workforce-wisdom-analytics architecture

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

- Interactive diagram: https://gitdiagram.com/biznessology/workforce-wisdom-analytics
- Repository: https://github.com/biznessology/workforce-wisdom-analytics

## Overview

##### Main Components
- • Entry Point & Build:
– index.html (located at the project root) acts as the HTML entry point.
– main.tsx in the src folder bootstraps the React application.
- • Application & Routing:
– App.tsx: The main application component that likely contains routing and global layout management.
- • Pages:
– Located in src/pages, these include ClientAcquisition.tsx, Dashboard.tsx, Index.tsx, NotFound.tsx, Profitability.tsx, and Recruitment.tsx. They represent the different views or routes in the application.
- • UI Components & Widgets:
– src/components contains higher-level components like ChartCard, DashboardLayout, HeaderBar, SideNavigation, StatCard, and TabsSection.
– Further division in src/components/charts (BarChart, LineChart, PieChart) indicates specialized chart components.
– The src/components/ui folder includes a comprehensive set of reusable UI components (e.g., accordion, alert-dialog, button, form, dialog, etc.) based on shadcn-ui.
- • Hooks and Utilities:
– Custom hooks in src/hooks (e.g., use-mobile and use-toast) support application behavior.
– Utility functions in src/lib (utils.ts) encapsulate common helper methods.

##### Relationships & Interactions
- Data and control flow starts from index.html where the app is loaded.
- main.tsx mounts the App component that orchestrates the rendering of pages and global state management.
- Each page (from src/pages) composes several UI components and custom hooks to deliver specific views.
- The components in src/components underpin the UI structure (layout components such as DashboardLayout, HeaderBar, and SideNavigation) and enable dynamic data visualization (e.g., ChartCard and its nested chart components).
- Reusable UI components (in src/components/ui) encapsulate design patterns and are used across multiple features.
- Utilities and hooks add behavior and shared logic across the application.

##### Architectural Patterns and Design Principles
- The project embraces a component-based design, which is clearly evident from the folder structure.
- UI components are designed to be reusable and modular.
- Separation of concerns is maintained by differentiating between layout components, page components, UI primitives, and logic (hooks and utils).
- The architecture also follows the principles of a traditional front-end stack built with a bundler (Vite) facilitating hot module replacement and rapid development.

##### Relevant Technologies and Frameworks
- Vite (build tool), React (for the component-based structure), TypeScript (ensuring type safety), shadcn-ui (for UI primitives and patterns), and Tailwind CSS (for styling).

##### Suggested Elements
- Create blocks or nodes for each of the following major components:
- Entry Point: index.html
- Bootstrapping Layer: main.tsx and App.tsx
- UI Layers: Pages (src/pages) and their connections to Components (src/components)
- Reusable UI Component Library: (src/components/ui)
- Domain-specific Components: e.g., DashboardLayout, HeaderBar, etc.
- Specialized Functionality: Chart components (src/components/charts)
- Supporting Logic: Hooks (src/hooks) and Utility Functions (src/lib)
- Application bootstrap (e.g., entry/index files & main.tsx)
- Presentation-level components (e.g., pages, layouts, UI components)
- Business logic & utility (hooks and libs)
- Configuration/build artifacts (Vite, Tailwind, tsconfig)

##### Additional Detail
- Annotations to indicate that the components in the UI library (src/components/ui) are largely derived from or inspired by shadcn-ui.
- That changes in either the Lovable web interface or local IDE (with development commands outlined in the README) affect the same core code structure.
- Optionally, add a note on version control (e.g., .gitignore) for completeness.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Entry["index.html"]:::bootstrap
    MTS["main.tsx"]:::bootstrap
    App["App.tsx"]:::bootstrap

    Entry --> MTS
    MTS --> App

    subgraph "Pages"
        CA["ClientAcquisition.tsx"]:::page
        Dash["Dashboard.tsx"]:::page
        Ind["Index.tsx"]:::page
        NF["NotFound.tsx"]:::page
        Prof["Profitability.tsx"]:::page
        Rec["Recruitment.tsx"]:::page
    end
    App -->|"renders"| CA
    App -->|"renders"| Dash
    App -->|"renders"| Ind
    App -->|"renders"| NF
    App -->|"renders"| Prof
    App -->|"renders"| Rec

    subgraph "Layout Components"
        DL["DashboardLayout"]:::layout
        HB["HeaderBar"]:::layout
        SN["SideNavigation"]:::layout
    end
    App -->|"includes"| DL
    App -->|"includes"| HB
    App -->|"includes"| SN

    subgraph "General UI Components"
        CC["ChartCard"]:::ui
        SC["StatCard"]:::ui
        TS["TabsSection"]:::ui
    end
    DL -->|"uses"| CC
    DL -->|"uses"| SC
    DL -->|"uses"| TS

    subgraph "Chart Components"
        BC["BarChart"]:::ui
        LC["LineChart"]:::ui
        PC["PieChart"]:::ui
    end
    CC -->|"integrates"| BC
    CC -->|"integrates"| LC
    CC -->|"integrates"| PC

    subgraph "UI Library"
        UILib["Reusable UI (shadcn-ui)"]:::ui
    end
    App -->|"utilizes"| UILib

    subgraph "Hooks"
        Mobile["use-mobile"]:::hook
        Toast["use-toast"]:::hook
    end
    App -->|"hooks"| Mobile
    App -->|"hooks"| Toast

    subgraph "Utility Functions"
        Utils["utils.ts"]:::util
    end
    App -->|"uses"| Utils

    %% Click Events
    click Entry "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/index.html"
    click MTS "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/main.tsx"
    click App "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/App.tsx"
    click CA "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/pages/ClientAcquisition.tsx"
    click Dash "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/pages/Dashboard.tsx"
    click Ind "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/pages/Index.tsx"
    click NF "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/pages/NotFound.tsx"
    click Prof "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/pages/Profitability.tsx"
    click Rec "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/pages/Recruitment.tsx"
    click DL "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/DashboardLayout.tsx"
    click HB "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/HeaderBar.tsx"
    click SN "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/SideNavigation.tsx"
    click CC "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/ChartCard.tsx"
    click SC "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/StatCard.tsx"
    click TS "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/TabsSection.tsx"
    click BC "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/charts/BarChart.tsx"
    click LC "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/charts/LineChart.tsx"
    click PC "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/components/charts/PieChart.tsx"
    click UILib "https://github.com/biznessology/workforce-wisdom-analytics/tree/main/src/components/ui"
    click Mobile "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/hooks/use-mobile.tsx"
    click Toast "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/biznessology/workforce-wisdom-analytics/blob/main/src/lib/utils.ts"

    %% Styles
    classDef bootstrap fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef page fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef layout fill:#FFC0CB,stroke:#000,stroke-width:2px;
    classDef ui fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef hook fill:#DDA0DD,stroke:#000,stroke-width:2px;
    classDef util fill:#FFD700,stroke:#000,stroke-width:2px;
```
