# cecax27/fundwise architecture

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

- Interactive diagram: https://gitdiagram.com/cecax27/fundwise
- Repository: https://github.com/cecax27/fundwise

## Overview

##### Project type and purpose
- This is a single-page mobile application built with Expo/React Native and expo-router.
- Its purpose (from README) is “Fundwise,” a personal finance app for managing accounts, budgets, and transactions.
- It has no bespoke backend in the repo; instead it relies on Supabase as a BaaS for authentication, database, and reporting services.

##### File structure
- Top-level “mobile” folder holds the entire client code, with:
- app/ – file-based routing for screens (tabs, accounts, dashboard, transactions)
- contexts/ – React contexts (e.g. FiltersContext) for global state
- hooks/ – custom hooks for business logic (useBudget)
- lib/supabase/ – Supabase client setup (auth, transactions, reports, tools)
- theme/ – theming infrastructure (ThemeProvider, tokens)
- Config files: app.json and eas.json for Expo, package.json for dependencies.

##### README
- Very brief: “Fundwise: Personal finance app.”

##### Detail
- With key libraries (e.g., @supabase/supabase-js, expo-router).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interaction
    User(("User")):::external
    User -->|"interacts with"| Routing

    %% Mobile Client
    subgraph "Mobile Client" 
        direction TB

        subgraph "Routing & Navigation" 
            direction TB
            Routing["expo-router (file-based routes)"]:::client
        end

        subgraph "Screens" 
            direction TB

            subgraph "Accounts" 
                direction TB
                AccountsLayout["_layout.js"]:::client
                AccountsIndex["index.js"]:::client
                NewAccount["newaccount.js"]:::client
                EditAccount["editaccount/[id].js"]:::client
            end

            subgraph "Dashboard" 
                direction TB
                DashboardLayout["_layout.js"]:::client
                DashboardIndex["index.js"]:::client
                NewBudget["newBudget.js"]:::client
                EditBudget["editBudget.js"]:::client
                BudgetDetails["budgetDetails/[id].js"]:::client
            end

            subgraph "Transactions" 
                direction TB
                TransactionsLayout["_layout.js"]:::client
                TransactionsIndex["index.js"]:::client
                AddTransaction["addTransaction.js"]:::client
                TransactionDetails["details/[id].js"]:::client
                EditTransaction["edit/[id].js"]:::client
            end

            subgraph "Authentication & Onboarding" 
                direction TB
                SignUp["signUp.js"]:::client
                CheckEmail["checkEmail.js"]:::client
                Welcome["welcome.js"]:::client
            end
        end

        subgraph "UI Components Library" 
            direction TB
            ComponentsDir["components/"]:::components
            Snackbar["Snackbar.jsx"]:::components
            FButton["fbutton.jsx"]:::components
            OptionsMenu["optionsmenu.jsx"]:::components
            SVGIcons["svg/"]:::components
        end

        subgraph "State Management & Hooks" 
            direction TB
            FiltersContext["FiltersContext.jsx"]:::state
            UseBudget["useBudget.js"]:::state
        end

        subgraph "Data Access Layer" 
            direction TB
            SupabaseClient["client.js"]:::data
            SupabaseAuth["auth.js"]:::data
            TransactionsAPI["transactions.js"]:::data
            ReportsAPI["reports.js"]:::data
            Tools["tools.js"]:::data
        end

        subgraph "Utilities" 
            direction TB
            Utils["utils.js"]:::data
            FormatMoney["formatMoney.js"]:::data
            WelcomeSeen["welcomeSeen.js"]:::data
        end

        subgraph "Theming Layer" 
            direction TB
            ThemeProvider["ThemeProvider.jsx"]:::theme
            ThemeContext["ThemeContext.js"]:::theme
            Tokens["tokens.js"]:::theme
            UseTheme["useTheme.js"]:::theme
        end
    end

    %% External Service
    subgraph "External BaaS Service" 
        direction TB
        Supabase["Supabase Auth & PostgreSQL"]:::external
    end

    %% Interactions
    Routing -->|"routes to"| AccountsLayout
    Routing --> DashboardLayout
    Routing --> TransactionsLayout
    Routing --> SignUp

    AccountsIndex -->|"uses"| ComponentsDir
    DashboardIndex --> ComponentsDir
    TransactionsIndex --> ComponentsDir
    SignUp --> ComponentsDir

    AccountsIndex -->|"updates"| FiltersContext
    DashboardIndex --> UseBudget
    TransactionsIndex --> FiltersContext

    FiltersContext --> SupabaseClient
    UseBudget --> TransactionsAPI

    SupabaseClient --> Supabase
    SupabaseAuth --> Supabase
    TransactionsAPI --> Supabase
    ReportsAPI --> Supabase

    ThemeProvider -. wraps .-> Routing
    ThemeProvider -. wraps .-> ComponentsDir
    ThemeProvider -. wraps .-> AccountsIndex

    %% Click Events for Component Mapping
    click Routing "https://github.com/cecax27/fundwise/tree/main/mobile/app/"
    click AccountsIndex "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/accounts/index.js"
    click AccountsLayout "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/accounts/_layout.js"
    click NewAccount "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/accounts/newaccount.js"
    click EditAccount "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/accounts/editaccount/[id].js"
    click DashboardIndex "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/dashboard/index.js"
    click DashboardLayout "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/dashboard/_layout.js"
    click NewBudget "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/dashboard/newBudget.js"
    click EditBudget "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/dashboard/editBudget.js"
    click BudgetDetails "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/dashboard/budgetDetails/[id].js"
    click TransactionsIndex "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/transactions/index.js"
    click TransactionsLayout "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/transactions/_layout.js"
    click AddTransaction "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/transactions/addTransaction.js"
    click TransactionDetails "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/transactions/details/[id].js"
    click EditTransaction "https://github.com/cecax27/fundwise/blob/main/mobile/app/(tabs)/transactions/edit/[id].js"
    click SignUp "https://github.com/cecax27/fundwise/blob/main/mobile/app/signUp.js"
    click CheckEmail "https://github.com/cecax27/fundwise/blob/main/mobile/app/checkEmail.js"
    click Welcome "https://github.com/cecax27/fundwise/blob/main/mobile/app/welcome.js"
    click ComponentsDir "https://github.com/cecax27/fundwise/tree/main/mobile/components/"
    click Snackbar "https://github.com/cecax27/fundwise/blob/main/mobile/components/Snackbar.jsx"
    click FButton "https://github.com/cecax27/fundwise/blob/main/mobile/components/fbutton.jsx"
    click OptionsMenu "https://github.com/cecax27/fundwise/blob/main/mobile/components/optionsmenu.jsx"
    click SVGIcons "https://github.com/cecax27/fundwise/tree/main/mobile/components/svg/"
    click FiltersContext "https://github.com/cecax27/fundwise/blob/main/mobile/contexts/FiltersContext.jsx"
    click UseBudget "https://github.com/cecax27/fundwise/blob/main/mobile/hooks/useBudget.js"
    click SupabaseClient "https://github.com/cecax27/fundwise/blob/main/mobile/lib/supabase/client.js"
    click SupabaseAuth "https://github.com/cecax27/fundwise/blob/main/mobile/lib/supabase/auth.js"
    click TransactionsAPI "https://github.com/cecax27/fundwise/blob/main/mobile/lib/supabase/transactions.js"
    click ReportsAPI "https://github.com/cecax27/fundwise/blob/main/mobile/lib/supabase/reports.js"
    click Tools "https://github.com/cecax27/fundwise/blob/main/mobile/lib/supabase/tools.js"
    click Utils "https://github.com/cecax27/fundwise/blob/main/mobile/lib/utils.js"
    click FormatMoney "https://github.com/cecax27/fundwise/blob/main/mobile/lib/utils/formatMoney.js"
    click WelcomeSeen "https://github.com/cecax27/fundwise/blob/main/mobile/lib/welcomeSeen.js"
    click ThemeProvider "https://github.com/cecax27/fundwise/blob/main/mobile/theme/ThemeProvider.jsx"
    click ThemeContext "https://github.com/cecax27/fundwise/blob/main/mobile/theme/ThemeContext.js"
    click Tokens "https://github.com/cecax27/fundwise/blob/main/mobile/theme/tokens.js"
    click UseTheme "https://github.com/cecax27/fundwise/blob/main/mobile/theme/useTheme.js"

    %% Styles
    classDef client fill:#E8F4FC,stroke:#0366d6
    classDef components fill:#FDE2E4,stroke:#D7263D
    classDef state fill:#E8F0FE,stroke:#1A73E8
    classDef data fill:#EDEEF0,stroke:#636363
    classDef theme fill:#F3E5F5,stroke:#6A1B9A
    classDef external fill:#FFF4DB,stroke:#F9A825
```
