# meetpateltech/convelyze architecture

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

- Interactive diagram: https://gitdiagram.com/meetpateltech/convelyze
- Repository: https://github.com/meetpateltech/convelyze

## Overview

##### Project type and purpose
- Convelyze is a single-page, client-side analytics dashboard built with Next.js (app router), React, and Tailwind CSS.
- Purpose: let end users upload their ChatGPT export JSON, process it entirely in the browser, and render interactive usage charts, metrics, and timelines.

##### File structure
- Top-level “app” directory: Next.js pages and layout (dashboard, demo, global CSS).
- “components” directory: UI atoms (shadcn/ui wrappers, buttons, cards), dashboard-specific widgets, footers, theme provider.
- “lib” directory: core data-analysis functions (ChatGPTDataAnalysis.ts, activityData.ts, utils.ts).
- “utils” directory: fileProcessor.ts (parses uploaded JSON), pricing.ts (API cost estimation).
- Config files (next.config.mjs, tailwind.config.ts, tsconfig.json) and Bun lockfile.
- No dedicated backend or database—everything runs in the browser under Next.js’s static hosting.

##### README for additional insights
- Emphasizes client-side privacy, open-source, and key tech: Next.js, Tailwind, Recharts, react-dropzone, html2canvas, react-confetti.
- Features: file upload flow, data parsing, visualization components, theme toggling, export dashboard as image.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Browser
    User["User"]:::user
    User -->|"interacts with"| Browser["Browser (Client)"]:::browser

    %% Client Browser grouping
    subgraph "Client Browser"
        direction TB

        %% Next.js Framework Layer
        subgraph "Next.js Framework" 
            direction TB
            Layout["app/layout.tsx"]:::nextjs
            Home["app/page.tsx"]:::nextjs
            DashboardPage["app/dashboard/page.tsx"]:::nextjs
            DemoPage["app/demo/page.tsx"]:::nextjs
        end

        %% UI Layer
        subgraph "UI & Visualization Layer"
            direction TB
            FileUploadUI["File Upload UI (react-dropzone)"]:::ui
            Visualization["Visualization Components"]:::viz
            UIlib["UI Component Library"]:::ui
            ThemeStyling["Theme Provider & Styling"]:::ui
        end

        %% Data Processing Layer
        subgraph "Data Processing & Analysis"
            direction TB
            FileProcessor["FileProcessor Service"]:::proc
            DataAnalysis["Data Analysis Library"]:::proc
            PricingUtil["Pricing Estimation Utility"]:::proc
        end

        %% Infrastructure & Build
        subgraph "Infrastructure & Build"
            direction TB
            TailwindConfig["tailwind.config.ts"]:::infra
            GlobalsCSS["app/globals.css"]:::infra
            StaticAssets["public/* assets"]:::infra
        end
    end

    %% Data Flow
    Browser -->|"renders pages"| Layout
    FileUploadUI -->|"raw JSON"| FileProcessor
    FileProcessor -->|"typed data"| DataAnalysis
    DataAnalysis -->|"metric payload"| Visualization
    Visualization -->|"UI rendering"| Browser
    DataAnalysis -->|"cost data"| PricingUtil

    %% Click Events - Next.js Framework
    click Layout "https://github.com/meetpateltech/convelyze/blob/main/app/layout.tsx"
    click Home "https://github.com/meetpateltech/convelyze/blob/main/app/page.tsx"
    click DashboardPage "https://github.com/meetpateltech/convelyze/blob/main/app/dashboard/page.tsx"
    click DemoPage "https://github.com/meetpateltech/convelyze/blob/main/app/demo/page.tsx"

    %% Click Events - FileProcessor
    click FileProcessor "https://github.com/meetpateltech/convelyze/blob/main/utils/fileProcessor.ts"

    %% Click Events - Data Analysis Library
    click DataAnalysis "https://github.com/meetpateltech/convelyze/blob/main/lib/ChatGPTDataAnalysis.ts"
    click DataAnalysis "https://github.com/meetpateltech/convelyze/blob/main/lib/activityData.ts"
    click DataAnalysis "https://github.com/meetpateltech/convelyze/blob/main/lib/utils.ts"

    %% Click Events - Visualization Components
    click Visualization "https://github.com/meetpateltech/convelyze/blob/main/components/dashboard/ActivityCalendar.tsx"
    click Visualization "https://github.com/meetpateltech/convelyze/blob/main/components/dashboard/CostLineChart.tsx"
    click Visualization "https://github.com/meetpateltech/convelyze/blob/main/components/dashboard/MetricCard.tsx"
    click Visualization "https://github.com/meetpateltech/convelyze/blob/main/components/dashboard/TokenUsageBarChart.tsx"
    click Visualization "https://github.com/meetpateltech/convelyze/blob/main/components/dashboard/SummaryCard.tsx"
    click Visualization "https://github.com/meetpateltech/convelyze/blob/main/components/dashboard/ActivityCalendar.tsx"

    %% Click Events - UI Component Library
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/background.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/badge.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/button.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/card.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/carousel.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/dropdown-menu.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/select.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/skeleton.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/tabs.tsx"
    click UIlib "https://github.com/meetpateltech/convelyze/blob/main/components/ui/tooltip.tsx"

    %% Click Events - Theme & Styling
    click ThemeStyling "https://github.com/meetpateltech/convelyze/blob/main/components/theme-provider.tsx"
    click ThemeStyling "https://github.com/meetpateltech/convelyze/blob/main/tailwind.config.ts"
    click ThemeStyling "https://github.com/meetpateltech/convelyze/blob/main/app/globals.css"

    %% Click Events - Infra & Build
    click StaticAssets "https://github.com/meetpateltech/convelyze/tree/main/public/*"

    %% Styles
    classDef user fill:#f9f,stroke:#333,stroke-width:1px
    classDef browser fill:#eef,stroke:#333,stroke-width:1px
    classDef nextjs fill:#bbf,stroke:#333,stroke-width:1px
    classDef ui fill:#f96,stroke:#333,stroke-width:1px
    classDef viz fill:#fa3,stroke:#333,stroke-width:1px
    classDef proc fill:#8f8,stroke:#333,stroke-width:1px
    classDef infra fill:#ccc,stroke:#333,stroke-width:1px
```
