# mohi007/somiti architecture

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

- Interactive diagram: https://gitdiagram.com/mohi007/somiti
- Repository: https://github.com/mohi007/somiti

## Overview

This is a Bengali-language cooperative (somiti) management web app. Members and administrators enter through the Next.js app, use domain pages to manage accounts, contributions, governance, and investments, and view or print records. The shared Somiti context supplies application state and synchronizes records with Supabase; notification APIs and browser push form a separate capability. The source index and excerpts support the main page-to-context and context-to-store links, but do not expose every page’s runtime behavior.

Main entry points: [`src/context/SomitiContext.tsx`](https://github.com/mohi007/somiti/blob/main/src/context/SomitiContext.tsx) (Somiti state and sync), [`src/app/pages/investments/page.tsx`](https://github.com/mohi007/somiti/blob/main/src/app/pages/investments/page.tsx) (Investment workflow), [`src/app/page.tsx`](https://github.com/mohi007/somiti/blob/main/src/app/page.tsx) (App shell and login), [`src/app/pages/dashboard/page.tsx`](https://github.com/mohi007/somiti/blob/main/src/app/pages/dashboard/page.tsx) (Dashboard and accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["App shell and login<br/>[page.tsx]"]
  node_state["Somiti state and sync<br/>[SomitiContext.tsx]"]
end

subgraph group_finance["Member finance"]
  node_account["Dashboard and accounts<br/>[page.tsx]"]
  node_dues["Dues and payments<br/>[page.tsx]"]
  node_member["Member records<br/>[page.tsx]"]
  node_myaccount["Member account<br/>[page.tsx]"]
  node_profile["Member profile<br/>[page.tsx]"]
  node_transactions["Receipts and transactions<br/>[page.tsx]"]
  node_bank["Bank account<br/>[page.tsx]"]
  node_reports["Reports and analytics<br/>[page.tsx]"]
end

subgraph group_governance["Governance"]
  node_committee["Committee management<br/>[page.tsx]"]
  node_constitution["Constitution<br/>[page.tsx]"]
  node_settings["Organization settings<br/>[page.tsx]"]
end

subgraph group_investment["Investments and notices"]
  node_investments["Investment workflow<br/>[page.tsx]"]
  node_investmentmodals["Investment decisions"]
  node_notifications["Notification center<br/>[page.tsx]"]
  node_notificationapi["Push notification API<br/>[route.ts]"]
  node_pushsender["Push delivery helper"]
  node_serviceworker["Browser service worker<br/>[sw.js]"]
end

node_user(("Member or admin"))
node_supabase[("Supabase database")]

node_user -->|"opens"| node_app
node_app -->|"uses state"| node_state
node_user -->|"opens pages"| node_account
node_account -->|"uses state"| node_state
node_dues -.->|"uses state"| node_state
node_member -.->|"uses state"| node_state
node_myaccount -->|"uses state"| node_state
node_profile -->|"uses state"| node_state
node_transactions -.->|"uses state"| node_state
node_bank -->|"uses state"| node_state
node_committee -->|"uses state"| node_state
node_constitution -->|"uses state"| node_state
node_settings -.->|"uses state"| node_state
node_investments -->|"uses state"| node_state
node_investments -->|"renders decisions"| node_investmentmodals
node_reports -.->|"uses state"| node_state
node_notifications -->|"uses state"| node_state
node_state -->|"reads and writes"| node_supabase
node_notificationapi -->|"calls sender"| node_pushsender

click node_app "https://github.com/mohi007/somiti/blob/main/src/app/page.tsx"
click node_state "https://github.com/mohi007/somiti/blob/main/src/context/SomitiContext.tsx"
click node_account "https://github.com/mohi007/somiti/blob/main/src/app/pages/dashboard/page.tsx"
click node_dues "https://github.com/mohi007/somiti/blob/main/src/app/pages/dues/page.tsx"
click node_member "https://github.com/mohi007/somiti/blob/main/src/app/pages/members/page.tsx"
click node_myaccount "https://github.com/mohi007/somiti/blob/main/src/app/pages/my_account/page.tsx"
click node_profile "https://github.com/mohi007/somiti/blob/main/src/app/pages/my_profile/page.tsx"
click node_transactions "https://github.com/mohi007/somiti/blob/main/src/app/pages/transactions/page.tsx"
click node_bank "https://github.com/mohi007/somiti/blob/main/src/app/pages/bank_account/page.tsx"
click node_committee "https://github.com/mohi007/somiti/blob/main/src/app/pages/committee/page.tsx"
click node_constitution "https://github.com/mohi007/somiti/blob/main/src/app/pages/constitution/page.tsx"
click node_settings "https://github.com/mohi007/somiti/blob/main/src/app/pages/settings/page.tsx"
click node_investments "https://github.com/mohi007/somiti/blob/main/src/app/pages/investments/page.tsx"
click node_investmentmodals "https://github.com/mohi007/somiti/blob/main/src/components/InvestmentApprovalModal.tsx"
click node_reports "https://github.com/mohi007/somiti/blob/main/src/app/pages/reports/page.tsx"
click node_notifications "https://github.com/mohi007/somiti/blob/main/src/app/pages/notifications/page.tsx"
click node_notificationapi "https://github.com/mohi007/somiti/blob/main/src/app/api/notifications/send/route.ts"
click node_pushsender "https://github.com/mohi007/somiti/blob/main/src/lib/sendPushNotification.ts"
click node_serviceworker "https://github.com/mohi007/somiti/blob/main/public/sw.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_state toneBlue
class node_account,node_dues,node_member,node_myaccount,node_profile,node_transactions,node_bank,node_reports,node_supabase toneAmber
class node_committee,node_constitution,node_settings toneMint
class node_investments,node_investmentmodals,node_notifications,node_notificationapi,node_pushsender,node_serviceworker toneRose
class node_user toneIndigo
```

## Components

### App entry

- [App shell and login](https://github.com/mohi007/somiti/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Somiti state and sync](https://github.com/mohi007/somiti/blob/main/src/context/SomitiContext.tsx): `src/context/SomitiContext.tsx`

### Member finance

- [Dashboard and accounts](https://github.com/mohi007/somiti/blob/main/src/app/pages/dashboard/page.tsx): `src/app/pages/dashboard/page.tsx`
- [Dues and payments](https://github.com/mohi007/somiti/blob/main/src/app/pages/dues/page.tsx): `src/app/pages/dues/page.tsx`
- [Member records](https://github.com/mohi007/somiti/blob/main/src/app/pages/members/page.tsx): `src/app/pages/members/page.tsx`
- [Member account](https://github.com/mohi007/somiti/blob/main/src/app/pages/my_account/page.tsx): `src/app/pages/my_account/page.tsx`
- [Member profile](https://github.com/mohi007/somiti/blob/main/src/app/pages/my_profile/page.tsx): `src/app/pages/my_profile/page.tsx`
- [Receipts and transactions](https://github.com/mohi007/somiti/blob/main/src/app/pages/transactions/page.tsx): `src/app/pages/transactions/page.tsx`
- [Bank account](https://github.com/mohi007/somiti/blob/main/src/app/pages/bank_account/page.tsx): `src/app/pages/bank_account/page.tsx`
- [Reports and analytics](https://github.com/mohi007/somiti/blob/main/src/app/pages/reports/page.tsx): `src/app/pages/reports/page.tsx`

### Governance

- [Committee management](https://github.com/mohi007/somiti/blob/main/src/app/pages/committee/page.tsx): `src/app/pages/committee/page.tsx`
- [Constitution](https://github.com/mohi007/somiti/blob/main/src/app/pages/constitution/page.tsx): `src/app/pages/constitution/page.tsx`
- [Organization settings](https://github.com/mohi007/somiti/blob/main/src/app/pages/settings/page.tsx): `src/app/pages/settings/page.tsx`

### Investments and notices

- [Investment workflow](https://github.com/mohi007/somiti/blob/main/src/app/pages/investments/page.tsx): `src/app/pages/investments/page.tsx`
- [Investment decisions](https://github.com/mohi007/somiti/blob/main/src/components/InvestmentApprovalModal.tsx): `src/components/InvestmentApprovalModal.tsx`
- [Notification center](https://github.com/mohi007/somiti/blob/main/src/app/pages/notifications/page.tsx): `src/app/pages/notifications/page.tsx`
- [Push notification API](https://github.com/mohi007/somiti/blob/main/src/app/api/notifications/send/route.ts): `src/app/api/notifications/send/route.ts`
- [Push delivery helper](https://github.com/mohi007/somiti/blob/main/src/lib/sendPushNotification.ts): `src/lib/sendPushNotification.ts`
- [Browser service worker](https://github.com/mohi007/somiti/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Member or admin**
- **Supabase database**

## Connections

- Member or admin → App shell and login: opens
- App shell and login → Somiti state and sync: uses state (evidence: `src/app/page.tsx`)
- Member or admin → Dashboard and accounts: opens pages
- Dashboard and accounts → Somiti state and sync: uses state (evidence: `src/app/pages/dashboard/page.tsx`)
- Dues and payments → Somiti state and sync: uses state
- Member records → Somiti state and sync: uses state
- Member account → Somiti state and sync: uses state (evidence: `src/app/pages/my_account/page.tsx`)
- Member profile → Somiti state and sync: uses state (evidence: `src/app/pages/my_profile/page.tsx`)
- Receipts and transactions → Somiti state and sync: uses state
- Bank account → Somiti state and sync: uses state (evidence: `src/app/pages/bank_account/page.tsx`)
- Committee management → Somiti state and sync: uses state (evidence: `src/app/pages/committee/page.tsx`)
- Constitution → Somiti state and sync: uses state (evidence: `src/app/pages/constitution/page.tsx`)
- Organization settings → Somiti state and sync: uses state
- Investment workflow → Somiti state and sync: uses state (evidence: `src/app/pages/investments/page.tsx`)
- Investment workflow → Investment decisions: renders decisions (evidence: `src/app/pages/investments/page.tsx`)
- Reports and analytics → Somiti state and sync: uses state
- Notification center → Somiti state and sync: uses state (evidence: `src/app/pages/notifications/page.tsx`)
- Somiti state and sync → Supabase database: reads and writes (evidence: `src/context/SomitiContext.tsx`)
- Push notification API → Push delivery helper: calls sender (evidence: `src/app/api/notifications/send/route.ts`)
