# chung-wei-yong/airost_project architecture

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

- Interactive diagram: https://gitdiagram.com/chung-wei-yong/airost_project
- Repository: https://github.com/chung-wei-yong/airost_project

## Overview

BudgetAI is a Django finance workspace for student clubs. Members register, join clubs, submit expenses, and follow their status; officers review requests under role and approval-limit rules, with approved expenses entering the ledger. Officers also record income, view reports, and export PDFs. Separate branches handle receipt extraction followed by member confirmation, and a role-scoped finance chatbot. The graph reflects documented workflows and sampled calls; several detailed view paths were excerpted only partially, so unsupported internal links are omitted.

Main entry points: [`finance/views.py`](https://github.com/chung-wei-yong/airost_project/blob/main/finance/views.py) (Finance workflows), [`finance/service/chat_service.py`](https://github.com/chung-wei-yong/airost_project/blob/main/finance/service/chat_service.py) (Finance assistant), [`account/views.py`](https://github.com/chung-wei-yong/airost_project/blob/main/account/views.py) (Accounts), [`clubs/views.py`](https://github.com/chung-wei-yong/airost_project/blob/main/clubs/views.py) (Club management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts and clubs"]
  node_accounts["Accounts<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_account_data[("User accounts<br/>[models.py]")]
  node_club_views["Club management<br/>[views.py]"]
  node_club_forms["Club forms<br/>[forms.py]"]
  node_club_data[("Clubs and roles<br/>[models.py]")]
end

subgraph group_finance["Finance workflows"]
  node_finance_views["Finance workflows<br/>[views.py]"]
  node_finance_forms["Finance forms<br/>[forms.py]"]
  node_finance_data[("Requests and ledger<br/>[models.py]")]
end

subgraph group_insights["AI and reporting"]
  node_receipt_ai["Receipt extraction<br/>[ai_service.py]"]
  node_chat_service["Finance assistant<br/>[chat_service.py]"]
  node_pdf_service["Financial reports<br/>[views.py]"]
  node_ai_provider["AI API"]
end

subgraph group_communications["Notifications"]
  node_email["SMTP email"]
end

node_member(("Club user"))

node_member -->|"registers or signs in"| node_accounts
node_accounts -->|"validates signup"| node_account_forms
node_accounts -->|"creates user"| node_account_data
node_member -->|"creates or joins club"| node_club_views
node_club_views -->|"validates changes"| node_club_forms
node_club_views -->|"creates membership"| node_club_data
node_member -->|"submits expense"| node_finance_views
node_finance_views -->|"validates finance input"| node_finance_forms
node_finance_views -->|"records requests and transactions"| node_finance_data
node_finance_views -->|"checks membership and role"| node_club_data
node_finance_views -->|"sends email"| node_email
node_finance_views -->|"extracts receipt details"| node_receipt_ai
node_receipt_ai -->|"requests extraction"| node_ai_provider
node_member -->|"asks finance question"| node_chat_service
node_finance_views -->|"delegates chat"| node_chat_service
node_chat_service -->|"reads scoped records"| node_finance_data
node_chat_service -->|"requests answer"| node_ai_provider
node_finance_views -->|"builds PDF report"| node_pdf_service
node_pdf_service -->|"summarizes records"| node_finance_data

click node_accounts "https://github.com/chung-wei-yong/airost_project/blob/main/account/views.py"
click node_account_forms "https://github.com/chung-wei-yong/airost_project/blob/main/account/forms.py"
click node_account_data "https://github.com/chung-wei-yong/airost_project/blob/main/account/models.py"
click node_club_views "https://github.com/chung-wei-yong/airost_project/blob/main/clubs/views.py"
click node_club_forms "https://github.com/chung-wei-yong/airost_project/blob/main/clubs/forms.py"
click node_club_data "https://github.com/chung-wei-yong/airost_project/blob/main/clubs/models.py"
click node_finance_views "https://github.com/chung-wei-yong/airost_project/blob/main/finance/views.py"
click node_finance_forms "https://github.com/chung-wei-yong/airost_project/blob/main/finance/forms.py"
click node_finance_data "https://github.com/chung-wei-yong/airost_project/blob/main/finance/models.py"
click node_receipt_ai "https://github.com/chung-wei-yong/airost_project/blob/main/finance/service/ai_service.py"
click node_chat_service "https://github.com/chung-wei-yong/airost_project/blob/main/finance/service/chat_service.py"
click node_pdf_service "https://github.com/chung-wei-yong/airost_project/blob/main/finance/views.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_accounts,node_account_forms,node_account_data,node_club_views,node_club_forms,node_club_data,node_member toneBlue
class node_finance_views,node_finance_forms,node_finance_data toneAmber
class node_receipt_ai,node_chat_service,node_pdf_service,node_ai_provider toneMint
class node_email toneRose
```

## Components

### Accounts and clubs

- [Accounts](https://github.com/chung-wei-yong/airost_project/blob/main/account/views.py): `account/views.py`
- [Account forms](https://github.com/chung-wei-yong/airost_project/blob/main/account/forms.py): `account/forms.py`
- [User accounts](https://github.com/chung-wei-yong/airost_project/blob/main/account/models.py): `account/models.py`
- [Club management](https://github.com/chung-wei-yong/airost_project/blob/main/clubs/views.py): `clubs/views.py`
- [Club forms](https://github.com/chung-wei-yong/airost_project/blob/main/clubs/forms.py): `clubs/forms.py`
- [Clubs and roles](https://github.com/chung-wei-yong/airost_project/blob/main/clubs/models.py): `clubs/models.py`

### Finance workflows

- [Finance workflows](https://github.com/chung-wei-yong/airost_project/blob/main/finance/views.py): `finance/views.py`
- [Finance forms](https://github.com/chung-wei-yong/airost_project/blob/main/finance/forms.py): `finance/forms.py`
- [Requests and ledger](https://github.com/chung-wei-yong/airost_project/blob/main/finance/models.py): `finance/models.py`

### AI and reporting

- [Receipt extraction](https://github.com/chung-wei-yong/airost_project/blob/main/finance/service/ai_service.py): `finance/service/ai_service.py`
- [Finance assistant](https://github.com/chung-wei-yong/airost_project/blob/main/finance/service/chat_service.py): `finance/service/chat_service.py`
- [Financial reports](https://github.com/chung-wei-yong/airost_project/blob/main/finance/views.py): `finance/views.py`
- **AI API**

### Notifications

- **SMTP email**

### Other components

- **Club user**

## Connections

- Club user → Accounts: registers or signs in (evidence: `README.md`)
- Accounts → Account forms: validates signup (evidence: `account/views.py`)
- Accounts → User accounts: creates user (evidence: `account/views.py`)
- Club user → Club management: creates or joins club (evidence: `README.md`)
- Club management → Club forms: validates changes (evidence: `clubs/views.py`)
- Club management → Clubs and roles: creates membership (evidence: `clubs/views.py`)
- Club user → Finance workflows: submits expense (evidence: `README.md`)
- Finance workflows → Finance forms: validates finance input (evidence: `finance/views.py`)
- Finance workflows → Requests and ledger: records requests and transactions (evidence: `README.md`)
- Finance workflows → Clubs and roles: checks membership and role (evidence: `finance/views.py`)
- Finance workflows → SMTP email: sends email (evidence: `README.md`)
- Finance workflows → Receipt extraction: extracts receipt details (evidence: `finance/views.py`)
- Receipt extraction → AI API: requests extraction (evidence: `finance/service/ai_service.py`)
- Club user → Finance assistant: asks finance question (evidence: `README.md`)
- Finance workflows → Finance assistant: delegates chat (evidence: `finance/views.py`)
- Finance assistant → Requests and ledger: reads scoped records (evidence: `finance/service/chat_service.py`)
- Finance assistant → AI API: requests answer (evidence: `finance/service/chat_service.py`)
- Finance workflows → Financial reports: builds PDF report (evidence: `finance/views.py`)
- Financial reports → Requests and ledger: summarizes records (evidence: `README.md`)
