# souravseal99/roommate architecture

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

- Interactive diagram: https://gitdiagram.com/souravseal99/roommate
- Repository: https://github.com/souravseal99/roommate

## Overview

RoomMate is a shared-living app for coordinating household membership, chores, expenses and settlements, shared inventory, shopping lists, and household statistics. The principal workflow is that a roommate uses the React app to manage a household task; frontend API clients communicate with the Express API, whose domain routes dispatch to controllers and services, with Prisma providing database access. The graph preserves the README’s major capabilities and distinguishes expense splitting/settlement and inventory restocking. Source excerpts show selected controller-to-service calls and route mounts; other domain wiring is represented only where the tree and documented structure support it.

Main entry points: [`roommate-server/src/routes.ts`](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/routes.ts) (API routing), [`roommate-app/src/App.tsx`](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/App.tsx) (App shell), [`roommate-app/src/api`](https://github.com/souravseal99/roommate/tree/main/roommate-app/src/api) (API clients), [`roommate-app/src/components/auth/AuthForm.tsx`](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/components/auth/AuthForm.tsx) (Sign in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Roommate app"]
  node_app["App shell<br/>[App.tsx]"]
  node_authui["Sign in<br/>[AuthForm.tsx]"]
  node_householdui["Households<br/>[Households.tsx]"]
  node_dashboardui["Dashboard<br/>[Dashboard.tsx]"]
  node_choreui["Chores<br/>[Chores.tsx]"]
  node_expenseui["Expenses<br/>[Expenses.tsx]"]
  node_inventoryui["Inventory<br/>[Inventory.tsx]"]
  node_frontendapi["API clients"]
end

subgraph group_api["HTTP API"]
  node_serverroutes["API routing<br/>[routes.ts]"]
end

subgraph group_home["Household coordination"]
  node_households["Households"]
  node_members["Membership"]
  node_chores["Chore tracking"]
  node_dashboard["Household stats"]
end

subgraph group_money["Expenses"]
  node_expenses["Expense tracking"]
  node_splits["Expense splits"]
  node_settlements["Settlements"]
end

subgraph group_supplies["Shared supplies"]
  node_inventory["Inventory"]
  node_cart["Shopping cart"]
end

subgraph group_platform["Identity and data"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_users["User profiles<br/>[user.controller.ts]"]
  node_prisma["Prisma access<br/>[prisma.ts]"]
  node_database[("PostgreSQL")]
end

node_roommate(("Roommate"))

node_roommate -->|"uses"| node_app
node_app -->|"offers"| node_authui
node_app -->|"offers"| node_householdui
node_app -->|"offers"| node_dashboardui
node_app -->|"offers"| node_choreui
node_app -->|"offers"| node_expenseui
node_app -->|"offers"| node_inventoryui
node_authui -->|"requests auth"| node_frontendapi
node_householdui -->|"requests data"| node_frontendapi
node_dashboardui -->|"requests stats"| node_frontendapi
node_choreui -->|"requests chores"| node_frontendapi
node_expenseui -->|"requests expenses"| node_frontendapi
node_inventoryui -->|"requests supplies"| node_frontendapi
node_frontendapi -->|"HTTP requests"| node_serverroutes
node_serverroutes -->|"mounts auth"| node_auth
node_serverroutes -->|"mounts users"| node_users
node_serverroutes -->|"mounts households"| node_households
node_serverroutes -->|"mounts membership"| node_members
node_serverroutes -->|"mounts chores"| node_chores
node_serverroutes -->|"mounts dashboard"| node_dashboard
node_serverroutes -->|"mounts expenses"| node_expenses
node_serverroutes -->|"mounts splits"| node_splits
node_serverroutes -->|"mounts inventory"| node_inventory
node_serverroutes -->|"mounts cart"| node_cart
node_expenses -->|"calls"| node_settlements
node_serverroutes -->|"health query"| node_prisma
node_prisma -->|"queries"| node_database

click node_app "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/App.tsx"
click node_authui "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/components/auth/AuthForm.tsx"
click node_householdui "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/households/Households.tsx"
click node_dashboardui "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/dashboard/Dashboard.tsx"
click node_choreui "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/chores/Chores.tsx"
click node_expenseui "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/expenses/Expenses.tsx"
click node_inventoryui "https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/inventory/Inventory.tsx"
click node_frontendapi "https://github.com/souravseal99/roommate/tree/main/roommate-app/src/api"
click node_serverroutes "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/routes.ts"
click node_auth "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/auth/auth.controller.ts"
click node_users "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/users/user.controller.ts"
click node_households "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/households/household.controller.ts"
click node_members "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/household-members/householdMember.controller.ts"
click node_chores "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/chore/chore.controller.ts"
click node_dashboard "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/dashboard/dashboard.controller.ts"
click node_expenses "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/expenses/expense.controller.ts"
click node_splits "https://github.com/souravseal99/roommate/tree/main/roommate-server/src/expense-split"
click node_settlements "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/expenses/settlement.service.ts"
click node_inventory "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/inventory/inventory.controller.ts"
click node_cart "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/shopping-cart/shoppingCart.controller.ts"
click node_prisma "https://github.com/souravseal99/roommate/blob/main/roommate-server/src/common/utils/prisma.ts"

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_authui,node_householdui,node_dashboardui,node_choreui,node_expenseui,node_inventoryui,node_frontendapi toneBlue
class node_serverroutes toneAmber
class node_households,node_members,node_chores,node_dashboard toneMint
class node_expenses,node_splits,node_settlements toneRose
class node_inventory,node_cart,node_roommate toneIndigo
class node_auth,node_users,node_prisma,node_database toneTeal
```

## Components

### Roommate app

- [App shell](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/App.tsx): `roommate-app/src/App.tsx`
- [Sign in](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/components/auth/AuthForm.tsx): `roommate-app/src/components/auth/AuthForm.tsx`
- [Households](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/households/Households.tsx): `roommate-app/src/pages/households/Households.tsx`
- [Dashboard](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/dashboard/Dashboard.tsx): `roommate-app/src/pages/dashboard/Dashboard.tsx`
- [Chores](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/chores/Chores.tsx): `roommate-app/src/pages/chores/Chores.tsx`
- [Expenses](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/expenses/Expenses.tsx): `roommate-app/src/pages/expenses/Expenses.tsx`
- [Inventory](https://github.com/souravseal99/roommate/blob/main/roommate-app/src/pages/inventory/Inventory.tsx): `roommate-app/src/pages/inventory/Inventory.tsx`
- [API clients](https://github.com/souravseal99/roommate/tree/main/roommate-app/src/api): `roommate-app/src/api`

### HTTP API

- [API routing](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/routes.ts): `roommate-server/src/routes.ts`

### Household coordination

- [Households](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/households/household.controller.ts): `roommate-server/src/households/household.controller.ts`
- [Membership](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/household-members/householdMember.controller.ts): `roommate-server/src/household-members/householdMember.controller.ts`
- [Chore tracking](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/chore/chore.controller.ts): `roommate-server/src/chore/chore.controller.ts`
- [Household stats](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/dashboard/dashboard.controller.ts): `roommate-server/src/dashboard/dashboard.controller.ts`

### Expenses

- [Expense tracking](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/expenses/expense.controller.ts): `roommate-server/src/expenses/expense.controller.ts`
- [Expense splits](https://github.com/souravseal99/roommate/tree/main/roommate-server/src/expense-split): `roommate-server/src/expense-split`
- [Settlements](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/expenses/settlement.service.ts): `roommate-server/src/expenses/settlement.service.ts`

### Shared supplies

- [Inventory](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/inventory/inventory.controller.ts): `roommate-server/src/inventory/inventory.controller.ts`
- [Shopping cart](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/shopping-cart/shoppingCart.controller.ts): `roommate-server/src/shopping-cart/shoppingCart.controller.ts`

### Identity and data

- [Authentication](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/auth/auth.controller.ts): `roommate-server/src/auth/auth.controller.ts`
- [User profiles](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/users/user.controller.ts): `roommate-server/src/users/user.controller.ts`
- [Prisma access](https://github.com/souravseal99/roommate/blob/main/roommate-server/src/common/utils/prisma.ts): `roommate-server/src/common/utils/prisma.ts`
- **PostgreSQL**

### Other components

- **Roommate**

## Connections

- Roommate → App shell: uses
- App shell → Sign in: offers
- App shell → Households: offers
- App shell → Dashboard: offers
- App shell → Chores: offers
- App shell → Expenses: offers
- App shell → Inventory: offers
- Sign in → API clients: requests auth
- Households → API clients: requests data
- Dashboard → API clients: requests stats
- Chores → API clients: requests chores
- Expenses → API clients: requests expenses
- Inventory → API clients: requests supplies
- API clients → API routing: HTTP requests
- API routing → Authentication: mounts auth
- API routing → User profiles: mounts users
- API routing → Households: mounts households
- API routing → Membership: mounts membership
- API routing → Chore tracking: mounts chores
- API routing → Household stats: mounts dashboard
- API routing → Expense tracking: mounts expenses
- API routing → Expense splits: mounts splits
- API routing → Inventory: mounts inventory
- API routing → Shopping cart: mounts cart
- Expense tracking → Settlements: calls
- API routing → Prisma access: health query
- Prisma access → PostgreSQL: queries
