# sahastrawin/spliter-master architecture

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

- Interactive diagram: https://gitdiagram.com/sahastrawin/spliter-master
- Repository: https://github.com/sahastrawin/spliter-master

## Overview

Splitr lets authenticated users organize shared expenses, choose equal, percentage, or exact splits, inspect balances and spending, and record settlements. The main UI is backed by Convex queries and mutations for users, groups, expenses, settlements, and dashboard data; Convex supplies live updates. Separate Inngest jobs support debt reminders and AI spending insights. Paths for those documented capabilities are present in the tree, but their internal calls were not sampled, so the graph shows only the documented connections and marks external integrations optional.

Main entry points: [`hooks/use-convex-query.jsx`](https://github.com/sahastrawin/spliter-master/blob/main/hooks/use-convex-query.jsx) (Query/mutation hook), [`convex/schema.js`](https://github.com/sahastrawin/spliter-master/blob/main/convex/schema.js) (Convex database), [`app/api/inngest/route.js`](https://github.com/sahastrawin/spliter-master/blob/main/app/api/inngest/route.js) (Job endpoint), [`lib/inngest/payment-reminders.js`](https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/payment-reminders.js) (Payment reminders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User experience"]
  node_auth_pages["Sign in / up<br/>[page.jsx]"]
  node_main_layout["Authenticated app<br/>[layout.jsx]"]
  node_dashboard["Dashboard<br/>[page.jsx]"]
  node_contacts["Contacts &amp; groups<br/>[page.jsx]"]
  node_group_detail["Group detail<br/>[page.jsx]"]
  node_person_detail["Person detail<br/>[page.jsx]"]
  node_new_expense["New expense<br/>[page.jsx]"]
  node_settlement_ui["Settlement form<br/>[page.jsx]"]
  node_convex_provider["Convex client"]
  node_query_hook["Query/mutation hook"]
end

subgraph group_domain["Expense domain"]
  node_groups["Groups &amp; members<br/>[groups.js]"]
  node_expenses["Expense splits<br/>[expenses.js]"]
  node_settlements["Debt settlements<br/>[settlements.js]"]
  node_dashboard_api["Balances &amp; analytics<br/>[dashboard.js]"]
  node_contacts_api["Contact queries<br/>[contacts.js]"]
end

subgraph group_data["Convex data"]
  node_users["User sync<br/>[users.js]"]
  node_convex_db[("Convex database<br/>[schema.js]")]
end

subgraph group_jobs["Background services"]
  node_inngest_route["Job endpoint<br/>[route.js]"]
  node_reminders["Payment reminders"]
  node_insights["Spending insights"]
  node_inngest_client["Inngest client<br/>[client.js]"]
  node_email["Email delivery<br/>[email.js]"]
end

node_user(("User"))
node_gemini{{"Gemini AI"}}
node_resend{{"Resend"}}
node_clerk{{"Clerk"}}

node_user -->|"signs in"| node_auth_pages
node_auth_pages -.->|"authenticates"| node_clerk
node_user -->|"opens app"| node_main_layout
node_main_layout -->|"provides client"| node_convex_provider
node_convex_provider -.->|"gets auth"| node_clerk
node_dashboard -->|"queries"| node_query_hook
node_contacts -->|"queries"| node_query_hook
node_group_detail -->|"queries"| node_query_hook
node_person_detail -->|"queries"| node_query_hook
node_new_expense -->|"mutates"| node_query_hook
node_settlement_ui -->|"mutates"| node_query_hook
node_query_hook -->|"uses client"| node_convex_provider
node_query_hook -->|"calls"| node_dashboard_api
node_query_hook -->|"calls"| node_contacts_api
node_query_hook -->|"calls"| node_groups
node_query_hook -->|"calls"| node_expenses
node_query_hook -->|"calls"| node_settlements
node_users -->|"reads/writes"| node_convex_db
node_groups -->|"reads/writes"| node_convex_db
node_expenses -->|"reads/writes"| node_convex_db
node_settlements -->|"reads/writes"| node_convex_db
node_dashboard_api -->|"reads"| node_convex_db
node_contacts_api -->|"reads"| node_convex_db
node_inngest_route -->|"serves jobs"| node_inngest_client
node_inngest_route -->|"registers"| node_reminders
node_inngest_route -->|"registers"| node_insights
node_reminders -.->|"finds debts"| node_convex_db
node_reminders -.->|"sends reminders"| node_email
node_email -.->|"delivers email"| node_resend
node_insights -.->|"reads/stores insights"| node_convex_db
node_insights -.->|"generates insights"| node_gemini

click node_auth_pages "https://github.com/sahastrawin/spliter-master/blob/main/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.jsx"
click node_main_layout "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/layout.jsx"
click node_dashboard "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/dashboard/page.jsx"
click node_contacts "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/contacts/page.jsx"
click node_group_detail "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/groups/%5Bid%5D/page.jsx"
click node_person_detail "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/person/%5Bid%5D/page.jsx"
click node_new_expense "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/expenses/new/page.jsx"
click node_settlement_ui "https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/settlements/%5Btype%5D/%5Bid%5D/page.jsx"
click node_convex_provider "https://github.com/sahastrawin/spliter-master/blob/main/components/convex-client-provider.jsx"
click node_query_hook "https://github.com/sahastrawin/spliter-master/blob/main/hooks/use-convex-query.jsx"
click node_users "https://github.com/sahastrawin/spliter-master/blob/main/convex/users.js"
click node_groups "https://github.com/sahastrawin/spliter-master/blob/main/convex/groups.js"
click node_expenses "https://github.com/sahastrawin/spliter-master/blob/main/convex/expenses.js"
click node_settlements "https://github.com/sahastrawin/spliter-master/blob/main/convex/settlements.js"
click node_dashboard_api "https://github.com/sahastrawin/spliter-master/blob/main/convex/dashboard.js"
click node_contacts_api "https://github.com/sahastrawin/spliter-master/blob/main/convex/contacts.js"
click node_convex_db "https://github.com/sahastrawin/spliter-master/blob/main/convex/schema.js"
click node_inngest_route "https://github.com/sahastrawin/spliter-master/blob/main/app/api/inngest/route.js"
click node_reminders "https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/payment-reminders.js"
click node_insights "https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/spending-insights.js"
click node_inngest_client "https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/client.js"
click node_email "https://github.com/sahastrawin/spliter-master/blob/main/convex/email.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_auth_pages,node_main_layout,node_dashboard,node_contacts,node_group_detail,node_person_detail,node_new_expense,node_settlement_ui,node_convex_provider,node_query_hook,node_user toneBlue
class node_groups,node_expenses,node_settlements,node_dashboard_api,node_contacts_api toneAmber
class node_users,node_convex_db toneMint
class node_inngest_route,node_reminders,node_insights,node_inngest_client,node_email toneRose
class node_gemini,node_resend,node_clerk toneIndigo
```

## Components

### User experience

- [Sign in / up](https://github.com/sahastrawin/spliter-master/blob/main/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.jsx): `app/(auth)/sign-in/[[...sign-in]]/page.jsx`
- [Authenticated app](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/layout.jsx): `app/(main)/layout.jsx`
- [Dashboard](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/dashboard/page.jsx): `app/(main)/dashboard/page.jsx`
- [Contacts & groups](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/contacts/page.jsx): `app/(main)/contacts/page.jsx`
- [Group detail](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/groups/%5Bid%5D/page.jsx): `app/(main)/groups/[id]/page.jsx`
- [Person detail](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/person/%5Bid%5D/page.jsx): `app/(main)/person/[id]/page.jsx`
- [New expense](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/expenses/new/page.jsx): `app/(main)/expenses/new/page.jsx`
- [Settlement form](https://github.com/sahastrawin/spliter-master/blob/main/app/(main)/settlements/%5Btype%5D/%5Bid%5D/page.jsx): `app/(main)/settlements/[type]/[id]/page.jsx`
- [Convex client](https://github.com/sahastrawin/spliter-master/blob/main/components/convex-client-provider.jsx): `components/convex-client-provider.jsx`
- [Query/mutation hook](https://github.com/sahastrawin/spliter-master/blob/main/hooks/use-convex-query.jsx): `hooks/use-convex-query.jsx`

### Expense domain

- [Groups & members](https://github.com/sahastrawin/spliter-master/blob/main/convex/groups.js): `convex/groups.js`
- [Expense splits](https://github.com/sahastrawin/spliter-master/blob/main/convex/expenses.js): `convex/expenses.js`
- [Debt settlements](https://github.com/sahastrawin/spliter-master/blob/main/convex/settlements.js): `convex/settlements.js`
- [Balances & analytics](https://github.com/sahastrawin/spliter-master/blob/main/convex/dashboard.js): `convex/dashboard.js`
- [Contact queries](https://github.com/sahastrawin/spliter-master/blob/main/convex/contacts.js): `convex/contacts.js`

### Convex data

- [User sync](https://github.com/sahastrawin/spliter-master/blob/main/convex/users.js): `convex/users.js`
- [Convex database](https://github.com/sahastrawin/spliter-master/blob/main/convex/schema.js): `convex/schema.js`

### Background services

- [Job endpoint](https://github.com/sahastrawin/spliter-master/blob/main/app/api/inngest/route.js): `app/api/inngest/route.js`
- [Payment reminders](https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/payment-reminders.js): `lib/inngest/payment-reminders.js`
- [Spending insights](https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/spending-insights.js): `lib/inngest/spending-insights.js`
- [Inngest client](https://github.com/sahastrawin/spliter-master/blob/main/lib/inngest/client.js): `lib/inngest/client.js`
- [Email delivery](https://github.com/sahastrawin/spliter-master/blob/main/convex/email.js): `convex/email.js`

### Other components

- **User**
- **Gemini AI**
- **Resend**
- **Clerk**

## Connections

- User → Sign in / up: signs in
- Sign in / up → Clerk: authenticates
- User → Authenticated app: opens app
- Authenticated app → Convex client: provides client
- Convex client → Clerk: gets auth
- Dashboard → Query/mutation hook: queries
- Contacts & groups → Query/mutation hook: queries
- Group detail → Query/mutation hook: queries
- Person detail → Query/mutation hook: queries
- New expense → Query/mutation hook: mutates
- Settlement form → Query/mutation hook: mutates
- Query/mutation hook → Convex client: uses client
- Query/mutation hook → Balances & analytics: calls
- Query/mutation hook → Contact queries: calls
- Query/mutation hook → Groups & members: calls
- Query/mutation hook → Expense splits: calls
- Query/mutation hook → Debt settlements: calls
- User sync → Convex database: reads/writes
- Groups & members → Convex database: reads/writes
- Expense splits → Convex database: reads/writes
- Debt settlements → Convex database: reads/writes
- Balances & analytics → Convex database: reads
- Contact queries → Convex database: reads
- Job endpoint → Inngest client: serves jobs
- Job endpoint → Payment reminders: registers
- Job endpoint → Spending insights: registers
- Payment reminders → Convex database: finds debts
- Payment reminders → Email delivery: sends reminders
- Email delivery → Resend: delivers email
- Spending insights → Convex database: reads/stores insights
- Spending insights → Gemini AI: generates insights
