# tabgshu-ux/test-plastic-quote-ai architecture

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

- Interactive diagram: https://gitdiagram.com/tabgshu-ux/test-plastic-quote-ai
- Repository: https://github.com/tabgshu-ux/test-plastic-quote-ai

## Overview

This repository is a Streamlit ERP for a multinational injection-molding business. Users sign in, select a department and module, then manage operational records or view dashboards. Its domain spans quotations and customer orders, procurement and receiving, inventory, workforce and payroll, approvals, finance and tax, and executive reporting. Several sampled modules store data in Streamlit session state; the schema initializer and user-management code also indicate PostgreSQL-backed state. The README is only a title, and excerpts are partial, so module dispatch beyond the shown AP/AR calls is not asserted.

Main entry points: [`modules/executive_dashboard.py`](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/executive_dashboard.py) (Executive dashboard), [`app.py`](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/app.py) (Streamlit ERP), [`modules/sales_quotation.py`](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/sales_quotation.py) (Sales quotations), [`modules/user_management.py`](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/user_management.py) (User administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["ERP entry"]
  node_app["Streamlit ERP<br/>[app.py]"]
end

subgraph group_commercial["Commercial operations"]
  node_quotation["Sales quotations<br/>[sales_quotation.py]"]
  node_orders["Sales orders and AR<br/>[sales_order_ar.py]"]
  node_procurement["Procurement and AP<br/>[procurement_ap.py]"]
  node_invoices["Invoice management"]
end

subgraph group_operations["Operations and people"]
  node_warehouse["Warehouse inventory"]
  node_general["General affairs<br/>[general_affairs.py]"]
  node_assets["Asset management"]
  node_employees["Employee management"]
  node_payroll["Payroll management"]
end

subgraph group_finance["Finance and governance"]
  node_approvals["Approval workflow"]
  node_tax["Finance and tax<br/>[finance_tax.py]"]
end

subgraph group_insights["Reporting and administration"]
  node_executive["Executive dashboard"]
  node_erp_dashboard["ERP dashboard<br/>[erp_dashboard.py]"]
  node_users["User administration<br/>[user_management.py]"]
  node_security["Security utilities<br/>[security_utils.py]"]
  node_schema["Database schema setup<br/>[db_init.py]"]
end

node_employee(("ERP user"))
node_postgres[("PostgreSQL")]
node_market_data["Market data service"]
node_gemini["Google Gemini"]

node_employee -->|"uses"| node_app
node_app -->|"dispatches AP/AR"| node_orders
node_users -->|"connects"| node_postgres
node_schema -->|"creates schema"| node_postgres
node_executive -.->|"fetches quotes"| node_market_data
node_executive -.->|"requests advice"| node_gemini
node_quotation -.->|"AI assistance"| node_gemini

click node_app "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/app.py"
click node_quotation "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/sales_quotation.py"
click node_orders "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/sales_order_ar.py"
click node_procurement "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/procurement_ap.py"
click node_invoices "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/invoice_management.py"
click node_warehouse "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/warehouse_management.py"
click node_general "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/general_affairs.py"
click node_assets "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/asset_management.py"
click node_employees "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/employee_management.py"
click node_payroll "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/payroll_management.py"
click node_approvals "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/approval_workflow.py"
click node_tax "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/finance_tax.py"
click node_executive "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/executive_dashboard.py"
click node_erp_dashboard "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/erp_dashboard.py"
click node_users "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/user_management.py"
click node_security "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/security_utils.py"
click node_schema "https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/db_init.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_app,node_employee toneBlue
class node_quotation,node_orders,node_procurement,node_invoices,node_postgres toneAmber
class node_warehouse,node_general,node_assets,node_employees,node_payroll toneMint
class node_approvals,node_tax toneRose
class node_executive,node_erp_dashboard,node_users,node_security,node_schema,node_market_data,node_gemini toneIndigo
```

## Components

### ERP entry

- [Streamlit ERP](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/app.py): `app.py`

### Commercial operations

- [Sales quotations](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/sales_quotation.py): `modules/sales_quotation.py`
- [Sales orders and AR](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/sales_order_ar.py): `modules/sales_order_ar.py`
- [Procurement and AP](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/procurement_ap.py): `modules/procurement_ap.py`
- [Invoice management](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/invoice_management.py): `modules/invoice_management.py`

### Operations and people

- [Warehouse inventory](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/warehouse_management.py): `modules/warehouse_management.py`
- [General affairs](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/general_affairs.py): `modules/general_affairs.py`
- [Asset management](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/asset_management.py): `modules/asset_management.py`
- [Employee management](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/employee_management.py): `modules/employee_management.py`
- [Payroll management](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/payroll_management.py): `modules/payroll_management.py`

### Finance and governance

- [Approval workflow](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/approval_workflow.py): `modules/approval_workflow.py`
- [Finance and tax](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/finance_tax.py): `modules/finance_tax.py`

### Reporting and administration

- [Executive dashboard](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/executive_dashboard.py): `modules/executive_dashboard.py`
- [ERP dashboard](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/erp_dashboard.py): `modules/erp_dashboard.py`
- [User administration](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/user_management.py): `modules/user_management.py`
- [Security utilities](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/modules/security_utils.py): `modules/security_utils.py`
- [Database schema setup](https://github.com/tabgshu-ux/test-plastic-quote-ai/blob/main/db_init.py): `db_init.py`

### Other components

- **ERP user**
- **PostgreSQL**
- **Market data service**
- **Google Gemini**

## Connections

- ERP user → Streamlit ERP: uses
- Streamlit ERP → Sales orders and AR: dispatches AP/AR
- User administration → PostgreSQL: connects
- Database schema setup → PostgreSQL: creates schema
- Executive dashboard → Market data service: fetches quotes
- Executive dashboard → Google Gemini: requests advice
- Sales quotations → Google Gemini: AI assistance
