# llapasaranprincehilary-hash/money architecture

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

## Overview

FINUITY is a browser-based personal-finance app for tracking spending and other money activity, with learning, habit-building, receipt scanning, and paid VIP features. Users record income, expenses, loans, goals, and wallets in the main app; related modules provide summaries, education, coaching, and streak features. VIP purchases are confirmed server-side, while receipt scanning is described as on-device. The excerpts show only selected call and event relationships, so unsampled modules are represented as capabilities without speculative connections.

Main entry points: [`backend/functions/index.js`](https://github.com/llapasaranprincehilary-hash/money/blob/main/backend/functions/index.js) (Payment functions), [`app.js`](https://github.com/llapasaranprincehilary-hash/money/blob/main/app.js) (Finance app), [`virtual-pet/pet.js`](https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet.js) (Fin companion), [`life.js`](https://github.com/llapasaranprincehilary-hash/money/blob/main/life.js) (Habit challenges)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_finance["Money management"]
  node_app["Finance app<br/>[app.js]"]
  node_bills["Bills<br/>[bills.js]"]
  node_scan["Receipt scanning<br/>[scan.js]"]
end

subgraph group_engagement["Habits and guidance"]
  node_streak["Streaks<br/>[streak.js]"]
  node_life["Habit challenges<br/>[life.js]"]
  node_pet["Fin companion<br/>[pet.js]"]
  node_dialogue["Fin dialogue<br/>[pet-dialogue.js]"]
  node_coach["Fin coach<br/>[pet-coach.js]"]
  node_tour["Guided tour<br/>[tour.js]"]
  node_toursteps["Tour steps<br/>[tour-steps.js]"]
end

subgraph group_learning["Financial learning"]
  node_learn["Lessons and quizzes<br/>[learn.js]"]
end

subgraph group_vip["VIP and payments"]
  node_vip["VIP plans and limits<br/>[vip.js]"]
  node_payments["Payment functions<br/>[index.js]"]
end

subgraph group_platform["App platform"]
  node_icons["Icon library<br/>[icons.js]"]
  node_legal["Legal content<br/>[legal-data.js]"]
  node_serviceworker["Offline and notifications<br/>[sw.js]"]
end

node_user(("User"))
node_paymongo["PayMongo"]
node_firestore[("Firebase database")]

node_user -->|"records money"| node_app
node_app -->|"requests checkout"| node_payments
node_payments -->|"creates checkout"| node_paymongo
node_paymongo -->|"sends payment event"| node_payments
node_payments -->|"writes entitlements"| node_firestore
node_payments -->|"reads entitlements"| node_firestore
node_vip -->|"starts allowed scans"| node_scan
node_tour -->|"loads steps"| node_toursteps
node_pet -->|"calls app actions"| node_app
node_coach -->|"listens to app events"| node_app
node_learn -->|"dispatches learning events"| node_app
node_pet -->|"uses dialogue"| node_dialogue
node_life -->|"reads streak state"| node_streak

click node_app "https://github.com/llapasaranprincehilary-hash/money/blob/main/app.js"
click node_bills "https://github.com/llapasaranprincehilary-hash/money/blob/main/bills.js"
click node_scan "https://github.com/llapasaranprincehilary-hash/money/blob/main/scan.js"
click node_streak "https://github.com/llapasaranprincehilary-hash/money/blob/main/streak.js"
click node_life "https://github.com/llapasaranprincehilary-hash/money/blob/main/life.js"
click node_pet "https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet.js"
click node_dialogue "https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet-dialogue.js"
click node_coach "https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet-coach.js"
click node_tour "https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/tour.js"
click node_toursteps "https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/tour-steps.js"
click node_learn "https://github.com/llapasaranprincehilary-hash/money/blob/main/learn.js"
click node_vip "https://github.com/llapasaranprincehilary-hash/money/blob/main/vip.js"
click node_payments "https://github.com/llapasaranprincehilary-hash/money/blob/main/backend/functions/index.js"
click node_icons "https://github.com/llapasaranprincehilary-hash/money/blob/main/icons.js"
click node_legal "https://github.com/llapasaranprincehilary-hash/money/blob/main/legal-data.js"
click node_serviceworker "https://github.com/llapasaranprincehilary-hash/money/blob/main/sw.js"

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_bills,node_scan,node_user toneBlue
class node_streak,node_life,node_pet,node_dialogue,node_coach,node_tour,node_toursteps,node_firestore toneAmber
class node_learn toneMint
class node_vip,node_payments toneRose
class node_icons,node_legal,node_serviceworker,node_paymongo toneIndigo
```

## Components

### Money management

- [Finance app](https://github.com/llapasaranprincehilary-hash/money/blob/main/app.js): `app.js`
- [Bills](https://github.com/llapasaranprincehilary-hash/money/blob/main/bills.js): `bills.js`
- [Receipt scanning](https://github.com/llapasaranprincehilary-hash/money/blob/main/scan.js): `scan.js`

### Habits and guidance

- [Streaks](https://github.com/llapasaranprincehilary-hash/money/blob/main/streak.js): `streak.js`
- [Habit challenges](https://github.com/llapasaranprincehilary-hash/money/blob/main/life.js): `life.js`
- [Fin companion](https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet.js): `virtual-pet/pet.js`
- [Fin dialogue](https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet-dialogue.js): `virtual-pet/pet-dialogue.js`
- [Fin coach](https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/pet-coach.js): `virtual-pet/pet-coach.js`
- [Guided tour](https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/tour.js): `virtual-pet/tour.js`
- [Tour steps](https://github.com/llapasaranprincehilary-hash/money/blob/main/virtual-pet/tour-steps.js): `virtual-pet/tour-steps.js`

### Financial learning

- [Lessons and quizzes](https://github.com/llapasaranprincehilary-hash/money/blob/main/learn.js): `learn.js`

### VIP and payments

- [VIP plans and limits](https://github.com/llapasaranprincehilary-hash/money/blob/main/vip.js): `vip.js`
- [Payment functions](https://github.com/llapasaranprincehilary-hash/money/blob/main/backend/functions/index.js): `backend/functions/index.js`

### App platform

- [Icon library](https://github.com/llapasaranprincehilary-hash/money/blob/main/icons.js): `icons.js`
- [Legal content](https://github.com/llapasaranprincehilary-hash/money/blob/main/legal-data.js): `legal-data.js`
- [Offline and notifications](https://github.com/llapasaranprincehilary-hash/money/blob/main/sw.js): `sw.js`

### Other components

- **User**
- **PayMongo**
- **Firebase database**

## Connections

- User → Finance app: records money
- Finance app → Payment functions: requests checkout (evidence: `backend/functions/index.js`)
- Payment functions → PayMongo: creates checkout (evidence: `backend/functions/index.js`)
- PayMongo → Payment functions: sends payment event (evidence: `backend/functions/index.js`)
- Payment functions → Firebase database: writes entitlements (evidence: `backend/functions/index.js`)
- Payment functions → Firebase database: reads entitlements (evidence: `backend/functions/index.js`)
- VIP plans and limits → Receipt scanning: starts allowed scans (evidence: `vip.js`)
- Guided tour → Tour steps: loads steps (evidence: `virtual-pet/tour.js`)
- Fin companion → Finance app: calls app actions (evidence: `virtual-pet/pet.js`)
- Fin coach → Finance app: listens to app events (evidence: `virtual-pet/pet-coach.js`)
- Lessons and quizzes → Finance app: dispatches learning events (evidence: `learn.js`)
- Fin companion → Fin dialogue: uses dialogue (evidence: `virtual-pet/pet-dialogue.js`)
- Habit challenges → Streaks: reads streak state (evidence: `life.js`)
