# callmerev95/cashtrix architecture

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

- Interactive diagram: https://gitdiagram.com/callmerev95/cashtrix
- Repository: https://github.com/callmerev95/cashtrix

## Overview

Cashtrix is a mobile personal-finance app whose main workflow is capturing and managing transactions across wallets, then reviewing balances, budgets, and server-aggregated analytics. Authentication gates the app; recurring rules can generate transactions, while receipt scanning, voice entry, search, CSV export, and account controls support the core workflow. The README documents server-side PostgreSQL aggregation and Supabase-backed features. Sampled source confirms several UI-to-context calls; unsampled feature wiring is shown only where documented, not as inferred sibling pipelines.

Main entry points: [`src/supabase/client.ts`](https://github.com/callmerev95/cashtrix/blob/main/src/supabase/client.ts) (Supabase client), [`app/(tabs)/index.tsx`](https://github.com/callmerev95/cashtrix/blob/main/app/(tabs)/index.tsx) (Dashboard), [`src/features/recurring/recurring-context.tsx`](https://github.com/callmerev95/cashtrix/blob/main/src/features/recurring/recurring-context.tsx) (Recurring rules), [`src/features/budgets/budgets-context.tsx`](https://github.com/callmerev95/cashtrix/blob/main/src/features/budgets/budgets-context.tsx) (Budgets and alerts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile workflows"]
  node_authscreens["Auth screens<br/>[login.tsx]"]
  node_dashboard["Dashboard<br/>[index.tsx]"]
  node_txscreens["Transaction forms"]
  node_searchscreen["Search and bulk edit<br/>[search.tsx]"]
  node_scan["Receipt scanning<br/>[scan.tsx]"]
  node_voice["Voice entry<br/>[voice.tsx]"]
end

subgraph group_money["Finance management"]
  node_walletscreens["Wallet screens<br/>[wallets.tsx]"]
  node_transactions["Transaction state"]
  node_txapi["Transaction API<br/>[api.ts]"]
  node_wallets["Wallet feature"]
  node_recurring["Recurring rules"]
  node_recurringapi["Recurring API<br/>[api.ts]"]
end

subgraph group_insights["Insights and alerts"]
  node_analytics["Analytics feature"]
  node_analyticsapi["Analytics API<br/>[api.ts]"]
  node_budget["Budgets and alerts"]
  node_budgetapi["Budget API<br/>[api.ts]"]
end

subgraph group_account["Account and security"]
  node_profile["Profile and categories"]
  node_auth["Authentication<br/>[auth-context.tsx]"]
end

subgraph group_services["Backend services"]
  node_receiptsapi["Receipt processing<br/>[scan.ts]"]
  node_receiptfn["Receipt OCR function<br/>[index.ts]"]
  node_exportfn["CSV export function<br/>[index.ts]"]
  node_deletefn["Account deletion<br/>[index.ts]"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_postgres[("Postgres database")]
end

node_user(("User"))
node_supabaseplatform["Supabase services"]
node_osstt["OS speech recognition"]

node_user -->|"signs in"| node_authscreens
node_authscreens -->|"authenticates"| node_auth
node_user -->|"uses"| node_dashboard
node_dashboard -->|"loads history"| node_transactions
node_dashboard -->|"loads balances"| node_wallets
node_dashboard -->|"loads summary"| node_analytics
node_dashboard -->|"shows alerts"| node_budget
node_user -->|"enters transaction"| node_txscreens
node_txscreens -->|"saves transaction"| node_transactions
node_transactions -->|"reads and writes"| node_txapi
node_searchscreen -->|"searches and edits"| node_txapi
node_walletscreens -->|"manages wallets"| node_wallets
node_recurring -->|"runs catch-up"| node_recurringapi
node_recurring -->|"refreshes generated entries"| node_transactions
node_recurring -->|"refreshes balances"| node_wallets
node_recurring -->|"refreshes and evaluates"| node_budget
node_analytics -->|"loads aggregates"| node_analyticsapi
node_budget -->|"reads and records alerts"| node_budgetapi
node_budget -.->|"sends local push"| node_supabaseplatform
node_user -->|"scans receipt"| node_scan
node_scan -->|"submits image"| node_receiptsapi
node_receiptsapi -->|"invokes OCR"| node_receiptfn
node_user -->|"dictates entry"| node_voice
node_voice -.->|"uses speech input"| node_osstt
node_user -->|"manages account"| node_profile
node_profile -->|"requests CSV export"| node_exportfn
node_profile -->|"requests account deletion"| node_deletefn
node_auth -->|"uses auth client"| node_supabase
node_txapi -->|"queries"| node_supabase
node_recurringapi -->|"calls RPC"| node_supabase
node_analyticsapi -->|"queries aggregates"| node_supabase
node_budgetapi -->|"queries and writes"| node_supabase
node_supabase -->|"reads and writes"| node_postgres
node_supabaseplatform -->|"stores user data"| node_postgres

click node_authscreens "https://github.com/callmerev95/cashtrix/blob/main/app/(auth)/login.tsx"
click node_dashboard "https://github.com/callmerev95/cashtrix/blob/main/app/(tabs)/index.tsx"
click node_txscreens "https://github.com/callmerev95/cashtrix/blob/main/app/add-transaction.tsx"
click node_searchscreen "https://github.com/callmerev95/cashtrix/blob/main/app/search.tsx"
click node_scan "https://github.com/callmerev95/cashtrix/blob/main/app/scan.tsx"
click node_voice "https://github.com/callmerev95/cashtrix/blob/main/app/voice.tsx"
click node_walletscreens "https://github.com/callmerev95/cashtrix/blob/main/app/wallets.tsx"
click node_transactions "https://github.com/callmerev95/cashtrix/blob/main/src/features/transactions/transactions-context.tsx"
click node_txapi "https://github.com/callmerev95/cashtrix/blob/main/src/features/transactions/api.ts"
click node_wallets "https://github.com/callmerev95/cashtrix/blob/main/src/features/wallets/wallets-context.tsx"
click node_recurring "https://github.com/callmerev95/cashtrix/blob/main/src/features/recurring/recurring-context.tsx"
click node_recurringapi "https://github.com/callmerev95/cashtrix/blob/main/src/features/recurring/api.ts"
click node_analytics "https://github.com/callmerev95/cashtrix/blob/main/src/features/analytics/analytics-context.tsx"
click node_analyticsapi "https://github.com/callmerev95/cashtrix/blob/main/src/features/analytics/api.ts"
click node_budget "https://github.com/callmerev95/cashtrix/blob/main/src/features/budgets/budgets-context.tsx"
click node_budgetapi "https://github.com/callmerev95/cashtrix/blob/main/src/features/budgets/api.ts"
click node_profile "https://github.com/callmerev95/cashtrix/blob/main/src/features/profile/profile-context.tsx"
click node_auth "https://github.com/callmerev95/cashtrix/blob/main/src/features/auth/auth-context.tsx"
click node_receiptsapi "https://github.com/callmerev95/cashtrix/blob/main/src/features/receipts/scan.ts"
click node_receiptfn "https://github.com/callmerev95/cashtrix/blob/main/supabase/functions/scan-receipt/index.ts"
click node_exportfn "https://github.com/callmerev95/cashtrix/blob/main/supabase/functions/export-csv/index.ts"
click node_deletefn "https://github.com/callmerev95/cashtrix/blob/main/supabase/functions/delete-account/index.ts"
click node_supabase "https://github.com/callmerev95/cashtrix/blob/main/src/supabase/client.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_authscreens,node_dashboard,node_txscreens,node_searchscreen,node_scan,node_voice,node_user toneBlue
class node_walletscreens,node_transactions,node_txapi,node_wallets,node_recurring,node_recurringapi toneAmber
class node_analytics,node_analyticsapi,node_budget,node_budgetapi toneMint
class node_profile,node_auth toneRose
class node_receiptsapi,node_receiptfn,node_exportfn,node_deletefn,node_supabase,node_postgres,node_supabaseplatform,node_osstt toneIndigo
```

## Components

### Mobile workflows

- [Auth screens](https://github.com/callmerev95/cashtrix/blob/main/app/(auth)/login.tsx): `app/(auth)/login.tsx`
- [Dashboard](https://github.com/callmerev95/cashtrix/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`
- [Transaction forms](https://github.com/callmerev95/cashtrix/blob/main/app/add-transaction.tsx): `app/add-transaction.tsx`
- [Search and bulk edit](https://github.com/callmerev95/cashtrix/blob/main/app/search.tsx): `app/search.tsx`
- [Receipt scanning](https://github.com/callmerev95/cashtrix/blob/main/app/scan.tsx): `app/scan.tsx`
- [Voice entry](https://github.com/callmerev95/cashtrix/blob/main/app/voice.tsx): `app/voice.tsx`

### Finance management

- [Wallet screens](https://github.com/callmerev95/cashtrix/blob/main/app/wallets.tsx): `app/wallets.tsx`
- [Transaction state](https://github.com/callmerev95/cashtrix/blob/main/src/features/transactions/transactions-context.tsx): `src/features/transactions/transactions-context.tsx`
- [Transaction API](https://github.com/callmerev95/cashtrix/blob/main/src/features/transactions/api.ts): `src/features/transactions/api.ts`
- [Wallet feature](https://github.com/callmerev95/cashtrix/blob/main/src/features/wallets/wallets-context.tsx): `src/features/wallets/wallets-context.tsx`
- [Recurring rules](https://github.com/callmerev95/cashtrix/blob/main/src/features/recurring/recurring-context.tsx): `src/features/recurring/recurring-context.tsx`
- [Recurring API](https://github.com/callmerev95/cashtrix/blob/main/src/features/recurring/api.ts): `src/features/recurring/api.ts`

### Insights and alerts

- [Analytics feature](https://github.com/callmerev95/cashtrix/blob/main/src/features/analytics/analytics-context.tsx): `src/features/analytics/analytics-context.tsx`
- [Analytics API](https://github.com/callmerev95/cashtrix/blob/main/src/features/analytics/api.ts): `src/features/analytics/api.ts`
- [Budgets and alerts](https://github.com/callmerev95/cashtrix/blob/main/src/features/budgets/budgets-context.tsx): `src/features/budgets/budgets-context.tsx`
- [Budget API](https://github.com/callmerev95/cashtrix/blob/main/src/features/budgets/api.ts): `src/features/budgets/api.ts`

### Account and security

- [Profile and categories](https://github.com/callmerev95/cashtrix/blob/main/src/features/profile/profile-context.tsx): `src/features/profile/profile-context.tsx`
- [Authentication](https://github.com/callmerev95/cashtrix/blob/main/src/features/auth/auth-context.tsx): `src/features/auth/auth-context.tsx`

### Backend services

- [Receipt processing](https://github.com/callmerev95/cashtrix/blob/main/src/features/receipts/scan.ts): `src/features/receipts/scan.ts`
- [Receipt OCR function](https://github.com/callmerev95/cashtrix/blob/main/supabase/functions/scan-receipt/index.ts): `supabase/functions/scan-receipt/index.ts`
- [CSV export function](https://github.com/callmerev95/cashtrix/blob/main/supabase/functions/export-csv/index.ts): `supabase/functions/export-csv/index.ts`
- [Account deletion](https://github.com/callmerev95/cashtrix/blob/main/supabase/functions/delete-account/index.ts): `supabase/functions/delete-account/index.ts`
- [Supabase client](https://github.com/callmerev95/cashtrix/blob/main/src/supabase/client.ts): `src/supabase/client.ts`
- **Postgres database**

### Other components

- **User**
- **Supabase services**
- **OS speech recognition**

## Connections

- User → Auth screens: signs in
- Auth screens → Authentication: authenticates
- User → Dashboard: uses
- Dashboard → Transaction state: loads history
- Dashboard → Wallet feature: loads balances
- Dashboard → Analytics feature: loads summary
- Dashboard → Budgets and alerts: shows alerts
- User → Transaction forms: enters transaction
- Transaction forms → Transaction state: saves transaction
- Transaction state → Transaction API: reads and writes
- Search and bulk edit → Transaction API: searches and edits
- Wallet screens → Wallet feature: manages wallets
- Recurring rules → Recurring API: runs catch-up
- Recurring rules → Transaction state: refreshes generated entries
- Recurring rules → Wallet feature: refreshes balances
- Recurring rules → Budgets and alerts: refreshes and evaluates
- Analytics feature → Analytics API: loads aggregates
- Budgets and alerts → Budget API: reads and records alerts
- Budgets and alerts → Supabase services: sends local push
- User → Receipt scanning: scans receipt
- Receipt scanning → Receipt processing: submits image
- Receipt processing → Receipt OCR function: invokes OCR
- User → Voice entry: dictates entry
- Voice entry → OS speech recognition: uses speech input
- User → Profile and categories: manages account
- Profile and categories → CSV export function: requests CSV export
- Profile and categories → Account deletion: requests account deletion
- Authentication → Supabase client: uses auth client
- Transaction API → Supabase client: queries
- Recurring API → Supabase client: calls RPC
- Analytics API → Supabase client: queries aggregates
- Budget API → Supabase client: queries and writes
- Supabase client → Postgres database: reads and writes
- Supabase services → Postgres database: stores user data
