# kristoffer-0328/pesoflow architecture

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

- Interactive diagram: https://gitdiagram.com/kristoffer-0328/pesoflow
- Repository: https://github.com/kristoffer-0328/pesoflow

## Overview

PesoFlow is a personal-finance web app for tracking transactions, wallets, budgets, savings goals, debts, and spending. A signed-in user enters through the routed app, records financial activity, and views balances and summaries; live user data is assembled from Firestore subscriptions. The graph preserves the documented page-level capabilities, though some feature implementations were not excerpted. Edges reflect explicit imports, calls, or routing references in the supplied excerpts and source index; unsampled internals are not inferred.

Main entry points: [`pesoflow/src/App.tsx`](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/App.tsx) (App routing), [`pesoflow/src/features/auth/hooks/userData.ts`](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/hooks/userData.ts) (Live user data), [`pesoflow/src/pages/WalletsPage.tsx`](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/WalletsPage.tsx) (Wallets), [`pesoflow/src/pages/DashboardPage.tsx`](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/DashboardPage.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_app["App routing<br/>[App.tsx]"]
  node_authgate["Auth context<br/>[authProvider.tsx]"]
  node_protected["Protected routes"]
  node_guest["Guest routes<br/>[guestRoutes.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
  node_login["Login and register<br/>[LoginPage.tsx]"]
  node_settings["Account settings<br/>[SettingsPage.tsx]"]
end

subgraph group_finance["Finance features"]
  node_transactions["Transactions"]
  node_transactionform["Transaction entry"]
  node_budgets["Budgets<br/>[BudgetsPage.tsx]"]
  node_budgetform["Budget creation<br/>[NewBudgetModal.tsx]"]
  node_wallets["Wallets<br/>[WalletsPage.tsx]"]
  node_goals["Savings goals<br/>[GoalsPage.tsx]"]
  node_debts["Debts<br/>[DebtsPage.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_dashboardviews["Dashboard summaries"]
end

subgraph group_data["User data"]
  node_userdata["Live user data<br/>[userData.ts]"]
  node_authservices["Authentication services<br/>[authServices.ts]"]
  node_walletservices["Wallet services<br/>[walletServices.ts]"]
  node_budgetservices["Budget services<br/>[budgetServices.ts]"]
  node_transactionservices["Transaction services"]
  node_categoryservices["Category services"]
  node_firestore[("Firebase Firestore<br/>[firebase.ts]")]
  node_firebaseauth[("Firebase Auth<br/>[firebase.ts]")]
end

subgraph group_shared["Shared logic"]
  node_calculations["Finance calculations<br/>[calculation.ts]"]
  node_dates["Date utilities<br/>[date.ts]"]
  node_money["Money formatting<br/>[money.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes guests"| node_guest
node_app -->|"routes members"| node_protected
node_app -->|"provides auth"| node_authgate
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_transactions
node_app -->|"routes to"| node_budgets
node_app -->|"routes to"| node_wallets
node_app -->|"routes to"| node_goals
node_app -->|"routes to"| node_debts
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_settings
node_protected -->|"wraps pages"| node_layout
node_login -->|"authenticates"| node_authservices
node_settings -->|"updates account"| node_authservices
node_layout -->|"opens entry"| node_transactionform
node_transactions -->|"loads live data"| node_userdata
node_dashboard -->|"loads live data"| node_userdata
node_dashboard -->|"renders summaries"| node_dashboardviews
node_dashboard -->|"calculates summaries"| node_calculations
node_userdata -->|"subscribes wallets"| node_walletservices
node_userdata -->|"subscribes categories"| node_categoryservices
node_userdata -->|"subscribes transactions"| node_transactionservices
node_userdata -->|"subscribes budgets"| node_budgetservices
node_transactionform -->|"creates transactions"| node_transactionservices
node_budgets -->|"loads budgets"| node_budgetservices
node_budgets -->|"opens creation"| node_budgetform
node_budgetform -->|"creates budgets"| node_budgetservices
node_wallets -->|"manages wallets"| node_walletservices
node_goals -->|"calculates progress"| node_calculations
node_debts -->|"loads live data"| node_userdata
node_authservices -->|"signs in users"| node_firebaseauth
node_authservices -->|"stores profiles"| node_firestore
node_walletservices -->|"reads and writes"| node_firestore
node_budgetservices -->|"reads and writes"| node_firestore
node_transactionservices -->|"reads and writes"| node_firestore
node_transactionservices -->|"normalizes dates"| node_dates
node_goals -->|"formats amounts"| node_money
node_wallets -->|"calculates balances"| node_calculations
node_wallets -->|"formats amounts"| node_money

click node_app "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/App.tsx"
click node_authgate "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/components/authProvider.tsx"
click node_protected "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/app/routes/protectedRoutes.tsx"
click node_guest "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/app/routes/guestRoutes.tsx"
click node_layout "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/components/AppLayout.tsx"
click node_login "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/LoginPage.tsx"
click node_settings "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/SettingsPage.tsx"
click node_transactions "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/TransactionsPage.tsx"
click node_transactionform "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/transactions/components/addTransactionsModal.tsx"
click node_budgets "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/BudgetsPage.tsx"
click node_budgetform "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/budgets/components/NewBudgetModal.tsx"
click node_wallets "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/WalletsPage.tsx"
click node_goals "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/GoalsPage.tsx"
click node_debts "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/DebtsPage.tsx"
click node_dashboard "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/DashboardPage.tsx"
click node_dashboardviews "https://github.com/kristoffer-0328/pesoflow/tree/main/pesoflow/src/features/dashboard/components"
click node_userdata "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/hooks/userData.ts"
click node_authservices "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/services/authServices.ts"
click node_walletservices "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/services/walletServices.ts"
click node_budgetservices "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/budgets/budgetServices.ts"
click node_transactionservices "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/transactions/services/transactionServices.ts"
click node_categoryservices "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/services/categoryServices.ts"
click node_firestore "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/lib/firebase.ts"
click node_firebaseauth "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/lib/firebase.ts"
click node_calculations "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/utils/calculation.ts"
click node_dates "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/utils/date.ts"
click node_money "https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/utils/money.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authgate,node_protected,node_guest,node_layout,node_login,node_settings,node_user toneBlue
class node_transactions,node_transactionform,node_budgets,node_budgetform,node_wallets,node_goals,node_debts,node_dashboard,node_dashboardviews toneAmber
class node_userdata,node_authservices,node_walletservices,node_budgetservices,node_transactionservices,node_categoryservices,node_firestore,node_firebaseauth toneMint
class node_calculations,node_dates,node_money toneRose
```

## Components

### App and access

- [App routing](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/App.tsx): `pesoflow/src/App.tsx`
- [Auth context](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/components/authProvider.tsx): `pesoflow/src/features/components/authProvider.tsx`
- [Protected routes](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/app/routes/protectedRoutes.tsx): `pesoflow/src/app/routes/protectedRoutes.tsx`
- [Guest routes](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/app/routes/guestRoutes.tsx): `pesoflow/src/app/routes/guestRoutes.tsx`
- [App layout](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/components/AppLayout.tsx): `pesoflow/src/features/components/AppLayout.tsx`
- [Login and register](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/LoginPage.tsx): `pesoflow/src/pages/LoginPage.tsx`
- [Account settings](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/SettingsPage.tsx): `pesoflow/src/pages/SettingsPage.tsx`

### Finance features

- [Transactions](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/TransactionsPage.tsx): `pesoflow/src/pages/TransactionsPage.tsx`
- [Transaction entry](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/transactions/components/addTransactionsModal.tsx): `pesoflow/src/features/transactions/components/addTransactionsModal.tsx`
- [Budgets](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/BudgetsPage.tsx): `pesoflow/src/pages/BudgetsPage.tsx`
- [Budget creation](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/budgets/components/NewBudgetModal.tsx): `pesoflow/src/features/budgets/components/NewBudgetModal.tsx`
- [Wallets](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/WalletsPage.tsx): `pesoflow/src/pages/WalletsPage.tsx`
- [Savings goals](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/GoalsPage.tsx): `pesoflow/src/pages/GoalsPage.tsx`
- [Debts](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/DebtsPage.tsx): `pesoflow/src/pages/DebtsPage.tsx`
- [Dashboard](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/pages/DashboardPage.tsx): `pesoflow/src/pages/DashboardPage.tsx`
- [Dashboard summaries](https://github.com/kristoffer-0328/pesoflow/tree/main/pesoflow/src/features/dashboard/components): `pesoflow/src/features/dashboard/components`

### User data

- [Live user data](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/hooks/userData.ts): `pesoflow/src/features/auth/hooks/userData.ts`
- [Authentication services](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/services/authServices.ts): `pesoflow/src/features/auth/services/authServices.ts`
- [Wallet services](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/services/walletServices.ts): `pesoflow/src/features/auth/services/walletServices.ts`
- [Budget services](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/budgets/budgetServices.ts): `pesoflow/src/features/budgets/budgetServices.ts`
- [Transaction services](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/transactions/services/transactionServices.ts): `pesoflow/src/features/transactions/services/transactionServices.ts`
- [Category services](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/features/auth/services/categoryServices.ts): `pesoflow/src/features/auth/services/categoryServices.ts`
- [Firebase Firestore](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/lib/firebase.ts): `pesoflow/src/lib/firebase.ts`
- [Firebase Auth](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/lib/firebase.ts): `pesoflow/src/lib/firebase.ts`

### Shared logic

- [Finance calculations](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/utils/calculation.ts): `pesoflow/src/utils/calculation.ts`
- [Date utilities](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/utils/date.ts): `pesoflow/src/utils/date.ts`
- [Money formatting](https://github.com/kristoffer-0328/pesoflow/blob/main/pesoflow/src/utils/money.ts): `pesoflow/src/utils/money.ts`

### Other components

- **User**

## Connections

- User → App routing: opens (evidence: `pesoflow/src/App.tsx`)
- App routing → Guest routes: routes guests (evidence: `pesoflow/src/App.tsx`)
- App routing → Protected routes: routes members (evidence: `pesoflow/src/App.tsx`)
- App routing → Auth context: provides auth (evidence: `pesoflow/src/App.tsx`)
- App routing → Login and register: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Transactions: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Budgets: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Wallets: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Savings goals: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Debts: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Dashboard: routes to (evidence: `pesoflow/src/App.tsx`)
- App routing → Account settings: routes to (evidence: `pesoflow/src/App.tsx`)
- Protected routes → App layout: wraps pages (evidence: `pesoflow/src/App.tsx`)
- Login and register → Authentication services: authenticates (evidence: `pesoflow/src/pages/LoginPage.tsx`)
- Account settings → Authentication services: updates account (evidence: `pesoflow/src/pages/SettingsPage.tsx`)
- App layout → Transaction entry: opens entry (evidence: `pesoflow/src/features/components/AppLayout.tsx`)
- Transactions → Live user data: loads live data (evidence: `pesoflow/src/pages/TransactionsPage.tsx`)
- Dashboard → Live user data: loads live data (evidence: `pesoflow/src/pages/DashboardPage.tsx`)
- Dashboard → Dashboard summaries: renders summaries (evidence: `pesoflow/src/pages/DashboardPage.tsx`)
- Dashboard → Finance calculations: calculates summaries (evidence: `pesoflow/src/pages/DashboardPage.tsx`)
- Live user data → Wallet services: subscribes wallets (evidence: `pesoflow/src/features/auth/hooks/userData.ts`)
- Live user data → Category services: subscribes categories (evidence: `pesoflow/src/features/auth/hooks/userData.ts`)
- Live user data → Transaction services: subscribes transactions (evidence: `pesoflow/src/features/auth/hooks/userData.ts`)
- Live user data → Budget services: subscribes budgets (evidence: `pesoflow/src/features/auth/hooks/userData.ts`)
- Transaction entry → Transaction services: creates transactions (evidence: `pesoflow/src/features/transactions/components/addTransactionsModal.tsx`)
- Budgets → Budget services: loads budgets (evidence: `pesoflow/src/pages/BudgetsPage.tsx`)
- Budgets → Budget creation: opens creation (evidence: `pesoflow/src/pages/BudgetsPage.tsx`)
- Budget creation → Budget services: creates budgets (evidence: `pesoflow/src/features/budgets/components/NewBudgetModal.tsx`)
- Wallets → Wallet services: manages wallets (evidence: `pesoflow/src/pages/WalletsPage.tsx`)
- Savings goals → Finance calculations: calculates progress (evidence: `pesoflow/src/pages/GoalsPage.tsx`)
- Debts → Live user data: loads live data (evidence: `pesoflow/src/pages/DebtsPage.tsx`)
- Authentication services → Firebase Auth: signs in users (evidence: `pesoflow/src/features/auth/services/authServices.ts`)
- Authentication services → Firebase Firestore: stores profiles (evidence: `pesoflow/src/features/auth/services/authServices.ts`)
- Wallet services → Firebase Firestore: reads and writes (evidence: `pesoflow/src/features/auth/services/walletServices.ts`)
- Budget services → Firebase Firestore: reads and writes (evidence: `pesoflow/src/features/budgets/budgetServices.ts`)
- Transaction services → Firebase Firestore: reads and writes (evidence: `pesoflow/src/features/transactions/services/transactionServices.ts`)
- Transaction services → Date utilities: normalizes dates (evidence: `pesoflow/src/features/transactions/services/transactionServices.ts`)
- Savings goals → Money formatting: formats amounts (evidence: `pesoflow/src/pages/GoalsPage.tsx`)
- Wallets → Finance calculations: calculates balances (evidence: `pesoflow/src/pages/WalletsPage.tsx`)
- Wallets → Money formatting: formats amounts (evidence: `pesoflow/src/pages/WalletsPage.tsx`)
