# quinnyen/catsplit-app architecture

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

- Interactive diagram: https://gitdiagram.com/quinnyen/catsplit-app
- Repository: https://github.com/quinnyen/catsplit-app

## Overview

CatSplit is a LINE LIFF-centered group expense-sharing app, with Google and guest access, backed by Firebase and Cloud Functions. The main flow is user sign-in or group invitation, group expense entry, shared balance and settlement, then recording transfers. Alongside it are personal ledgers, savings goals, and foreign-exchange trip tools. The graph also includes account identity operations and the shared localization layer. Some feature implementations were not sampled; those branches and relationships are based on README statements, while uncertain internal calls are omitted.

Main entry points: [`src/pages/GroupPage.jsx`](https://github.com/quinnyen/catsplit-app/blob/main/src/pages/GroupPage.jsx) (Group timeline), [`src/App.jsx`](https://github.com/quinnyen/catsplit-app/blob/main/src/App.jsx) (App router), [`src/context/AppContext.jsx`](https://github.com/quinnyen/catsplit-app/blob/main/src/context/AppContext.jsx) (Session and login), [`functions/index.js`](https://github.com/quinnyen/catsplit-app/blob/main/functions/index.js) (Cloud API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App and identity"]
  node_app["App router<br/>[App.jsx]"]
  node_session["Session and login<br/>[AppContext.jsx]"]
  node_authcallback["OAuth callback"]
  node_groupslist["Group listing<br/>[useMyGroups.js]"]
end

subgraph group_sharing["Group expense sharing"]
  node_group["Group timeline<br/>[GroupPage.jsx]"]
  node_expense["Expense calculations<br/>[expenseHelpers.js]"]
  node_settlement["Settlement and transfers<br/>[SettlePage.jsx]"]
  node_groupadmin["Membership and settings<br/>[MembersPage.jsx]"]
end

subgraph group_personal["Personal finance"]
  node_ledger["Personal ledger"]
  node_savings["Savings goals"]
  node_fx["FX and trips"]
end

subgraph group_backend["Cloud services"]
  node_firebase[("Firebase services<br/>[firebase.js]")]
  node_functions["Cloud API<br/>[index.js]"]
  node_identity["Identity resolution<br/>[identity.js]"]
  node_binding["Identity binding<br/>[bind.js]"]
  node_merge["Account merge<br/>[mergeFlow.js]"]
  node_memberops["Member operations<br/>[memberOps.js]"]
end

subgraph group_shared["Shared services"]
  node_liff["LINE LIFF<br/>[liff.js]"]
  node_currency["Currency definitions<br/>[currencies.js]"]
  node_i18n["Localization provider<br/>[I18nProvider.jsx]"]
  node_i18ncore["Translation core<br/>[core.js]"]
  node_i18ncodes["Localized labels<br/>[codes.js]"]
  node_english["English dictionary<br/>[en.js]"]
  node_chinese["Traditional Chinese dictionary<br/>[zh-TW.js]"]
end

node_member(("Users"))

node_member -->|"opens"| node_app
node_app -->|"routes to"| node_group
node_app -->|"uses session"| node_session
node_app -->|"loads groups"| node_groupslist
node_authcallback -->|"completes OAuth"| node_session
node_session -->|"initializes"| node_liff
node_session -->|"authenticates"| node_firebase
node_groupslist -->|"queries groups"| node_firebase
node_group -->|"filters entries"| node_expense
node_group -->|"reads group data"| node_firebase
node_member -->|"records expenses"| node_group
node_member -->|"settles balances"| node_settlement
node_member -->|"manages membership"| node_groupadmin
node_member -->|"tracks personal finances"| node_ledger
node_member -->|"tracks savings"| node_savings
node_member -->|"uses FX tools"| node_fx
node_functions -->|"resolves identity"| node_identity
node_functions -->|"parses bind request"| node_binding
node_functions -->|"runs identity flow"| node_merge
node_merge -->|"uses bind flow"| node_binding
node_merge -->|"uses member operations"| node_memberops
node_i18n -->|"translates with"| node_i18ncore
node_i18n -->|"loads dictionary"| node_english
node_i18n -->|"loads dictionary"| node_chinese
node_group -->|"uses category codes"| node_i18ncodes
node_expense -->|"translates labels"| node_i18ncore

click node_app "https://github.com/quinnyen/catsplit-app/blob/main/src/App.jsx"
click node_session "https://github.com/quinnyen/catsplit-app/blob/main/src/context/AppContext.jsx"
click node_authcallback "https://github.com/quinnyen/catsplit-app/blob/main/src/pages/AuthCallbackPage.jsx"
click node_groupslist "https://github.com/quinnyen/catsplit-app/blob/main/src/hooks/useMyGroups.js"
click node_group "https://github.com/quinnyen/catsplit-app/blob/main/src/pages/GroupPage.jsx"
click node_expense "https://github.com/quinnyen/catsplit-app/blob/main/src/utils/expenseHelpers.js"
click node_settlement "https://github.com/quinnyen/catsplit-app/blob/main/src/pages/SettlePage.jsx"
click node_groupadmin "https://github.com/quinnyen/catsplit-app/blob/main/src/pages/MembersPage.jsx"
click node_ledger "https://github.com/quinnyen/catsplit-app/tree/main/src/features/ledger"
click node_savings "https://github.com/quinnyen/catsplit-app/blob/main/src/pages/SavingsGoalPage.jsx"
click node_fx "https://github.com/quinnyen/catsplit-app/tree/main/src/features/fx"
click node_firebase "https://github.com/quinnyen/catsplit-app/blob/main/src/config/firebase.js"
click node_functions "https://github.com/quinnyen/catsplit-app/blob/main/functions/index.js"
click node_identity "https://github.com/quinnyen/catsplit-app/blob/main/functions/identity.js"
click node_binding "https://github.com/quinnyen/catsplit-app/blob/main/functions/bind.js"
click node_merge "https://github.com/quinnyen/catsplit-app/blob/main/functions/mergeFlow.js"
click node_memberops "https://github.com/quinnyen/catsplit-app/blob/main/functions/memberOps.js"
click node_liff "https://github.com/quinnyen/catsplit-app/blob/main/src/config/liff.js"
click node_currency "https://github.com/quinnyen/catsplit-app/blob/main/src/config/currencies.js"
click node_i18n "https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/I18nProvider.jsx"
click node_i18ncore "https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/core.js"
click node_i18ncodes "https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/codes.js"
click node_english "https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/en.js"
click node_chinese "https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/zh-TW.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_session,node_authcallback,node_groupslist,node_member toneBlue
class node_group,node_expense,node_settlement,node_groupadmin toneAmber
class node_ledger,node_savings,node_fx toneMint
class node_firebase,node_functions,node_identity,node_binding,node_merge,node_memberops toneRose
class node_liff,node_currency,node_i18n,node_i18ncore,node_i18ncodes,node_english,node_chinese toneIndigo
```

## Components

### App and identity

- [App router](https://github.com/quinnyen/catsplit-app/blob/main/src/App.jsx): `src/App.jsx`
- [Session and login](https://github.com/quinnyen/catsplit-app/blob/main/src/context/AppContext.jsx): `src/context/AppContext.jsx`
- [OAuth callback](https://github.com/quinnyen/catsplit-app/blob/main/src/pages/AuthCallbackPage.jsx): `src/pages/AuthCallbackPage.jsx`
- [Group listing](https://github.com/quinnyen/catsplit-app/blob/main/src/hooks/useMyGroups.js): `src/hooks/useMyGroups.js`

### Group expense sharing

- [Group timeline](https://github.com/quinnyen/catsplit-app/blob/main/src/pages/GroupPage.jsx): `src/pages/GroupPage.jsx`
- [Expense calculations](https://github.com/quinnyen/catsplit-app/blob/main/src/utils/expenseHelpers.js): `src/utils/expenseHelpers.js`
- [Settlement and transfers](https://github.com/quinnyen/catsplit-app/blob/main/src/pages/SettlePage.jsx): `src/pages/SettlePage.jsx`
- [Membership and settings](https://github.com/quinnyen/catsplit-app/blob/main/src/pages/MembersPage.jsx): `src/pages/MembersPage.jsx`

### Personal finance

- [Personal ledger](https://github.com/quinnyen/catsplit-app/tree/main/src/features/ledger): `src/features/ledger`
- [Savings goals](https://github.com/quinnyen/catsplit-app/blob/main/src/pages/SavingsGoalPage.jsx): `src/pages/SavingsGoalPage.jsx`
- [FX and trips](https://github.com/quinnyen/catsplit-app/tree/main/src/features/fx): `src/features/fx`

### Cloud services

- [Firebase services](https://github.com/quinnyen/catsplit-app/blob/main/src/config/firebase.js): `src/config/firebase.js`
- [Cloud API](https://github.com/quinnyen/catsplit-app/blob/main/functions/index.js): `functions/index.js`
- [Identity resolution](https://github.com/quinnyen/catsplit-app/blob/main/functions/identity.js): `functions/identity.js`
- [Identity binding](https://github.com/quinnyen/catsplit-app/blob/main/functions/bind.js): `functions/bind.js`
- [Account merge](https://github.com/quinnyen/catsplit-app/blob/main/functions/mergeFlow.js): `functions/mergeFlow.js`
- [Member operations](https://github.com/quinnyen/catsplit-app/blob/main/functions/memberOps.js): `functions/memberOps.js`

### Shared services

- [LINE LIFF](https://github.com/quinnyen/catsplit-app/blob/main/src/config/liff.js): `src/config/liff.js`
- [Currency definitions](https://github.com/quinnyen/catsplit-app/blob/main/src/config/currencies.js): `src/config/currencies.js`
- [Localization provider](https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/I18nProvider.jsx): `src/i18n/I18nProvider.jsx`
- [Translation core](https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/core.js): `src/i18n/core.js`
- [Localized labels](https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/codes.js): `src/i18n/codes.js`
- [English dictionary](https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/en.js): `src/i18n/en.js`
- [Traditional Chinese dictionary](https://github.com/quinnyen/catsplit-app/blob/main/src/i18n/zh-TW.js): `src/i18n/zh-TW.js`

### Other components

- **Users**

## Connections

- Users → App router: opens (evidence: `src/App.jsx`)
- App router → Group timeline: routes to (evidence: `src/App.jsx`)
- App router → Session and login: uses session (evidence: `src/App.jsx`)
- App router → Group listing: loads groups (evidence: `src/App.jsx`)
- OAuth callback → Session and login: completes OAuth (evidence: `src/pages/AuthCallbackPage.jsx`)
- Session and login → LINE LIFF: initializes (evidence: `src/context/AppContext.jsx`)
- Session and login → Firebase services: authenticates (evidence: `src/context/AppContext.jsx`)
- Group listing → Firebase services: queries groups (evidence: `src/hooks/useMyGroups.js`)
- Group timeline → Expense calculations: filters entries (evidence: `src/pages/GroupPage.jsx`)
- Group timeline → Firebase services: reads group data (evidence: `src/pages/GroupPage.jsx`)
- Users → Group timeline: records expenses (evidence: `README.md`)
- Users → Settlement and transfers: settles balances (evidence: `README.md`)
- Users → Membership and settings: manages membership (evidence: `README.md`)
- Users → Personal ledger: tracks personal finances (evidence: `README.md`)
- Users → Savings goals: tracks savings (evidence: `README.md`)
- Users → FX and trips: uses FX tools (evidence: `README.md`)
- Cloud API → Identity resolution: resolves identity (evidence: `functions/index.js`)
- Cloud API → Identity binding: parses bind request (evidence: `functions/index.js`)
- Cloud API → Account merge: runs identity flow (evidence: `functions/index.js`)
- Account merge → Identity binding: uses bind flow (evidence: `functions/mergeFlow.js`)
- Account merge → Member operations: uses member operations (evidence: `functions/mergeFlow.js`)
- Localization provider → Translation core: translates with (evidence: `src/i18n/I18nProvider.jsx`)
- Localization provider → English dictionary: loads dictionary (evidence: `src/i18n/I18nProvider.jsx`)
- Localization provider → Traditional Chinese dictionary: loads dictionary (evidence: `src/i18n/I18nProvider.jsx`)
- Group timeline → Localized labels: uses category codes (evidence: `src/pages/GroupPage.jsx`)
- Expense calculations → Translation core: translates labels (evidence: `src/utils/expenseHelpers.js`)
