# avvi575/family-expense-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/avvi575/family-expense-tracker
- Repository: https://github.com/avvi575/family-expense-tracker

## Overview

Family Expense Tracker is a shared family-finance product with React web and Android clients backed by a NestJS REST API. Users authenticate or accept an invitation, select or create a family, then record and review expenses, income, budgets, goals, and reports. The API also supports statement imports, recurring expenses, notifications, and alert rules. The source excerpts and index show key routing and service calls; several substantial feature services were not sampled, so their internal processing links are intentionally omitted.

Main entry points: [`web/src/App.tsx`](https://github.com/avvi575/family-expense-tracker/blob/main/web/src/App.tsx) (Web application), [`backend/src/auth/auth.service.ts`](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/auth/auth.service.ts) (Authentication), [`backend/src/common/prisma.service.ts`](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/common/prisma.service.ts) (Prisma data access), [`android/app/src/main/java/com/fet/app/data/ApiClient.kt`](https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/data/ApiClient.kt) (Mobile API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_webapp["Web application<br/>[App.tsx]"]
  node_android["Android application<br/>[MainActivity.kt]"]
  node_androidview["Mobile view model<br/>[AppViewModel.kt]"]
  node_androidapi["Mobile API client<br/>[ApiClient.kt]"]
  node_session["Mobile session<br/>[SessionManager.kt]"]
end

subgraph group_identity["Identity and families"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_families["Family membership"]
end

subgraph group_finance["Finance workflows"]
  node_expenses["Expense tracking"]
  node_income["Income tracking"]
  node_categories["Categories"]
  node_budgets["Budgets"]
  node_goals["Savings goals"]
  node_recurring["Recurring expenses"]
  node_statements["Statement imports"]
  node_parser["Statement parser<br/>[parser.registry.ts]"]
end

subgraph group_insights["Insights and alerts"]
  node_reports["Financial reports"]
  node_notifications["Notifications"]
  node_alerts["Alert rules"]
end

subgraph group_platform["API and persistence"]
  node_api["REST API<br/>[main.ts]"]
  node_database[("Prisma data access<br/>[prisma.service.ts]")]
  node_delivery["Message delivery"]
end

node_user(("Family user"))

node_user -->|"uses"| node_webapp
node_user -->|"uses"| node_android
node_webapp -.->|"authenticates via API"| node_auth
node_android -->|"starts"| node_androidview
node_androidview -->|"calls"| node_androidapi
node_androidapi -->|"reads token"| node_session
node_androidapi -.->|"sends REST requests"| node_api
node_webapp -->|"loads families"| node_families
node_auth -->|"adds invite member"| node_families
node_auth -->|"sends reset email"| node_delivery
node_webapp -->|"routes expense work"| node_expenses
node_webapp -->|"routes income work"| node_income
node_webapp -->|"routes imports"| node_statements
node_statements -.->|"selects parser"| node_parser
node_webapp -->|"routes budgets"| node_budgets
node_webapp -->|"routes goals"| node_goals
node_budgets -->|"creates alerts"| node_notifications
node_webapp -.->|"routes dashboard"| node_reports
node_expenses -.->|"persists records"| node_database
node_families -->|"stores membership"| node_database
node_auth -->|"reads and writes users"| node_database
node_notifications -.->|"persists notifications"| node_database
node_user -.->|"configures rules"| node_alerts
node_user -.->|"manages schedules"| node_recurring

click node_webapp "https://github.com/avvi575/family-expense-tracker/blob/main/web/src/App.tsx"
click node_android "https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/MainActivity.kt"
click node_androidview "https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/ui/AppViewModel.kt"
click node_androidapi "https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/data/ApiClient.kt"
click node_session "https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/data/SessionManager.kt"
click node_auth "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/auth/auth.service.ts"
click node_families "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/families/families.service.ts"
click node_expenses "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/expenses/expenses.controller.ts"
click node_income "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/incomes/incomes.controller.ts"
click node_categories "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/categories/categories.controller.ts"
click node_budgets "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/budgets/budgets.controller.ts"
click node_goals "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/goals/goals.controller.ts"
click node_recurring "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/recurring/recurring.controller.ts"
click node_statements "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/statement-import/bank-statement.controller.ts"
click node_parser "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/statement-import/parsers/parser.registry.ts"
click node_reports "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/reports/reports.controller.ts"
click node_notifications "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/notifications/notifications.service.ts"
click node_alerts "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/alerts/alerts.controller.ts"
click node_api "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/main.ts"
click node_database "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/common/prisma.service.ts"
click node_delivery "https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/comms/delivery.service.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_webapp,node_android,node_androidview,node_androidapi,node_session,node_user toneBlue
class node_auth,node_families toneAmber
class node_expenses,node_income,node_categories,node_budgets,node_goals,node_recurring,node_statements,node_parser toneMint
class node_reports,node_notifications,node_alerts toneRose
class node_api,node_database,node_delivery toneIndigo
```

## Components

### User clients

- [Web application](https://github.com/avvi575/family-expense-tracker/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Android application](https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/MainActivity.kt): `android/app/src/main/java/com/fet/app/MainActivity.kt`
- [Mobile view model](https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/ui/AppViewModel.kt): `android/app/src/main/java/com/fet/app/ui/AppViewModel.kt`
- [Mobile API client](https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/data/ApiClient.kt): `android/app/src/main/java/com/fet/app/data/ApiClient.kt`
- [Mobile session](https://github.com/avvi575/family-expense-tracker/blob/main/android/app/src/main/java/com/fet/app/data/SessionManager.kt): `android/app/src/main/java/com/fet/app/data/SessionManager.kt`

### Identity and families

- [Authentication](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [Family membership](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/families/families.service.ts): `backend/src/families/families.service.ts`

### Finance workflows

- [Expense tracking](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/expenses/expenses.controller.ts): `backend/src/expenses/expenses.controller.ts`
- [Income tracking](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/incomes/incomes.controller.ts): `backend/src/incomes/incomes.controller.ts`
- [Categories](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/categories/categories.controller.ts): `backend/src/categories/categories.controller.ts`
- [Budgets](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/budgets/budgets.controller.ts): `backend/src/budgets/budgets.controller.ts`
- [Savings goals](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/goals/goals.controller.ts): `backend/src/goals/goals.controller.ts`
- [Recurring expenses](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/recurring/recurring.controller.ts): `backend/src/recurring/recurring.controller.ts`
- [Statement imports](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/statement-import/bank-statement.controller.ts): `backend/src/statement-import/bank-statement.controller.ts`
- [Statement parser](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/statement-import/parsers/parser.registry.ts): `backend/src/statement-import/parsers/parser.registry.ts`

### Insights and alerts

- [Financial reports](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/reports/reports.controller.ts): `backend/src/reports/reports.controller.ts`
- [Notifications](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/notifications/notifications.service.ts): `backend/src/notifications/notifications.service.ts`
- [Alert rules](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/alerts/alerts.controller.ts): `backend/src/alerts/alerts.controller.ts`

### API and persistence

- [REST API](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/main.ts): `backend/src/main.ts`
- [Prisma data access](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/common/prisma.service.ts): `backend/src/common/prisma.service.ts`
- [Message delivery](https://github.com/avvi575/family-expense-tracker/blob/main/backend/src/comms/delivery.service.ts): `backend/src/comms/delivery.service.ts`

### Other components

- **Family user**

## Connections

- Family user → Web application: uses (evidence: `web/src/App.tsx`)
- Family user → Android application: uses (evidence: `android/app/src/main/java/com/fet/app/MainActivity.kt`)
- Web application → Authentication: authenticates via API (evidence: `README.md`)
- Android application → Mobile view model: starts (evidence: `android/app/src/main/java/com/fet/app/MainActivity.kt`)
- Mobile view model → Mobile API client: calls (evidence: `android/app/src/main/java/com/fet/app/ui/AppViewModel.kt`)
- Mobile API client → Mobile session: reads token (evidence: `android/app/src/main/java/com/fet/app/data/ApiClient.kt`)
- Mobile API client → REST API: sends REST requests (evidence: `README.md`)
- Web application → Family membership: loads families (evidence: `web/src/App.tsx`)
- Authentication → Family membership: adds invite member (evidence: `backend/src/auth/auth.service.ts`)
- Authentication → Message delivery: sends reset email (evidence: `backend/src/auth/auth.service.ts`)
- Web application → Expense tracking: routes expense work (evidence: `web/src/App.tsx`)
- Web application → Income tracking: routes income work (evidence: `web/src/App.tsx`)
- Web application → Statement imports: routes imports (evidence: `web/src/App.tsx`)
- Statement imports → Statement parser: selects parser
- Web application → Budgets: routes budgets (evidence: `web/src/App.tsx`)
- Web application → Savings goals: routes goals (evidence: `web/src/App.tsx`)
- Budgets → Notifications: creates alerts
- Web application → Financial reports: routes dashboard (evidence: `web/src/App.tsx`)
- Expense tracking → Prisma data access: persists records
- Family membership → Prisma data access: stores membership (evidence: `backend/src/families/families.service.ts`)
- Authentication → Prisma data access: reads and writes users (evidence: `backend/src/auth/auth.service.ts`)
- Notifications → Prisma data access: persists notifications
- Family user → Alert rules: configures rules (evidence: `README.md`)
- Family user → Recurring expenses: manages schedules (evidence: `README.md`)
