# kaustubh-negi-01/clubledger architecture

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

- Interactive diagram: https://gitdiagram.com/kaustubh-negi-01/clubledger
- Repository: https://github.com/kaustubh-negi-01/clubledger

## Overview

ClubLedger is a single-club membership, events, commerce, and financial operations system. Officers and members use the web workspace to manage memberships, reserve tickets or merchandise, and handle operational tasks; payment outcomes are simulated, then recorded through fulfillment and the double-entry journal. Officers also manage expenses, communications, reports, and semester close. The source index identifies the main modules and their references; unsampled modules are represented at subsystem level, and uncertain internal call paths are omitted.

Main entry points: [`clubledger/main.py`](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/main.py) (Application assembly), [`clubledger/web/routes.py`](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/web/routes.py) (Dashboard and workflows), [`clubledger/payments/service.py`](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/service.py) (Payment processing), [`clubledger/auth/routes.py`](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/auth/routes.py) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workspace"]
  node_webui["Dashboard and workflows<br/>[routes.py]"]
  node_ui["UI rendering<br/>[ui.py]"]
end

subgraph group_identity["Identity and shared core"]
  node_authroutes["Authentication routes<br/>[routes.py]"]
  node_authcore["Sessions and permissions<br/>[auth.py]"]
  node_csrf["CSRF protection<br/>[csrf.py]"]
  node_ratelimit["Rate limiting<br/>[ratelimit.py]"]
end

subgraph group_operations["Club operations"]
  node_membership["Membership<br/>[service.py]"]
  node_membershiproutes["Membership routes<br/>[routes.py]"]
  node_events["Events and ticketing<br/>[service.py]"]
  node_eventroutes["Event routes<br/>[routes.py]"]
  node_store["Merchandise<br/>[service.py]"]
  node_storeroutes["Store routes<br/>[routes.py]"]
  node_tasks["Fundraiser tasks<br/>[service.py]"]
  node_taskroutes["Task routes<br/>[routes.py]"]
  node_expenses["Expenses and receipts<br/>[service.py]"]
  node_comms["Announcements and mail<br/>[service.py]"]
  node_expensesroutes["Expense routes<br/>[routes.py]"]
end

subgraph group_finance["Payments and finance"]
  node_payments["Payment processing<br/>[service.py]"]
  node_paymentroutes["Payment routes<br/>[routes.py]"]
  node_simulator["Payment simulator<br/>[simulator.py]"]
  node_webhook["Payment webhook<br/>[webhook.py]"]
  node_journal["Double-entry journal<br/>[service.py]"]
  node_reports["Financial reports<br/>[service.py]"]
  node_reportroutes["Report routes<br/>[routes.py]"]
  node_close["Semester close<br/>[service.py]"]
end

subgraph group_runtime["Runtime infrastructure"]
  node_app["Application assembly<br/>[main.py]"]
  node_db[("SQLite and transactions<br/>[db.py]")]
  node_config["Runtime configuration<br/>[config.py]"]
  node_clock["Clock<br/>[clock.py]"]
  node_pricing["Pricing rules<br/>[pricing.py]"]
  node_types["Domain contracts<br/>[types.py]"]
end

node_member(("Member or officer"))

node_member -->|"opens workspace"| node_app
node_app -->|"registers routes"| node_webui
node_app -->|"registers routes"| node_authroutes
node_app -->|"registers routes"| node_membershiproutes
node_app -->|"registers routes"| node_eventroutes
node_app -->|"registers routes"| node_paymentroutes
node_app -->|"registers routes"| node_reportroutes
node_app -->|"registers routes"| node_expensesroutes
node_app -->|"registers routes"| node_taskroutes
node_app -->|"registers routes"| node_storeroutes
node_webui -->|"renders pages"| node_ui
node_authroutes -->|"uses sessions"| node_authcore
node_membershiproutes -->|"calls service"| node_membership
node_eventroutes -->|"calls service"| node_events
node_storeroutes -->|"calls service"| node_store
node_taskroutes -->|"calls service"| node_tasks
node_expensesroutes -->|"calls service"| node_expenses
node_paymentroutes -->|"calls service"| node_payments
node_reportroutes -->|"calls service"| node_reports
node_webui -->|"uses service"| node_tasks
node_webui -->|"uses service"| node_comms
node_webui -->|"uses service"| node_reports
node_webui -->|"uses service"| node_close
node_membership -->|"uses service"| node_payments
node_events -->|"uses service"| node_payments
node_store -->|"uses service"| node_payments
node_payments -->|"posts entries"| node_journal
node_expenses -->|"posts entries"| node_journal
node_close -->|"uses reports"| node_reports
node_events -->|"uses pricing"| node_pricing
node_store -->|"uses pricing"| node_pricing
node_paymentroutes -->|"uses simulator"| node_simulator
node_paymentroutes -->|"routes webhook"| node_webhook
node_webui -->|"queries data"| node_db
node_authcore -->|"opens connection"| node_db
node_app -->|"loads settings"| node_config
node_membership -->|"uses service"| node_comms
node_authroutes -->|"uses protection"| node_csrf
node_authroutes -->|"uses limiter"| node_ratelimit
node_webui -->|"uses clock"| node_clock
node_payments -->|"uses contracts"| node_types

click node_webui "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/web/routes.py"
click node_ui "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/web/ui.py"
click node_app "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/main.py"
click node_authroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/auth/routes.py"
click node_authcore "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/auth.py"
click node_csrf "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/csrf.py"
click node_ratelimit "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/ratelimit.py"
click node_membership "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/membership/service.py"
click node_membershiproutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/membership/routes.py"
click node_events "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/events/service.py"
click node_eventroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/events/routes.py"
click node_store "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/store/service.py"
click node_storeroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/store/routes.py"
click node_tasks "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/tasks/service.py"
click node_taskroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/tasks/routes.py"
click node_expenses "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/expenses/service.py"
click node_comms "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/comms/service.py"
click node_payments "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/service.py"
click node_paymentroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/routes.py"
click node_simulator "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/simulator.py"
click node_webhook "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/webhook.py"
click node_journal "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/journal/service.py"
click node_reports "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/reports/service.py"
click node_reportroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/reports/routes.py"
click node_close "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/close/service.py"
click node_db "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/db.py"
click node_config "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/config.py"
click node_clock "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/clock.py"
click node_pricing "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/pricing.py"
click node_types "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/types.py"
click node_expensesroutes "https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/expenses/routes.py"

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_webui,node_ui toneBlue
class node_authroutes,node_authcore,node_csrf,node_ratelimit toneAmber
class node_membership,node_membershiproutes,node_events,node_eventroutes,node_store,node_storeroutes,node_tasks,node_taskroutes,node_expenses,node_comms,node_expensesroutes toneMint
class node_payments,node_paymentroutes,node_simulator,node_webhook,node_journal,node_reports,node_reportroutes,node_close toneRose
class node_app,node_db,node_config,node_clock,node_pricing,node_types,node_member toneIndigo
```

## Components

### Web workspace

- [Dashboard and workflows](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/web/routes.py): `clubledger/web/routes.py`
- [UI rendering](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/web/ui.py): `clubledger/web/ui.py`

### Identity and shared core

- [Authentication routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/auth/routes.py): `clubledger/auth/routes.py`
- [Sessions and permissions](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/auth.py): `clubledger/core/auth.py`
- [CSRF protection](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/csrf.py): `clubledger/core/csrf.py`
- [Rate limiting](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/ratelimit.py): `clubledger/core/ratelimit.py`

### Club operations

- [Membership](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/membership/service.py): `clubledger/membership/service.py`
- [Membership routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/membership/routes.py): `clubledger/membership/routes.py`
- [Events and ticketing](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/events/service.py): `clubledger/events/service.py`
- [Event routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/events/routes.py): `clubledger/events/routes.py`
- [Merchandise](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/store/service.py): `clubledger/store/service.py`
- [Store routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/store/routes.py): `clubledger/store/routes.py`
- [Fundraiser tasks](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/tasks/service.py): `clubledger/tasks/service.py`
- [Task routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/tasks/routes.py): `clubledger/tasks/routes.py`
- [Expenses and receipts](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/expenses/service.py): `clubledger/expenses/service.py`
- [Announcements and mail](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/comms/service.py): `clubledger/comms/service.py`
- [Expense routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/expenses/routes.py): `clubledger/expenses/routes.py`

### Payments and finance

- [Payment processing](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/service.py): `clubledger/payments/service.py`
- [Payment routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/routes.py): `clubledger/payments/routes.py`
- [Payment simulator](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/simulator.py): `clubledger/payments/simulator.py`
- [Payment webhook](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/payments/webhook.py): `clubledger/payments/webhook.py`
- [Double-entry journal](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/journal/service.py): `clubledger/journal/service.py`
- [Financial reports](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/reports/service.py): `clubledger/reports/service.py`
- [Report routes](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/reports/routes.py): `clubledger/reports/routes.py`
- [Semester close](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/close/service.py): `clubledger/close/service.py`

### Runtime infrastructure

- [Application assembly](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/main.py): `clubledger/main.py`
- [SQLite and transactions](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/db.py): `clubledger/core/db.py`
- [Runtime configuration](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/config.py): `clubledger/config.py`
- [Clock](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/clock.py): `clubledger/core/clock.py`
- [Pricing rules](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/pricing.py): `clubledger/core/pricing.py`
- [Domain contracts](https://github.com/kaustubh-negi-01/clubledger/blob/master/clubledger/core/types.py): `clubledger/core/types.py`

### Other components

- **Member or officer**

## Connections

- Member or officer → Application assembly: opens workspace (evidence: `README.md`)
- Application assembly → Dashboard and workflows: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Authentication routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Membership routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Event routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Payment routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Report routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Expense routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Task routes: registers routes (evidence: `clubledger/main.py`)
- Application assembly → Store routes: registers routes (evidence: `clubledger/main.py`)
- Dashboard and workflows → UI rendering: renders pages (evidence: `clubledger/web/routes.py`)
- Authentication routes → Sessions and permissions: uses sessions (evidence: `clubledger/auth/routes.py`)
- Membership routes → Membership: calls service (evidence: `clubledger/membership/routes.py`)
- Event routes → Events and ticketing: calls service (evidence: `clubledger/events/routes.py`)
- Store routes → Merchandise: calls service (evidence: `clubledger/store/routes.py`)
- Task routes → Fundraiser tasks: calls service (evidence: `clubledger/tasks/routes.py`)
- Expense routes → Expenses and receipts: calls service (evidence: `clubledger/expenses/routes.py`)
- Payment routes → Payment processing: calls service (evidence: `clubledger/payments/routes.py`)
- Report routes → Financial reports: calls service (evidence: `clubledger/reports/routes.py`)
- Dashboard and workflows → Fundraiser tasks: uses service (evidence: `clubledger/web/routes.py`)
- Dashboard and workflows → Announcements and mail: uses service (evidence: `clubledger/web/routes.py`)
- Dashboard and workflows → Financial reports: uses service (evidence: `clubledger/web/routes.py`)
- Dashboard and workflows → Semester close: uses service (evidence: `clubledger/web/routes.py`)
- Membership → Payment processing: uses service (evidence: `clubledger/membership/service.py`)
- Events and ticketing → Payment processing: uses service (evidence: `clubledger/events/service.py`)
- Merchandise → Payment processing: uses service (evidence: `clubledger/store/service.py`)
- Payment processing → Double-entry journal: posts entries (evidence: `clubledger/payments/service.py`)
- Expenses and receipts → Double-entry journal: posts entries (evidence: `clubledger/expenses/service.py`)
- Semester close → Financial reports: uses reports (evidence: `clubledger/close/service.py`)
- Events and ticketing → Pricing rules: uses pricing (evidence: `clubledger/events/service.py`)
- Merchandise → Pricing rules: uses pricing (evidence: `clubledger/store/service.py`)
- Payment routes → Payment simulator: uses simulator (evidence: `clubledger/payments/routes.py`)
- Payment routes → Payment webhook: routes webhook (evidence: `clubledger/payments/routes.py`)
- Dashboard and workflows → SQLite and transactions: queries data (evidence: `clubledger/web/routes.py`)
- Sessions and permissions → SQLite and transactions: opens connection (evidence: `clubledger/core/auth.py`)
- Application assembly → Runtime configuration: loads settings (evidence: `clubledger/main.py`)
- Membership → Announcements and mail: uses service (evidence: `clubledger/membership/service.py`)
- Authentication routes → CSRF protection: uses protection (evidence: `clubledger/auth/routes.py`)
- Authentication routes → Rate limiting: uses limiter (evidence: `clubledger/auth/routes.py`)
- Dashboard and workflows → Clock: uses clock (evidence: `clubledger/web/routes.py`)
- Payment processing → Domain contracts: uses contracts (evidence: `clubledger/payments/service.py`)
