# ppramanik62/finflow architecture

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

- Interactive diagram: https://gitdiagram.com/ppramanik62/finflow
- Repository: https://github.com/ppramanik62/finflow

## Overview

##### Project type and purpose
- This is a full‑stack (mostly front‑end) Personal Finance Tracker built with Next.js, TypeScript and Tailwind CSS.
- It tracks income and expenses, calculates balances in real time, and presents analytics via charts and reports.

##### File structure
- Top‑level:
- public/ (static assets)
- src/app/ (Next.js app router – pages/layout.tsx and page.tsx)
- src/components/ (UI components organized by feature: budget, category, expenses, transaction, plus generic ui/)
- src/contexts/ (React Contexts for global state, e.g. transactions)
- src/providers/ (Context & Theme providers)
- src/lib/ (helpers, types, utils)
- src/styles/ (global CSS)
- Config files: next.config.js, tsconfig.json, eslint.config.js, prettier.config.js
- No backend API folder, implying the app is client‑heavy, with state managed via Context and possibly persisted in browser storage or serverless calls.

##### README for additional insights
- No external database or third‑party API mentioned—likely local or stubbed data for now.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layer 1: Client
    Browser["Browser"]:::client

    %% Layer 2: Next.js Server
    NextJS["Next.js Server"]:::framework

    Browser -->|"HTTP GET"| NextJS
    NextJS -->|"HTML/CSS/JS"| Browser

    %% Layer 3: React Client
    subgraph "React Client"
        direction TB
        AppRouter["App Router"]:::framework
        click AppRouter "https://github.com/ppramanik62/finflow/blob/main/src/app/layout.tsx"
        click AppRouter "https://github.com/ppramanik62/finflow/blob/main/src/app/page.tsx"

        subgraph "Providers (Context & Theme)"
            direction TB
            ClientProviders["ClientProviders"]:::state
            click ClientProviders "https://github.com/ppramanik62/finflow/blob/main/src/providers/client-providers.tsx"
            ThemeProvider["ThemeProvider"]:::state
            click ThemeProvider "https://github.com/ppramanik62/finflow/blob/main/src/providers/theme-provider.tsx"
        end

        subgraph "Contexts"
            direction TB
            TransactionContext["TransactionContext"]:::state
            click TransactionContext "https://github.com/ppramanik62/finflow/blob/main/src/contexts/transaction-context.tsx"
        end

        subgraph "UI Component Library" 
            direction TB
            UI_button["Button"]:::ui;           click UI_button "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/button.tsx"
            UI_card["Card"]:::ui;               click UI_card "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/card.tsx"
            UI_input["Input"]:::ui;             click UI_input "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/input.tsx"
            UI_form["Form"]:::ui;               click UI_form "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/form.tsx"
            UI_dialog["Dialog"]:::ui;           click UI_dialog "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/dialog.tsx"
            UI_dropdown["DropdownMenu"]:::ui;   click UI_dropdown "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/dropdown-menu.tsx"
            UI_calendar["Calendar"]:::ui;       click UI_calendar "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/calendar.tsx"
            UI_label["Label"]:::ui;             click UI_label "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/label.tsx"
            UI_popover["Popover"]:::ui;         click UI_popover "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/popover.tsx"
            UI_progress["Progress"]:::ui;       click UI_progress "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/progress.tsx"
            UI_select["Select"]:::ui;           click UI_select "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/select.tsx"
            UI_tabs["Tabs"]:::ui;               click UI_tabs "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/tabs.tsx"
            UI_textarea["Textarea"]:::ui;       click UI_textarea "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/textarea.tsx"
            UI_toggle["Toggle"]:::ui;           click UI_toggle "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/toggle.tsx"
            UI_toggleGroup["ToggleGroup"]:::ui; click UI_toggleGroup "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/toggle-group.tsx"
            UI_tooltip["Tooltip"]:::ui;         click UI_tooltip "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/tooltip.tsx"
            UI_sonner["Sonner"]:::ui;           click UI_sonner "https://github.com/ppramanik62/finflow/blob/main/src/components/ui/sonner.tsx"
        end

        subgraph "Feature Components"
            direction TB
            BudgetManager["BudgetManager"]:::feature
            click BudgetManager "https://github.com/ppramanik62/finflow/blob/main/src/components/budget/budget-manager.tsx"
            BudgetChart["BudgetComparisonChart"]:::feature
            click BudgetChart "https://github.com/ppramanik62/finflow/blob/main/src/components/budget/budget-comparison-chart.tsx"

            CategoryPie["CategoryPieChart"]:::feature
            click CategoryPie "https://github.com/ppramanik62/finflow/blob/main/src/components/category/category-pie-chart.tsx"
            CategoryBreakdown["CategoryBreakdown"]:::feature
            click CategoryBreakdown "https://github.com/ppramanik62/finflow/blob/main/src/components/category/category-breakdown.tsx"

            ExpensesChart["ExpensesChart"]:::feature
            click ExpensesChart "https://github.com/ppramanik62/finflow/blob/main/src/components/expenses/expenses-chart.tsx"
            SpendingInsights["SpendingInsights"]:::feature
            click SpendingInsights "https://github.com/ppramanik62/finflow/blob/main/src/components/expenses/spending-insignts.tsx"

            AddTransaction["AddTransaction"]:::feature
            click AddTransaction "https://github.com/ppramanik62/finflow/blob/main/src/components/transaction/add-transaction.tsx"
            TransactionForm["TransactionForm"]:::feature
            click TransactionForm "https://github.com/ppramanik62/finflow/blob/main/src/components/transaction/transaction-form.tsx"
            TransactionList["TransactionList"]:::feature
            click TransactionList "https://github.com/ppramanik62/finflow/blob/main/src/components/transaction/transaction-list.tsx"
            RecentTransactions["RecentTransactions"]:::feature
            click RecentTransactions "https://github.com/ppramanik62/finflow/blob/main/src/components/transaction/recent-transactions.tsx"

            Header["Header"]:::feature
            click Header "https://github.com/ppramanik62/finflow/blob/main/src/components/header.tsx"
            ModeToggle["ModeToggle"]:::feature
            click ModeToggle "https://github.com/ppramanik62/finflow/blob/main/src/components/mode-toggle.tsx"
        end
    end

    %% Layer 4: Utilities
    subgraph "Utilities"
        direction TB
        Helpers["helpers.ts"]:::utils
        click Helpers "https://github.com/ppramanik62/finflow/blob/main/src/lib/helpers.ts"
        Utils["utils.ts"]:::utils
        click Utils "https://github.com/ppramanik62/finflow/blob/main/src/lib/utils.ts"
        Types["types.ts"]:::utils
        click Types "https://github.com/ppramanik62/finflow/blob/main/src/lib/types.ts"
    end

    %% Layer 5: Assets & Persistence
    subgraph "Assets & Persistence"
        direction TB
        Public["public/"]:::assets
        click Public "https://github.com/ppramanik62/finflow/tree/main/public/"
        CSS["globals.css"]:::assets
        click CSS "https://github.com/ppramanik62/finflow/blob/main/src/styles/globals.css"
        LocalStorage["LocalStorage"]:::storage
    end

    %% Data Flows
    NextJS --> AppRouter
    AppRouter --> ClientProviders
    ClientProviders --> TransactionContext
    TransactionContext --> AppRouter
    AppRouter --> UI_button
    AppRouter --> FeatureComponents
    FeatureComponents --> TransactionContext
    FeatureComponents --> Helpers
    FeatureComponents --> Utils
    NextJS --> Public
    NextJS --> CSS

    classDef client fill:#D0E8FF,stroke:#1E4E8C,color:#1E4E8C;
    classDef framework fill:#E0F7FA,stroke:#006064,color:#006064;
    classDef state fill:#FFF4E5,stroke:#FF8C00,color:#FF8C00;
    classDef ui fill:#E8F5E9,stroke:#2E7D32,color:#2E7D32;
    classDef feature fill:#E3F2FD,stroke:#1976D2,color:#1976D2;
    classDef utils fill:#F5F5F5,stroke:#616161,color:#424242;
    classDef assets fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C;
    classDef storage fill:#ECEFF1,stroke:#455A64,color:#263238;
```
