# tethrers-group-6/tethr architecture

> Architecture diagram of the GitHub repository tethrers-group-6/tethr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tethrers-group-6/tethr
- Repository: https://github.com/tethrers-group-6/tethr

## Overview

Tethr is a web app for private friend-group Circles that combines shared expenses, balances and payments with event planning and RSVPs. Users register or log in, create or join Circles, record expenses (optionally tied to events), and review balances or confirm payments; the dashboard summarizes activity and upcoming items. Express route modules handle the domain workflows, with PostgreSQL-backed queries and focused split, validation and calendar-service layers. Google Calendar mirroring is optional. Evidence is limited to the README, source index and excerpts; unsampled client/API wiring is not asserted.

Main entry points: [`ProjectSourceCode/index.js`](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/index.js) (Express app), [`ProjectSourceCode/src/routes/expenses.js`](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/expenses.js) (Expense recording), [`ProjectSourceCode/src/routes/balances.js`](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/balances.js) (Balances and payments), [`ProjectSourceCode/src/routes/events.js`](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/events.js) (Events and RSVPs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_app["Express app<br/>[index.js]"]
  node_auth["Login and registration<br/>[login.js]"]
  node_registration["Registration validation"]
  node_profile["Profile management<br/>[profile.js]"]
  node_profile_validation["Profile validation"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
end

subgraph group_groups["Circle workflows"]
  node_circles["Circle management<br/>[circles.js]"]
  node_invite_validation["Invite validation"]
  node_circle_detail["Circle detail<br/>[circleDetail.js]"]
end

subgraph group_money["Money workflows"]
  node_expenses["Expense recording<br/>[expenses.js]"]
  node_amount_parser["Amount parsing<br/>[parseAmount.js]"]
  node_split_calculation["Split calculation<br/>[computeSplits.js]"]
  node_balances["Balances and payments<br/>[balances.js]"]
  node_balance_summary["People balance summary"]
  node_payment_validation["Payment validation<br/>[validatePayment.js]"]
end

subgraph group_calendar["Calendar workflows"]
  node_events["Events and RSVPs<br/>[events.js]"]
  node_event_validation["Event validation<br/>[validateEvent.js]"]
  node_calendar_store["Calendar data store<br/>[calendarStore.js]"]
  node_google_sync["Google Calendar sync<br/>[gcal.js]"]
end

node_user(("Tethr user"))
node_database[("PostgreSQL")]
node_google_calendar["Google Calendar"]

node_user -->|"uses"| node_app
node_app -->|"mounts routes"| node_auth
node_app -->|"mounts routes"| node_dashboard
node_app -->|"mounts routes"| node_circles
node_app -->|"mounts routes"| node_profile
node_app -->|"mounts routes"| node_events
node_app -->|"mounts routes"| node_expenses
node_app -->|"mounts routes"| node_circle_detail
node_app -->|"mounts routes"| node_balances
node_auth -->|"validates with"| node_registration
node_profile -->|"validates with"| node_profile_validation
node_circles -->|"validates with"| node_invite_validation
node_circles -->|"reads and writes"| node_database
node_circle_detail -.->|"reads"| node_database
node_profile -.->|"reads and writes"| node_database
node_auth -.->|"reads and writes"| node_database
node_dashboard -->|"queries"| node_database
node_expenses -->|"parses amount"| node_amount_parser
node_expenses -->|"computes splits"| node_split_calculation
node_expenses -->|"writes expense"| node_database
node_balances -->|"summarizes"| node_balance_summary
node_balances -->|"validates payment"| node_payment_validation
node_balances -->|"reads and writes"| node_database
node_events -->|"validates events"| node_event_validation
node_events -->|"uses store"| node_calendar_store
node_calendar_store -->|"reads and writes"| node_database
node_events -->|"syncs optionally"| node_google_sync
node_google_sync -->|"mirrors events"| node_google_calendar

click node_app "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/index.js"
click node_auth "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/login.js"
click node_registration "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateRegistration.js"
click node_profile "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/profile.js"
click node_profile_validation "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateProfileUpdate.js"
click node_dashboard "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/dashboard.js"
click node_circles "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/circles.js"
click node_invite_validation "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateInviteCode.js"
click node_circle_detail "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/circleDetail.js"
click node_expenses "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/expenses.js"
click node_amount_parser "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/parseAmount.js"
click node_split_calculation "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/computeSplits.js"
click node_balances "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/balances.js"
click node_balance_summary "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/summarizeBalances.js"
click node_payment_validation "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validatePayment.js"
click node_events "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/events.js"
click node_event_validation "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateEvent.js"
click node_calendar_store "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/services/calendarStore.js"
click node_google_sync "https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/services/gcal.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_auth,node_registration,node_profile,node_profile_validation,node_dashboard,node_user toneBlue
class node_circles,node_invite_validation,node_circle_detail,node_database toneAmber
class node_expenses,node_amount_parser,node_split_calculation,node_balances,node_balance_summary,node_payment_validation toneMint
class node_events,node_event_validation,node_calendar_store,node_google_sync toneRose
class node_google_calendar toneIndigo
```

## Components

### Web entry

- [Express app](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/index.js): `ProjectSourceCode/index.js`
- [Login and registration](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/login.js): `ProjectSourceCode/src/routes/login.js`
- [Registration validation](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateRegistration.js): `ProjectSourceCode/src/validateRegistration.js`
- [Profile management](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/profile.js): `ProjectSourceCode/src/routes/profile.js`
- [Profile validation](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateProfileUpdate.js): `ProjectSourceCode/src/validateProfileUpdate.js`
- [Dashboard](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/dashboard.js): `ProjectSourceCode/src/routes/dashboard.js`

### Circle workflows

- [Circle management](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/circles.js): `ProjectSourceCode/src/routes/circles.js`
- [Invite validation](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateInviteCode.js): `ProjectSourceCode/src/validateInviteCode.js`
- [Circle detail](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/circleDetail.js): `ProjectSourceCode/src/routes/circleDetail.js`

### Money workflows

- [Expense recording](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/expenses.js): `ProjectSourceCode/src/routes/expenses.js`
- [Amount parsing](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/parseAmount.js): `ProjectSourceCode/src/parseAmount.js`
- [Split calculation](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/computeSplits.js): `ProjectSourceCode/src/computeSplits.js`
- [Balances and payments](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/balances.js): `ProjectSourceCode/src/routes/balances.js`
- [People balance summary](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/summarizeBalances.js): `ProjectSourceCode/src/summarizeBalances.js`
- [Payment validation](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validatePayment.js): `ProjectSourceCode/src/validatePayment.js`

### Calendar workflows

- [Events and RSVPs](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/routes/events.js): `ProjectSourceCode/src/routes/events.js`
- [Event validation](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/validateEvent.js): `ProjectSourceCode/src/validateEvent.js`
- [Calendar data store](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/services/calendarStore.js): `ProjectSourceCode/src/services/calendarStore.js`
- [Google Calendar sync](https://github.com/tethrers-group-6/tethr/blob/main/ProjectSourceCode/src/services/gcal.js): `ProjectSourceCode/src/services/gcal.js`

### Other components

- **Tethr user**
- **PostgreSQL**
- **Google Calendar**

## Connections

- Tethr user → Express app: uses (evidence: `README.md`)
- Express app → Login and registration: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Dashboard: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Circle management: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Profile management: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Events and RSVPs: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Expense recording: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Circle detail: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Express app → Balances and payments: mounts routes (evidence: `ProjectSourceCode/index.js`)
- Login and registration → Registration validation: validates with
- Profile management → Profile validation: validates with (evidence: `ProjectSourceCode/src/routes/profile.js`)
- Circle management → Invite validation: validates with (evidence: `ProjectSourceCode/src/routes/circles.js`)
- Circle management → PostgreSQL: reads and writes (evidence: `ProjectSourceCode/src/routes/circles.js`)
- Circle detail → PostgreSQL: reads
- Profile management → PostgreSQL: reads and writes
- Login and registration → PostgreSQL: reads and writes
- Dashboard → PostgreSQL: queries (evidence: `ProjectSourceCode/src/routes/dashboard.js`)
- Expense recording → Amount parsing: parses amount (evidence: `ProjectSourceCode/src/routes/expenses.js`)
- Expense recording → Split calculation: computes splits (evidence: `ProjectSourceCode/src/routes/expenses.js`)
- Expense recording → PostgreSQL: writes expense (evidence: `ProjectSourceCode/src/routes/expenses.js`)
- Balances and payments → People balance summary: summarizes (evidence: `ProjectSourceCode/src/routes/balances.js`)
- Balances and payments → Payment validation: validates payment (evidence: `ProjectSourceCode/src/routes/balances.js`)
- Balances and payments → PostgreSQL: reads and writes (evidence: `ProjectSourceCode/src/routes/balances.js`)
- Events and RSVPs → Event validation: validates events (evidence: `ProjectSourceCode/src/routes/events.js`)
- Events and RSVPs → Calendar data store: uses store (evidence: `ProjectSourceCode/src/routes/events.js`)
- Calendar data store → PostgreSQL: reads and writes (evidence: `ProjectSourceCode/src/services/calendarStore.js`)
- Events and RSVPs → Google Calendar sync: syncs optionally (evidence: `ProjectSourceCode/src/routes/events.js`)
- Google Calendar sync → Google Calendar: mirrors events (evidence: `ProjectSourceCode/src/services/gcal.js`)
