# nxmya-aa/splitsmart architecture

> Architecture diagram of the GitHub repository nxmya-aa/splitsmart, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nxmya-aa/splitsmart
- Repository: https://github.com/nxmya-aa/splitsmart

## Overview

#### Purpose and runtime

SplitSmart is a client-side expense-splitting application for creating groups, recording shared expenses, calculating balances, and marking settlements. It is a React/TypeScript single-page application built and served by Vite, persisted in browser Local Storage, and deployed as static hosting on Vercel.

Primary browser entry points:
- `index.html`
- `src/main.tsx`
- `src/App.tsx`

#### Application composition

`src/main.tsx` mounts the React application. `src/App.tsx` is the top-level composition and likely owns screen selection, shared application state, and navigation between the product’s workflow stages. Global and application styling are separated into:
- `src/index.css`
- `src/App.css`

There is no backend, authentication provider, or server API in this repository; browser persistence is the main data boundary.

#### Onboarding and home flow

The app begins with an introductory/onboarding surface, then transitions into the main group-centric experience:
- `src/screens/IntroScreen.tsx`
- `src/screens/HomeScreen.tsx`
- `src/App.tsx`

Home is the likely launch point for viewing existing groups and initiating group creation or selection. Control then moves into group and transaction screens rather than through URL-routed backend endpoints.

#### Group lifecycle and balance domain

Groups, members, expenses, and derived balances form the core domain. The group list/creation stage is represented by:
- `src/screens/GroupScreen.tsx`
- `src/screens/HomeScreen.tsx`

A selected group is handled in:
- `src/screens/GroupDetailScreen.tsx`
- `src/components/TransactionList.tsx`

This boundary is where stored group records are interpreted into member-level obligations, transaction history, and settlement actions. Balance calculation and settlement are client-side behaviors backed by Local Storage rather than a remote ledger.

#### Expense and settlement workflow

Expense entry and transaction review are separate product stages:
- `src/screens/TransactionScreen.tsx`
- `src/components/TransactionList.tsx`
- `src/components/FilterTabs.tsx`

Users add or inspect shared expenses through the transaction screen; the transaction list presents recorded activity, while filter tabs constrain the visible transaction subset. Settlement actions update the same local client-side state/persistence model, with no payment processor or external financial service indicated.

#### Profile and settings boundaries

User-oriented preferences and account-like UI are isolated from group accounting:
- `src/screens/ProfileScreen.tsx`
- `src/screens/SettingsScreen.tsx`

These screens are presentation and local-preference boundaries. The README explicitly identifies authentication and a cloud database as future work, so profile behavior should not be treated as a real authenticated identity system.

#### Infrastructure and delivery

The frontend is packaged through Vite:
- `vite.config.ts`
- `package.json`
- `index.html`

Styling uses CSS plus Tailwind/PostCSS configuration:
- `tailwind.config.js`
- `postcss.config.js`
- `src/index.css`

The deployable artifact is a static browser application suitable for Vercel. Its operational dependency is the user’s browser storage: data is local to a browser/device and is not synchronized across users or installations.

Main entry points: [`src/App.tsx`](https://github.com/nxmya-aa/splitsmart/blob/main/src/App.tsx) (App composition), [`src/screens/GroupDetailScreen.tsx`](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/GroupDetailScreen.tsx) (Group detail), [`src/screens/TransactionScreen.tsx`](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/TransactionScreen.tsx) (Expense entry), [`vite.config.ts`](https://github.com/nxmya-aa/splitsmart/blob/main/vite.config.ts) (Vite build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser SPA"]
  node_main["React mount<br/>browser entry<br/>[main.tsx]"]
  node_app["App composition<br/>React root<br/>[App.tsx]"]
  node_local_storage[("Browser Local Storage<br/>persistence boundary")]
  node_styles["Global styles<br/>CSS<br/>[index.css]"]
end

subgraph group_workflow["Product Workflow"]
  node_intro["Intro<br/>onboarding screen<br/>[IntroScreen.tsx]"]
  node_home["Home<br/>group launcher<br/>[HomeScreen.tsx]"]
  node_profile["Profile<br/>local preference screen<br/>[ProfileScreen.tsx]"]
  node_settings["Settings<br/>local preference screen<br/>[SettingsScreen.tsx]"]
end

subgraph group_accounting["Group Accounting"]
  node_groups["Groups<br/>group lifecycle screen<br/>[GroupScreen.tsx]"]
  node_group_detail["Group detail<br/>balance workspace"]
  node_transaction["Expense entry<br/>transaction screen"]
  node_transaction_list["Transaction list<br/>activity component"]
  node_filters["Filter tabs<br/>transaction filter<br/>[FilterTabs.tsx]"]
end

subgraph group_delivery["Build &amp; Delivery"]
  node_html["HTML entry<br/>Vite entry<br/>[index.html]"]
  node_package["Package scripts<br/>npm manifest<br/>[package.json]"]
  node_vite["Vite build<br/>bundler config<br/>[vite.config.ts]"]
  node_static_host{{"Vercel static hosting<br/>deployment target"}}
end

node_package -->|"runs"| node_vite
node_vite -->|"builds"| node_html
node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_app -->|"shows onboarding"| node_intro
node_intro -->|"continues to"| node_home
node_app -->|"selects screen"| node_home
node_home -->|"creates or selects groups"| node_groups
node_groups -->|"opens selected group"| node_group_detail
node_group_detail -->|"adds expense"| node_transaction
node_group_detail -->|"shows activity"| node_transaction_list
node_transaction -->|"records expense"| node_transaction_list
node_filters -->|"filters"| node_transaction_list
node_app -->|"navigates"| node_profile
node_app -->|"navigates"| node_settings
node_app -->|"reads and writes"| node_local_storage
node_group_detail -->|"persists balances and settlements"| node_local_storage
node_transaction -->|"persists expenses"| node_local_storage
node_styles -->|"styles"| node_app
node_vite -->|"publishes static build"| node_static_host

click node_html "https://github.com/nxmya-aa/splitsmart/blob/main/index.html"
click node_package "https://github.com/nxmya-aa/splitsmart/blob/main/package.json"
click node_vite "https://github.com/nxmya-aa/splitsmart/blob/main/vite.config.ts"
click node_main "https://github.com/nxmya-aa/splitsmart/blob/main/src/main.tsx"
click node_app "https://github.com/nxmya-aa/splitsmart/blob/main/src/App.tsx"
click node_intro "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/IntroScreen.tsx"
click node_home "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/HomeScreen.tsx"
click node_groups "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/GroupScreen.tsx"
click node_group_detail "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/GroupDetailScreen.tsx"
click node_transaction "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/TransactionScreen.tsx"
click node_transaction_list "https://github.com/nxmya-aa/splitsmart/blob/main/src/components/TransactionList.tsx"
click node_filters "https://github.com/nxmya-aa/splitsmart/blob/main/src/components/FilterTabs.tsx"
click node_profile "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/ProfileScreen.tsx"
click node_settings "https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/SettingsScreen.tsx"
click node_styles "https://github.com/nxmya-aa/splitsmart/blob/main/src/index.css"

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_main,node_app,node_local_storage,node_styles toneBlue
class node_intro,node_home,node_profile,node_settings toneAmber
class node_groups,node_group_detail,node_transaction,node_transaction_list,node_filters toneMint
class node_html,node_package,node_vite,node_static_host toneRose
```

## Components

### Browser SPA

- [React mount](https://github.com/nxmya-aa/splitsmart/blob/main/src/main.tsx): browser entry · `src/main.tsx`
- [App composition](https://github.com/nxmya-aa/splitsmart/blob/main/src/App.tsx): React root · Owns shared state, navigation, and screen selection. · `src/App.tsx`
- **Browser Local Storage**: persistence boundary · Data remains local to one browser or device.
- [Global styles](https://github.com/nxmya-aa/splitsmart/blob/main/src/index.css): CSS · `src/index.css`

### Product Workflow

- [Intro](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/IntroScreen.tsx): onboarding screen · `src/screens/IntroScreen.tsx`
- [Home](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/HomeScreen.tsx): group launcher · `src/screens/HomeScreen.tsx`
- [Profile](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/ProfileScreen.tsx): local preference screen · Not an authenticated identity boundary. · `src/screens/ProfileScreen.tsx`
- [Settings](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/SettingsScreen.tsx): local preference screen · `src/screens/SettingsScreen.tsx`

### Group Accounting

- [Groups](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/GroupScreen.tsx): group lifecycle screen · `src/screens/GroupScreen.tsx`
- [Group detail](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/GroupDetailScreen.tsx): balance workspace · Interprets group records into obligations and settlement actions. · `src/screens/GroupDetailScreen.tsx`
- [Expense entry](https://github.com/nxmya-aa/splitsmart/blob/main/src/screens/TransactionScreen.tsx): transaction screen · `src/screens/TransactionScreen.tsx`
- [Transaction list](https://github.com/nxmya-aa/splitsmart/blob/main/src/components/TransactionList.tsx): activity component · `src/components/TransactionList.tsx`
- [Filter tabs](https://github.com/nxmya-aa/splitsmart/blob/main/src/components/FilterTabs.tsx): transaction filter · `src/components/FilterTabs.tsx`

### Build & Delivery

- [HTML entry](https://github.com/nxmya-aa/splitsmart/blob/main/index.html): Vite entry · `index.html`
- [Package scripts](https://github.com/nxmya-aa/splitsmart/blob/main/package.json): npm manifest · `package.json`
- [Vite build](https://github.com/nxmya-aa/splitsmart/blob/main/vite.config.ts): bundler config · `vite.config.ts`
- **Vercel static hosting**: deployment target · Serves the built client application.

## Connections

- Package scripts → Vite build: runs
- Vite build → HTML entry: builds
- HTML entry → React mount: loads
- React mount → App composition: mounts
- App composition → Intro: shows onboarding
- Intro → Home: continues to
- App composition → Home: selects screen
- Home → Groups: creates or selects groups
- Groups → Group detail: opens selected group
- Group detail → Expense entry: adds expense
- Group detail → Transaction list: shows activity
- Expense entry → Transaction list: records expense
- Filter tabs → Transaction list: filters
- App composition → Profile: navigates
- App composition → Settings: navigates
- App composition → Browser Local Storage: reads and writes
- Group detail → Browser Local Storage: persists balances and settlements
- Expense entry → Browser Local Storage: persists expenses
- Global styles → App composition: styles
- Vite build → Vercel static hosting: publishes static build
