# piyushpowariou/sunbustintegration architecture

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

- Interactive diagram: https://gitdiagram.com/piyushpowariou/sunbustintegration
- Repository: https://github.com/piyushpowariou/sunbustintegration

## Overview

##### File structure
- Top-level
- package.json, tsconfig.json, vite.config.ts, tailwind.config.js, drizzle.config.ts
- attached_assets: raw CSV exports (company.csv, project.csv, riskitemcases.csv, etc.)
- client/
- index.html, main.tsx – React entry point
- src/pages – route components (dashboard.tsx, not-found.tsx)
- src/components – presentation and chart components (sunburst-chart, filter-sidebar, selection-details)
- src/components/ui – reusable UI primitives (buttons, dialogs, tables, etc.)
- src/hooks – data-fetching and transform hooks (use-sunburst-data.ts, use-filters.ts)
- src/lib – queryClient setup, sunburst-transformer logic, shared utilities
- server/
- index.ts – server bootstrap (Vite + Node)
- routes.ts – REST endpoints for fetching chart data and metadata
- storage.ts – data access layer to the database (CRUD operations)
- vite.ts – server Vite config for development
- shared/
- schema.ts – Drizzle ORM definitions for tables matching attached_assets

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Client (Browser)"
        direction TB
        main["client/src/main.tsx"]:::frontend
        app["client/src/App.tsx"]:::frontend
        subgraph "UI Components"
            direction TB
            sunburst["client/src/components/sunburst-chart.tsx"]:::frontend
            sunburstFixed["client/src/components/sunburst-chart-fixed.tsx"]:::frontend
            sunburstSimple["client/src/components/sunburst-chart-simple.tsx"]:::frontend
            sunburstZoom["client/src/components/sunburst-chart-zooming.tsx"]:::frontend
            filter["client/src/components/filter-sidebar.tsx"]:::frontend
            details["client/src/components/selection-details.tsx"]:::frontend
        end
        subgraph "Layout Components"
            direction TB
            header["client/src/components/layout/header.tsx"]:::frontend
            footer["client/src/components/layout/footer.tsx"]:::frontend
        end
        subgraph "UI Primitives"
            direction TB
            uiLib["client/src/components/ui/"]:::frontend
        end
        subgraph "Custom Hooks & Data"
            direction TB
            hooks1["client/src/hooks/use-sunburst-data.ts"]:::frontend
            hooks2["client/src/hooks/use-filters.ts"]:::frontend
            hooks3["client/src/hooks/use-mobile.tsx"]:::frontend
            hooks4["client/src/hooks/use-toast.ts"]:::frontend
            query["client/src/lib/queryClient.ts"]:::frontend
            transformer["client/src/lib/sunburst-transformer.ts"]:::frontend
            utils["client/src/lib/utils.ts"]:::frontend
        end
        subgraph "Pages"
            direction TB
            dashboard["client/src/pages/dashboard.tsx"]:::frontend
            notfound["client/src/pages/not-found.tsx"]:::frontend
        end
    end

    subgraph "Server (API)"
        direction TB
        serverIndex["server/index.ts"]:::backend
        serverVite["server/vite.ts"]:::backend
        rootVite["vite.config.ts"]:::backend
        routes["server/routes.ts"]:::backend
        storage["server/storage.ts"]:::orm
        config["drizzle.config.ts"]:::orm
        schema["shared/schema.ts"]:::orm
    end

    db["Database"]:::external

    subgraph "External Assets"
        direction TB
        csv1["attached_assets/company.csv"]:::external
        csv2["attached_assets/departement.csv"]:::external
        csv3["attached_assets/location.csv"]:::external
        csv4["attached_assets/project.csv"]:::external
        csv5["attached_assets/projectasset.csv"]:::external
        csv6["attached_assets/projectassetdetails.csv"]:::external
        csv7["attached_assets/riskitemcases.csv"]:::external
    end

    %% Connections
    main -->|"renders App"| app
    app -->|"routes to Dashboard"| dashboard
    app -->|"routes to NotFound"| notfound
    dashboard -->|"uses Sunburst Chart"| sunburst
    sunburst -->|"fetch via React Query"| query
    query -->|"calls API"| routes
    routes -->|"queries"| storage
    storage -->|"reads/writes"| db
    csv1 -->|"ETL import"| storage
    csv2 -->|"ETL import"| storage
    csv3 -->|"ETL import"| storage
    csv4 -->|"ETL import"| storage
    csv5 -->|"ETL import"| storage
    csv6 -->|"ETL import"| storage
    csv7 -->|"ETL import"| storage
    schema -->|"defines ORM schema"| storage
    schema -->|"provides types"| sunburst

    %% Styles
    classDef frontend fill:#ddeeff,stroke:#0000ff
    classDef backend fill:#ddffdd,stroke:#00aa00
    classDef orm fill:#ffe5cc,stroke:#ff9900
    classDef external fill:#eeeeee,stroke:#999999,stroke-dasharray:5 5

    %% Click Events
    click main "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/main.tsx"
    click app "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/App.tsx"
    click sunburst "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/sunburst-chart.tsx"
    click sunburstFixed "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/sunburst-chart-fixed.tsx"
    click sunburstSimple "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/sunburst-chart-simple.tsx"
    click sunburstZoom "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/sunburst-chart-zooming.tsx"
    click filter "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/filter-sidebar.tsx"
    click details "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/selection-details.tsx"
    click header "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/layout/header.tsx"
    click footer "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/components/layout/footer.tsx"
    click uiLib "https://github.com/piyushpowariou/sunbustintegration/tree/main/client/src/components/ui/"
    click query "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/lib/queryClient.ts"
    click transformer "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/lib/sunburst-transformer.ts"
    click utils "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/lib/utils.ts"
    click hooks1 "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/hooks/use-sunburst-data.ts"
    click hooks2 "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/hooks/use-filters.ts"
    click hooks3 "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/hooks/use-mobile.tsx"
    click hooks4 "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/hooks/use-toast.ts"
    click dashboard "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/pages/dashboard.tsx"
    click notfound "https://github.com/piyushpowariou/sunbustintegration/blob/main/client/src/pages/not-found.tsx"
    click serverIndex "https://github.com/piyushpowariou/sunbustintegration/blob/main/server/index.ts"
    click serverVite "https://github.com/piyushpowariou/sunbustintegration/blob/main/server/vite.ts"
    click rootVite "https://github.com/piyushpowariou/sunbustintegration/blob/main/vite.config.ts"
    click routes "https://github.com/piyushpowariou/sunbustintegration/blob/main/server/routes.ts"
    click storage "https://github.com/piyushpowariou/sunbustintegration/blob/main/server/storage.ts"
    click config "https://github.com/piyushpowariou/sunbustintegration/blob/main/drizzle.config.ts"
    click schema "https://github.com/piyushpowariou/sunbustintegration/blob/main/shared/schema.ts"
    click csv1 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/company.csv"
    click csv2 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/departement.csv"
    click csv3 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/location.csv"
    click csv4 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/project.csv"
    click csv5 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/projectasset.csv"
    click csv6 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/projectassetdetails.csv"
    click csv7 "https://github.com/piyushpowariou/sunbustintegration/blob/main/attached_assets/riskitemcases.csv"
```
