# snroy380/finnytic architecture

> Architecture diagram of the GitHub repository snroy380/finnytic, 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/snroy380/finnytic
- Repository: https://github.com/snroy380/finnytic

## Overview

Finnytic is a personal-finance application for tracking transactions, budgets, savings goals, recurring payments, and financial trends. Users enter through authentication, then use dashboard and feature pages to manage finances and view analytics; the React client calls an Express API that applies authentication and delegates domain operations to a persistence layer. The README also documents theme preferences and Firebase/local persistence. Backend analytics and ML capabilities are represented from the documented routes and tree; their detailed runtime wiring was not sampled.

Main entry points: [`src/App.tsx`](https://github.com/snroy380/finnytic/blob/main/src/App.tsx) (App shell), [`server/src/routes/index.ts`](https://github.com/snroy380/finnytic/blob/main/server/src/routes/index.ts) (API route map), [`server/src/services/store.ts`](https://github.com/snroy380/finnytic/blob/main/server/src/services/store.ts) (Domain store), [`src/services/api.ts`](https://github.com/snroy380/finnytic/blob/main/src/services/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Finance client"]
  node_app["App shell<br/>[App.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_transactions_ui["Transactions<br/>[Transactions.tsx]"]
  node_budgets_ui["Budgets<br/>[Budgets.tsx]"]
  node_goals_ui["Savings goals<br/>[Goals.tsx]"]
  node_recurring_ui["Recurring items<br/>[Recurring.tsx]"]
  node_analytics_ui["Analytics view<br/>[Analytics.tsx]"]
  node_theme["Theme preferences<br/>[ThemeContext.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_ui["Sign-in and registration<br/>[AuthPage.tsx]"]
  node_auth_context["Auth state<br/>[AuthContext.tsx]"]
  node_auth_routes["Auth routes<br/>[authRoutes.ts]"]
  node_auth_controller["Auth operations<br/>[authController.ts]"]
  node_auth_middleware["JWT verification<br/>[auth.ts]"]
end

subgraph group_finance["Finance operations"]
  node_transaction_api["Transaction operations"]
  node_budget_api["Budget operations"]
  node_goal_api["Goal operations<br/>[goalController.ts]"]
  node_recurring_api["Recurring operations"]
end

subgraph group_platform["API and persistence"]
  node_api_client["API client<br/>[api.ts]"]
  node_express["Express API<br/>[server.ts]"]
  node_route_map["API route map<br/>[index.ts]"]
  node_store["Domain store<br/>[store.ts]"]
  node_mongo[("MongoDB<br/>[db.ts]")]
  node_firebase[("Firebase")]
  node_local_cache[("Browser persistence")]
end

subgraph group_intelligence["Insights and integrations"]
  node_analytics_api["Analytics operations"]
  node_ml_api["ML endpoints<br/>[mlController.ts]"]
  node_ml_service["ML service<br/>[main.py]"]
end

node_person(("Finance user"))

node_person -->|"uses"| node_app
node_app -->|"shows when signed out"| node_auth_ui
node_app -->|"renders signed-in shell"| node_layout
node_app -->|"selects page"| node_dashboard
node_app -->|"selects page"| node_transactions_ui
node_app -->|"selects page"| node_budgets_ui
node_app -->|"selects page"| node_goals_ui
node_app -->|"selects page"| node_recurring_ui
node_app -->|"selects page"| node_analytics_ui
node_app -->|"wraps with provider"| node_auth_context
node_app -->|"wraps with provider"| node_theme
node_auth_context -->|"calls"| node_api_client
node_auth_context -.->|"uses authentication"| node_firebase
node_auth_context -.->|"persists session"| node_local_cache
node_dashboard -->|"requests finance data"| node_api_client
node_transactions_ui -->|"requests transactions"| node_api_client
node_person -->|"manages finance"| node_api_client
node_api_client -->|"sends API requests"| node_express
node_express -->|"mounts routes"| node_route_map
node_route_map -->|"mounts"| node_auth_routes
node_route_map -->|"routes transactions"| node_transaction_api
node_route_map -->|"mounts budget routes"| node_budget_api
node_route_map -->|"mounts goal routes"| node_goal_api
node_route_map -->|"mounts recurring routes"| node_recurring_api
node_route_map -->|"mounts analytics routes"| node_analytics_api
node_route_map -->|"mounts ML routes"| node_ml_api
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects profile routes"| node_auth_middleware
node_auth_controller -->|"reads and updates users"| node_store
node_transaction_api -->|"reads and writes transactions"| node_store
node_budget_api -->|"manages budgets"| node_store
node_goal_api -->|"manages goals"| node_store
node_recurring_api -->|"manages schedules"| node_store
node_recurring_api -->|"creates due transactions"| node_transaction_api
node_analytics_api -.->|"derives financial insights"| node_store
node_ml_api -.->|"delegates inference"| node_ml_service
node_store -->|"uses when connected"| node_mongo

click node_app "https://github.com/snroy380/finnytic/blob/main/src/App.tsx"
click node_layout "https://github.com/snroy380/finnytic/blob/main/src/components/layout/AppLayout.tsx"
click node_dashboard "https://github.com/snroy380/finnytic/blob/main/src/pages/Dashboard.tsx"
click node_transactions_ui "https://github.com/snroy380/finnytic/blob/main/src/pages/Transactions.tsx"
click node_budgets_ui "https://github.com/snroy380/finnytic/blob/main/src/pages/Budgets.tsx"
click node_goals_ui "https://github.com/snroy380/finnytic/blob/main/src/pages/Goals.tsx"
click node_recurring_ui "https://github.com/snroy380/finnytic/blob/main/src/pages/Recurring.tsx"
click node_analytics_ui "https://github.com/snroy380/finnytic/blob/main/src/pages/Analytics.tsx"
click node_theme "https://github.com/snroy380/finnytic/blob/main/src/context/ThemeContext.tsx"
click node_auth_ui "https://github.com/snroy380/finnytic/blob/main/src/pages/AuthPage.tsx"
click node_auth_context "https://github.com/snroy380/finnytic/blob/main/src/context/AuthContext.tsx"
click node_api_client "https://github.com/snroy380/finnytic/blob/main/src/services/api.ts"
click node_express "https://github.com/snroy380/finnytic/blob/main/server.ts"
click node_route_map "https://github.com/snroy380/finnytic/blob/main/server/src/routes/index.ts"
click node_auth_routes "https://github.com/snroy380/finnytic/blob/main/server/src/routes/authRoutes.ts"
click node_auth_controller "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/authController.ts"
click node_auth_middleware "https://github.com/snroy380/finnytic/blob/main/server/src/middleware/auth.ts"
click node_transaction_api "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/transactionController.ts"
click node_budget_api "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/budgetController.ts"
click node_goal_api "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/goalController.ts"
click node_recurring_api "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/recurringController.ts"
click node_analytics_api "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/analyticsController.ts"
click node_ml_api "https://github.com/snroy380/finnytic/blob/main/server/src/controllers/mlController.ts"
click node_ml_service "https://github.com/snroy380/finnytic/blob/main/ml_service/main.py"
click node_store "https://github.com/snroy380/finnytic/blob/main/server/src/services/store.ts"
click node_mongo "https://github.com/snroy380/finnytic/blob/main/server/src/config/db.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_layout,node_dashboard,node_transactions_ui,node_budgets_ui,node_goals_ui,node_recurring_ui,node_analytics_ui,node_theme,node_person toneBlue
class node_auth_ui,node_auth_context,node_auth_routes,node_auth_controller,node_auth_middleware toneAmber
class node_transaction_api,node_budget_api,node_goal_api,node_recurring_api toneMint
class node_api_client,node_express,node_route_map,node_store,node_mongo,node_firebase,node_local_cache toneRose
class node_analytics_api,node_ml_api,node_ml_service toneIndigo
```

## Components

### Finance client

- [App shell](https://github.com/snroy380/finnytic/blob/main/src/App.tsx): `src/App.tsx`
- [App layout](https://github.com/snroy380/finnytic/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`
- [Dashboard](https://github.com/snroy380/finnytic/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Transactions](https://github.com/snroy380/finnytic/blob/main/src/pages/Transactions.tsx): `src/pages/Transactions.tsx`
- [Budgets](https://github.com/snroy380/finnytic/blob/main/src/pages/Budgets.tsx): `src/pages/Budgets.tsx`
- [Savings goals](https://github.com/snroy380/finnytic/blob/main/src/pages/Goals.tsx): `src/pages/Goals.tsx`
- [Recurring items](https://github.com/snroy380/finnytic/blob/main/src/pages/Recurring.tsx): `src/pages/Recurring.tsx`
- [Analytics view](https://github.com/snroy380/finnytic/blob/main/src/pages/Analytics.tsx): `src/pages/Analytics.tsx`
- [Theme preferences](https://github.com/snroy380/finnytic/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`

### Identity and access

- [Sign-in and registration](https://github.com/snroy380/finnytic/blob/main/src/pages/AuthPage.tsx): `src/pages/AuthPage.tsx`
- [Auth state](https://github.com/snroy380/finnytic/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Auth routes](https://github.com/snroy380/finnytic/blob/main/server/src/routes/authRoutes.ts): `server/src/routes/authRoutes.ts`
- [Auth operations](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/authController.ts): `server/src/controllers/authController.ts`
- [JWT verification](https://github.com/snroy380/finnytic/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`

### Finance operations

- [Transaction operations](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/transactionController.ts): `server/src/controllers/transactionController.ts`
- [Budget operations](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/budgetController.ts): `server/src/controllers/budgetController.ts`
- [Goal operations](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/goalController.ts): `server/src/controllers/goalController.ts`
- [Recurring operations](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/recurringController.ts): `server/src/controllers/recurringController.ts`

### API and persistence

- [API client](https://github.com/snroy380/finnytic/blob/main/src/services/api.ts): `src/services/api.ts`
- [Express API](https://github.com/snroy380/finnytic/blob/main/server.ts): `server.ts`
- [API route map](https://github.com/snroy380/finnytic/blob/main/server/src/routes/index.ts): `server/src/routes/index.ts`
- [Domain store](https://github.com/snroy380/finnytic/blob/main/server/src/services/store.ts): `server/src/services/store.ts`
- [MongoDB](https://github.com/snroy380/finnytic/blob/main/server/src/config/db.ts): `server/src/config/db.ts`
- **Firebase**
- **Browser persistence**

### Insights and integrations

- [Analytics operations](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/analyticsController.ts): `server/src/controllers/analyticsController.ts`
- [ML endpoints](https://github.com/snroy380/finnytic/blob/main/server/src/controllers/mlController.ts): `server/src/controllers/mlController.ts`
- [ML service](https://github.com/snroy380/finnytic/blob/main/ml_service/main.py): `ml_service/main.py`

### Other components

- **Finance user**

## Connections

- Finance user → App shell: uses (evidence: `README.md`)
- App shell → Sign-in and registration: shows when signed out (evidence: `src/App.tsx`)
- App shell → App layout: renders signed-in shell (evidence: `src/App.tsx`)
- App shell → Dashboard: selects page (evidence: `src/App.tsx`)
- App shell → Transactions: selects page (evidence: `src/App.tsx`)
- App shell → Budgets: selects page (evidence: `src/App.tsx`)
- App shell → Savings goals: selects page (evidence: `src/App.tsx`)
- App shell → Recurring items: selects page (evidence: `src/App.tsx`)
- App shell → Analytics view: selects page (evidence: `src/App.tsx`)
- App shell → Auth state: wraps with provider (evidence: `src/App.tsx`)
- App shell → Theme preferences: wraps with provider (evidence: `src/App.tsx`)
- Auth state → API client: calls (evidence: `src/context/AuthContext.tsx`)
- Auth state → Firebase: uses authentication (evidence: `src/context/AuthContext.tsx`)
- Auth state → Browser persistence: persists session (evidence: `README.md`)
- Dashboard → API client: requests finance data (evidence: `src/pages/Dashboard.tsx`)
- Transactions → API client: requests transactions (evidence: `src/pages/Transactions.tsx`)
- Finance user → API client: manages finance (evidence: `README.md`)
- API client → Express API: sends API requests (evidence: `README.md`)
- Express API → API route map: mounts routes (evidence: `server.ts`)
- API route map → Auth routes: mounts (evidence: `server/src/routes/index.ts`)
- API route map → Transaction operations: routes transactions (evidence: `server/src/routes/index.ts`)
- API route map → Budget operations: mounts budget routes (evidence: `server/src/routes/index.ts`)
- API route map → Goal operations: mounts goal routes (evidence: `server/src/routes/index.ts`)
- API route map → Recurring operations: mounts recurring routes (evidence: `server/src/routes/index.ts`)
- API route map → Analytics operations: mounts analytics routes (evidence: `server/src/routes/index.ts`)
- API route map → ML endpoints: mounts ML routes (evidence: `server/src/routes/index.ts`)
- Auth routes → Auth operations: dispatches (evidence: `server/src/routes/authRoutes.ts`)
- Auth routes → JWT verification: protects profile routes (evidence: `server/src/routes/authRoutes.ts`)
- Auth operations → Domain store: reads and updates users (evidence: `server/src/controllers/authController.ts`)
- Transaction operations → Domain store: reads and writes transactions (evidence: `server/src/services/store.ts`)
- Budget operations → Domain store: manages budgets
- Goal operations → Domain store: manages goals (evidence: `server/src/controllers/goalController.ts`)
- Recurring operations → Domain store: manages schedules (evidence: `server/src/controllers/recurringController.ts`)
- Recurring operations → Transaction operations: creates due transactions (evidence: `server/src/controllers/recurringController.ts`)
- Analytics operations → Domain store: derives financial insights
- ML endpoints → ML service: delegates inference
- Domain store → MongoDB: uses when connected (evidence: `server/src/services/store.ts`)
