# saravanan-1986/finnova architecture

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

- Interactive diagram: https://gitdiagram.com/saravanan-1986/finnova
- Repository: https://github.com/saravanan-1986/finnova

## Overview

FINNOVA is a personal-finance planning app. Users sign in, then track spending, bills, goals, subscriptions and safety nets; they can also scan receipts, explore insurance and government schemes, and complete daily finance quizzes that award points. The React client calls an authenticated Express API backed by MongoDB. The graph preserves these distinct product areas and the insurance, learning and rewards logic. Some route and page implementations were not sampled, so their links rely on documented capabilities or are omitted where evidence is unavailable.

Main entry points: [`server/src/index.js`](https://github.com/saravanan-1986/finnova/blob/main/server/src/index.js) (Express API), [`client/src/App.jsx`](https://github.com/saravanan-1986/finnova/blob/main/client/src/App.jsx) (Application routes), [`client/src/services/api.js`](https://github.com/saravanan-1986/finnova/blob/main/client/src/services/api.js) (API client), [`server/src/models`](https://github.com/saravanan-1986/finnova/tree/main/server/src/models) (MongoDB records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Finance workspace"]
  node_app["Application routes<br/>[App.jsx]"]
  node_authui["Sign-in state<br/>[AuthContext.jsx]"]
  node_financepages["Finance planning"]
  node_receipts["Receipt scanning<br/>[ReceiptScanner.jsx]"]
  node_subscriptions["Subscriptions<br/>[Subscriptions.jsx]"]
  node_transport["API client<br/>[api.js]"]
end

subgraph group_cover["Insurance and schemes"]
  node_insuranceui["Insurance explorer"]
  node_covercalc["Coverage calculator"]
  node_insuranceapi["Insurance endpoints<br/>[insuranceRoutes.js]"]
  node_schemeapi["Scheme endpoints<br/>[schemeRoutes.js]"]
  node_coverlogic["Coverage and health"]
end

subgraph group_learn["Learning and rewards"]
  node_learnui["Daily learning<br/>[LearnFinance.jsx]"]
  node_pointsui["Points state<br/>[PointsContext.jsx]"]
  node_learningapi["Learning endpoints<br/>[learningRoutes.js]"]
  node_learninglogic["Lesson selection<br/>[learningService.js]"]
  node_pointslogic["Points ledger logic<br/>[pointsService.js]"]
end

subgraph group_server["API and domain services"]
  node_api["Express API<br/>[index.js]"]
  node_auth["JWT protection<br/>[auth.js]"]
  node_financeapi["Finance endpoints"]
  node_receiptapi["Receipt endpoint<br/>[receiptRoutes.js]"]
  node_subscriptionapi["Subscription endpoint"]
  node_data[("MongoDB records")]
  node_ocr["Receipt OCR and parsing"]
end

node_user(("Finance user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_financepages
node_app -->|"routes to"| node_receipts
node_app -->|"routes to"| node_subscriptions
node_app -->|"routes to"| node_insuranceui
node_app -->|"routes to"| node_learnui
node_authui -->|"calls"| node_transport
node_insuranceui -->|"calls"| node_transport
node_covercalc -->|"calls"| node_transport
node_learnui -->|"calls"| node_transport
node_learnui -->|"reads"| node_pointsui
node_pointsui -->|"calls"| node_transport
node_transport -->|"HTTP requests"| node_api
node_api -->|"protects routes"| node_auth
node_api -->|"mounts routes"| node_financeapi
node_api -->|"mounts routes"| node_receiptapi
node_api -->|"mounts routes"| node_subscriptionapi
node_api -->|"mounts routes"| node_insuranceapi
node_api -->|"mounts routes"| node_schemeapi
node_api -->|"mounts routes"| node_learningapi
node_insuranceapi -->|"uses"| node_coverlogic
node_schemeapi -->|"uses"| node_coverlogic
node_schemeapi -->|"reads"| node_data
node_receiptapi -->|"calls"| node_ocr
node_receiptapi -->|"writes expenses"| node_data
node_subscriptionapi -->|"reads and writes"| node_data
node_learningapi -->|"gets lessons"| node_learninglogic
node_learningapi -->|"awards points"| node_pointslogic
node_learningapi -->|"stores progress"| node_data
node_learninglogic -->|"reads lessons"| node_data
node_pointslogic -->|"writes ledger"| node_data

click node_app "https://github.com/saravanan-1986/finnova/blob/main/client/src/App.jsx"
click node_authui "https://github.com/saravanan-1986/finnova/blob/main/client/src/context/AuthContext.jsx"
click node_financepages "https://github.com/saravanan-1986/finnova/tree/main/client/src/pages"
click node_receipts "https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/ReceiptScanner.jsx"
click node_subscriptions "https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/Subscriptions.jsx"
click node_insuranceui "https://github.com/saravanan-1986/finnova/tree/main/client/src/pages/Insurance"
click node_covercalc "https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/Insurance/CoverageCalculator.jsx"
click node_learnui "https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/LearnFinance.jsx"
click node_pointsui "https://github.com/saravanan-1986/finnova/blob/main/client/src/context/PointsContext.jsx"
click node_transport "https://github.com/saravanan-1986/finnova/blob/main/client/src/services/api.js"
click node_api "https://github.com/saravanan-1986/finnova/blob/main/server/src/index.js"
click node_auth "https://github.com/saravanan-1986/finnova/blob/main/server/src/middleware/auth.js"
click node_financeapi "https://github.com/saravanan-1986/finnova/tree/main/server/src/routes"
click node_receiptapi "https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/receiptRoutes.js"
click node_subscriptionapi "https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/subscriptionRoutes.js"
click node_insuranceapi "https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/insuranceRoutes.js"
click node_schemeapi "https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/schemeRoutes.js"
click node_coverlogic "https://github.com/saravanan-1986/finnova/tree/main/server/src/services"
click node_learningapi "https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/learningRoutes.js"
click node_learninglogic "https://github.com/saravanan-1986/finnova/blob/main/server/src/services/learningService.js"
click node_pointslogic "https://github.com/saravanan-1986/finnova/blob/main/server/src/services/pointsService.js"
click node_data "https://github.com/saravanan-1986/finnova/tree/main/server/src/models"
click node_ocr "https://github.com/saravanan-1986/finnova/tree/main/server/src/services"

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_authui,node_financepages,node_receipts,node_subscriptions,node_transport,node_user toneBlue
class node_insuranceui,node_covercalc,node_insuranceapi,node_schemeapi,node_coverlogic toneAmber
class node_learnui,node_pointsui,node_learningapi,node_learninglogic,node_pointslogic toneMint
class node_api,node_auth,node_financeapi,node_receiptapi,node_subscriptionapi,node_data,node_ocr toneRose
```

## Components

### Finance workspace

- [Application routes](https://github.com/saravanan-1986/finnova/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in state](https://github.com/saravanan-1986/finnova/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Finance planning](https://github.com/saravanan-1986/finnova/tree/main/client/src/pages): `client/src/pages`
- [Receipt scanning](https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/ReceiptScanner.jsx): `client/src/pages/ReceiptScanner.jsx`
- [Subscriptions](https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/Subscriptions.jsx): `client/src/pages/Subscriptions.jsx`
- [API client](https://github.com/saravanan-1986/finnova/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Insurance and schemes

- [Insurance explorer](https://github.com/saravanan-1986/finnova/tree/main/client/src/pages/Insurance): `client/src/pages/Insurance`
- [Coverage calculator](https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/Insurance/CoverageCalculator.jsx): `client/src/pages/Insurance/CoverageCalculator.jsx`
- [Insurance endpoints](https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/insuranceRoutes.js): `server/src/routes/insuranceRoutes.js`
- [Scheme endpoints](https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/schemeRoutes.js): `server/src/routes/schemeRoutes.js`
- [Coverage and health](https://github.com/saravanan-1986/finnova/tree/main/server/src/services): `server/src/services`

### Learning and rewards

- [Daily learning](https://github.com/saravanan-1986/finnova/blob/main/client/src/pages/LearnFinance.jsx): `client/src/pages/LearnFinance.jsx`
- [Points state](https://github.com/saravanan-1986/finnova/blob/main/client/src/context/PointsContext.jsx): `client/src/context/PointsContext.jsx`
- [Learning endpoints](https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/learningRoutes.js): `server/src/routes/learningRoutes.js`
- [Lesson selection](https://github.com/saravanan-1986/finnova/blob/main/server/src/services/learningService.js): `server/src/services/learningService.js`
- [Points ledger logic](https://github.com/saravanan-1986/finnova/blob/main/server/src/services/pointsService.js): `server/src/services/pointsService.js`

### API and domain services

- [Express API](https://github.com/saravanan-1986/finnova/blob/main/server/src/index.js): `server/src/index.js`
- [JWT protection](https://github.com/saravanan-1986/finnova/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Finance endpoints](https://github.com/saravanan-1986/finnova/tree/main/server/src/routes): `server/src/routes`
- [Receipt endpoint](https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/receiptRoutes.js): `server/src/routes/receiptRoutes.js`
- [Subscription endpoint](https://github.com/saravanan-1986/finnova/blob/main/server/src/routes/subscriptionRoutes.js): `server/src/routes/subscriptionRoutes.js`
- [MongoDB records](https://github.com/saravanan-1986/finnova/tree/main/server/src/models): `server/src/models`
- [Receipt OCR and parsing](https://github.com/saravanan-1986/finnova/tree/main/server/src/services): `server/src/services`

### Other components

- **Finance user**

## Connections

- Finance user → Application routes: uses
- Application routes → Finance planning: routes to (evidence: `client/src/App.jsx`)
- Application routes → Receipt scanning: routes to (evidence: `client/src/App.jsx`)
- Application routes → Subscriptions: routes to (evidence: `client/src/App.jsx`)
- Application routes → Insurance explorer: routes to (evidence: `client/src/App.jsx`)
- Application routes → Daily learning: routes to (evidence: `client/src/App.jsx`)
- Sign-in state → API client: calls (evidence: `client/src/context/AuthContext.jsx`)
- Insurance explorer → API client: calls (evidence: `client/src/pages/Insurance/InsuranceOverview.jsx`)
- Coverage calculator → API client: calls (evidence: `client/src/pages/Insurance/CoverageCalculator.jsx`)
- Daily learning → API client: calls (evidence: `client/src/pages/LearnFinance.jsx`)
- Daily learning → Points state: reads (evidence: `client/src/pages/LearnFinance.jsx`)
- Points state → API client: calls (evidence: `client/src/context/PointsContext.jsx`)
- API client → Express API: HTTP requests
- Express API → JWT protection: protects routes (evidence: `server/src/index.js`)
- Express API → Finance endpoints: mounts routes (evidence: `server/src/index.js`)
- Express API → Receipt endpoint: mounts routes (evidence: `server/src/index.js`)
- Express API → Subscription endpoint: mounts routes (evidence: `server/src/index.js`)
- Express API → Insurance endpoints: mounts routes (evidence: `server/src/index.js`)
- Express API → Scheme endpoints: mounts routes (evidence: `server/src/index.js`)
- Express API → Learning endpoints: mounts routes (evidence: `server/src/index.js`)
- Insurance endpoints → Coverage and health: uses (evidence: `server/src/routes/insuranceRoutes.js`)
- Scheme endpoints → Coverage and health: uses (evidence: `server/src/routes/schemeRoutes.js`)
- Scheme endpoints → MongoDB records: reads (evidence: `server/src/routes/schemeRoutes.js`)
- Receipt endpoint → Receipt OCR and parsing: calls (evidence: `server/src/routes/receiptRoutes.js`)
- Receipt endpoint → MongoDB records: writes expenses (evidence: `server/src/routes/receiptRoutes.js`)
- Subscription endpoint → MongoDB records: reads and writes (evidence: `server/src/routes/subscriptionRoutes.js`)
- Learning endpoints → Lesson selection: gets lessons (evidence: `server/src/routes/learningRoutes.js`)
- Learning endpoints → Points ledger logic: awards points (evidence: `server/src/routes/learningRoutes.js`)
- Learning endpoints → MongoDB records: stores progress (evidence: `server/src/routes/learningRoutes.js`)
- Lesson selection → MongoDB records: reads lessons (evidence: `server/src/services/learningService.js`)
- Points ledger logic → MongoDB records: writes ledger (evidence: `server/src/services/pointsService.js`)
