# finflowa/app-financas architecture

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

- Interactive diagram: https://gitdiagram.com/finflowa/app-financas
- Repository: https://github.com/finflowa/app-financas

## Overview

FinFlow is a shared personal and household finance product delivered through an Expo mobile app and a Next.js web dashboard. Users authenticate, manage financial records (including accounts, transactions, goals, cards, and categories), then review calendars and reports or ask the finance assistant for help. Both clients use the same Supabase-backed data and rules; the README also documents server-side AI and web subscription checkout. The tree and excerpts do not show the full database schema or all runtime calls, so uncertain connections are omitted.

Main entry points: [`app/_layout.tsx`](https://github.com/finflowa/app-financas/blob/main/app/_layout.tsx) (Expo app), [`web/src/app/(dashboard)/transacoes/transaction-manager.tsx`](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/transacoes/transaction-manager.tsx) (Transactions), [`supabase/functions/finance-ai/index.ts`](https://github.com/finflowa/app-financas/blob/main/supabase/functions/finance-ai/index.ts) (Finance AI function), [`web/src/app/(dashboard)/layout.tsx`](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/layout.tsx) (Web dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User interfaces"]
  node_mobile["Expo app<br/>[_layout.tsx]"]
  node_web["Web dashboard<br/>[layout.tsx]"]
end

subgraph group_finance["Finance workflows"]
  node_transactions["Transactions"]
  node_accounts["Accounts"]
  node_goals["Financial goals"]
  node_cards["Cards and invoices"]
  node_calendar["Calendar"]
  node_reports["Reports<br/>[page.tsx]"]
  node_assistant["Finance assistant<br/>[chat-ia.tsx]"]
end

subgraph group_platform["Shared client services"]
  node_auth["Authentication<br/>[auth-flow.ts]"]
  node_offline["Offline sync<br/>[offline-sync.ts]"]
  node_notifications["Notifications<br/>[notifications.ts]"]
  node_mobileclient["Mobile data client<br/>[supabase.ts]"]
  node_webclient["Web data client<br/>[server.ts]"]
end

subgraph group_backend["Backend services"]
  node_supabase[("Supabase data platform")]
  node_financeai["Finance AI function<br/>[index.ts]"]
  node_checkout["Subscription checkout<br/>[index.ts]"]
end

subgraph group_integrations["External integrations"]
  node_paddle["Paddle Billing"]
  node_ai_provider["AI provider"]
end

node_user(("Finance user"))

node_user -->|"uses"| node_mobile
node_user -->|"uses"| node_web
node_mobile -->|"handles sign-in"| node_auth
node_mobile -->|"syncs queued work"| node_offline
node_mobile -->|"accesses data"| node_mobileclient
node_web -->|"accesses data"| node_webclient
node_transactions -.->|"submits actions"| node_webclient
node_transactions -->|"selects account"| node_accounts
node_transactions -->|"selects destination"| node_goals
node_calendar -->|"uses transaction data"| node_transactions
node_mobileclient -->|"connects to"| node_supabase
node_webclient -->|"connects to"| node_supabase
node_assistant -->|"requests assistance"| node_financeai
node_financeai -->|"uses financial context"| node_supabase
node_financeai -->|"calls provider"| node_ai_provider
node_checkout -->|"creates checkout"| node_paddle
node_paddle -->|"returns billing events"| node_web
node_accounts -->|"shares financial data"| node_supabase
node_goals -->|"shares financial data"| node_supabase
node_cards -->|"shares financial data"| node_supabase
node_reports -->|"reads shared data"| node_supabase
node_notifications -.->|"schedules reminders"| node_mobile

click node_mobile "https://github.com/finflowa/app-financas/blob/main/app/_layout.tsx"
click node_web "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/layout.tsx"
click node_transactions "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/transacoes/transaction-manager.tsx"
click node_accounts "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/contas/account-manager.tsx"
click node_goals "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/objetivos/objetivos-manager.tsx"
click node_cards "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/cartoes/cartao-detalhe-manager.tsx"
click node_calendar "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/calendario/calendar-manager.tsx"
click node_reports "https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/relatorios/page.tsx"
click node_assistant "https://github.com/finflowa/app-financas/blob/main/app/chat-ia.tsx"
click node_auth "https://github.com/finflowa/app-financas/blob/main/lib/auth-flow.ts"
click node_offline "https://github.com/finflowa/app-financas/blob/main/lib/offline-sync.ts"
click node_notifications "https://github.com/finflowa/app-financas/blob/main/lib/notifications.ts"
click node_mobileclient "https://github.com/finflowa/app-financas/blob/main/lib/supabase.ts"
click node_webclient "https://github.com/finflowa/app-financas/blob/main/web/src/lib/supabase/server.ts"
click node_financeai "https://github.com/finflowa/app-financas/blob/main/supabase/functions/finance-ai/index.ts"
click node_checkout "https://github.com/finflowa/app-financas/blob/main/supabase/functions/create-subscription-checkout/index.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_mobile,node_web,node_user toneBlue
class node_transactions,node_accounts,node_goals,node_cards,node_calendar,node_reports,node_assistant toneAmber
class node_auth,node_offline,node_notifications,node_mobileclient,node_webclient toneMint
class node_supabase,node_financeai,node_checkout toneRose
class node_paddle,node_ai_provider toneIndigo
```

## Components

### User interfaces

- [Expo app](https://github.com/finflowa/app-financas/blob/main/app/_layout.tsx): `app/_layout.tsx`
- [Web dashboard](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/layout.tsx): `web/src/app/(dashboard)/layout.tsx`

### Finance workflows

- [Transactions](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/transacoes/transaction-manager.tsx): `web/src/app/(dashboard)/transacoes/transaction-manager.tsx`
- [Accounts](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/contas/account-manager.tsx): `web/src/app/(dashboard)/contas/account-manager.tsx`
- [Financial goals](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/objetivos/objetivos-manager.tsx): `web/src/app/(dashboard)/objetivos/objetivos-manager.tsx`
- [Cards and invoices](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/cartoes/cartao-detalhe-manager.tsx): `web/src/app/(dashboard)/cartoes/cartao-detalhe-manager.tsx`
- [Calendar](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/calendario/calendar-manager.tsx): `web/src/app/(dashboard)/calendario/calendar-manager.tsx`
- [Reports](https://github.com/finflowa/app-financas/blob/main/web/src/app/(dashboard)/relatorios/page.tsx): `web/src/app/(dashboard)/relatorios/page.tsx`
- [Finance assistant](https://github.com/finflowa/app-financas/blob/main/app/chat-ia.tsx): `app/chat-ia.tsx`

### Shared client services

- [Authentication](https://github.com/finflowa/app-financas/blob/main/lib/auth-flow.ts): `lib/auth-flow.ts`
- [Offline sync](https://github.com/finflowa/app-financas/blob/main/lib/offline-sync.ts): `lib/offline-sync.ts`
- [Notifications](https://github.com/finflowa/app-financas/blob/main/lib/notifications.ts): `lib/notifications.ts`
- [Mobile data client](https://github.com/finflowa/app-financas/blob/main/lib/supabase.ts): `lib/supabase.ts`
- [Web data client](https://github.com/finflowa/app-financas/blob/main/web/src/lib/supabase/server.ts): `web/src/lib/supabase/server.ts`

### Backend services

- **Supabase data platform**
- [Finance AI function](https://github.com/finflowa/app-financas/blob/main/supabase/functions/finance-ai/index.ts): `supabase/functions/finance-ai/index.ts`
- [Subscription checkout](https://github.com/finflowa/app-financas/blob/main/supabase/functions/create-subscription-checkout/index.ts): `supabase/functions/create-subscription-checkout/index.ts`

### External integrations

- **Paddle Billing**
- **AI provider**

### Other components

- **Finance user**

## Connections

- Finance user → Expo app: uses (evidence: `README.md`)
- Finance user → Web dashboard: uses (evidence: `README.md`)
- Expo app → Authentication: handles sign-in (evidence: `app/_layout.tsx`)
- Expo app → Offline sync: syncs queued work (evidence: `app/_layout.tsx`)
- Expo app → Mobile data client: accesses data (evidence: `app/_layout.tsx`)
- Web dashboard → Web data client: accesses data (evidence: `README.md`)
- Transactions → Web data client: submits actions
- Transactions → Accounts: selects account (evidence: `web/src/app/(dashboard)/transacoes/transaction-manager.tsx`)
- Transactions → Financial goals: selects destination (evidence: `web/src/app/(dashboard)/transacoes/transaction-manager.tsx`)
- Calendar → Transactions: uses transaction data (evidence: `web/src/app/(dashboard)/calendario/calendar-manager.tsx`)
- Mobile data client → Supabase data platform: connects to (evidence: `README.md`)
- Web data client → Supabase data platform: connects to (evidence: `README.md`)
- Finance assistant → Finance AI function: requests assistance (evidence: `README.md`)
- Finance AI function → Supabase data platform: uses financial context (evidence: `README.md`)
- Finance AI function → AI provider: calls provider (evidence: `README.md`)
- Subscription checkout → Paddle Billing: creates checkout (evidence: `README.md`)
- Paddle Billing → Web dashboard: returns billing events (evidence: `README.md`)
- Accounts → Supabase data platform: shares financial data (evidence: `README.md`)
- Financial goals → Supabase data platform: shares financial data (evidence: `README.md`)
- Cards and invoices → Supabase data platform: shares financial data (evidence: `README.md`)
- Reports → Supabase data platform: reads shared data (evidence: `README.md`)
- Notifications → Expo app: schedules reminders (evidence: `app/_layout.tsx`)
