# sephguirren/inventory_system architecture

> Architecture diagram of the GitHub repository sephguirren/inventory_system, 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/sephguirren/inventory_system
- Repository: https://github.com/sephguirren/inventory_system

## Overview

Celeste Inventory is a Flask/MySQL inventory and point-of-sale application. The main workflow is staff sign-in, warehouse-scoped product and order management, and completed sales that deduct stock; dashboards and receipts expose sales results. The README also documents global/supervisor access, warehouse and personnel management, customer/VIP features, analytics, and audit logging. The sampled backend excerpt confirms database-backed dashboard, product, order, and customer operations; other documented capabilities are shown without inferring unsampled internal wiring.

Main entry points: [`frontend/js/api.js`](https://github.com/sephguirren/inventory_system/blob/main/frontend/js/api.js) (API and auth client), [`backend/app.py`](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py) (Flask API), [`frontend/login.html`](https://github.com/sephguirren/inventory_system/blob/main/frontend/login.html) (Sign-in), [`frontend/dashboard.html`](https://github.com/sephguirren/inventory_system/blob/main/frontend/dashboard.html) (Analytics dashboards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_sign_in["Sign-in<br/>[login.html]"]
  node_api_client["API and auth client<br/>[api.js]"]
  node_dashboards["Analytics dashboards<br/>[dashboard.html]"]
  node_supervisor_dashboard["Supervisor dashboard"]
  node_products_ui["Product management<br/>[products.html]"]
  node_orders_ui["Orders and POS<br/>[orders.html]"]
  node_receipt_ui["E-receipts<br/>[receipt.html]"]
  node_customers_ui["Customer records<br/>[customers.html]"]
  node_supervisors_ui["Personnel management<br/>[supervisors.html]"]
  node_warehouses_ui["Warehouse management<br/>[warehouses.html]"]
end

subgraph group_service["Application service"]
  node_backend_api["Flask API<br/>[app.py]"]
  node_access_control["Role and zone access<br/>[app.py]"]
  node_inventory["Inventory operations<br/>[app.py]"]
  node_sales["POS and sales<br/>[app.py]"]
  node_analytics["Sales analytics<br/>[app.py]"]
  node_customer_insights["Customer and VIP insights<br/>[app.py]"]
  node_audit["Activity audit<br/>[app.py]"]
end

subgraph group_data["Persistent data"]
  node_mysql[("MySQL database")]
end

node_staff(("Staff"))

node_staff -->|"signs in"| node_sign_in
node_sign_in -->|"uses auth"| node_api_client
node_dashboards -->|"requests analytics"| node_api_client
node_supervisor_dashboard -->|"requests analytics"| node_api_client
node_products_ui -->|"manages products"| node_api_client
node_orders_ui -->|"submits orders"| node_api_client
node_receipt_ui -->|"requests receipt"| node_api_client
node_customers_ui -->|"requests customers"| node_api_client
node_supervisors_ui -->|"manages personnel"| node_api_client
node_warehouses_ui -->|"manages warehouses"| node_api_client
node_api_client -->|"calls API"| node_backend_api
node_backend_api -->|"applies roles"| node_access_control
node_backend_api -->|"handles product requests"| node_inventory
node_backend_api -->|"handles order requests"| node_sales
node_backend_api -->|"handles dashboard requests"| node_analytics
node_backend_api -->|"handles customer requests"| node_customer_insights
node_backend_api -->|"records activity"| node_audit
node_backend_api -->|"queries and updates"| node_mysql

click node_sign_in "https://github.com/sephguirren/inventory_system/blob/main/frontend/login.html"
click node_api_client "https://github.com/sephguirren/inventory_system/blob/main/frontend/js/api.js"
click node_dashboards "https://github.com/sephguirren/inventory_system/blob/main/frontend/dashboard.html"
click node_supervisor_dashboard "https://github.com/sephguirren/inventory_system/blob/main/frontend/supervisor_dashboard.html"
click node_products_ui "https://github.com/sephguirren/inventory_system/blob/main/frontend/products.html"
click node_orders_ui "https://github.com/sephguirren/inventory_system/blob/main/frontend/orders.html"
click node_receipt_ui "https://github.com/sephguirren/inventory_system/blob/main/frontend/receipt.html"
click node_customers_ui "https://github.com/sephguirren/inventory_system/blob/main/frontend/customers.html"
click node_supervisors_ui "https://github.com/sephguirren/inventory_system/blob/main/frontend/supervisors.html"
click node_warehouses_ui "https://github.com/sephguirren/inventory_system/blob/main/frontend/warehouses.html"
click node_backend_api "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_access_control "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_inventory "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_sales "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_analytics "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_customer_insights "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_audit "https://github.com/sephguirren/inventory_system/blob/main/backend/app.py"
click node_mysql "https://github.com/sephguirren/inventory_system/blob/main/dbase/celeste_inventory.sql"

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_sign_in,node_api_client,node_dashboards,node_supervisor_dashboard,node_products_ui,node_orders_ui,node_receipt_ui,node_customers_ui,node_supervisors_ui,node_warehouses_ui toneBlue
class node_backend_api,node_access_control,node_inventory,node_sales,node_analytics,node_customer_insights,node_audit toneAmber
class node_mysql toneMint
class node_staff toneIndigo
```

## Components

### Web interface

- [Sign-in](https://github.com/sephguirren/inventory_system/blob/main/frontend/login.html): `frontend/login.html`
- [API and auth client](https://github.com/sephguirren/inventory_system/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [Analytics dashboards](https://github.com/sephguirren/inventory_system/blob/main/frontend/dashboard.html): `frontend/dashboard.html`
- [Supervisor dashboard](https://github.com/sephguirren/inventory_system/blob/main/frontend/supervisor_dashboard.html): `frontend/supervisor_dashboard.html`
- [Product management](https://github.com/sephguirren/inventory_system/blob/main/frontend/products.html): `frontend/products.html`
- [Orders and POS](https://github.com/sephguirren/inventory_system/blob/main/frontend/orders.html): `frontend/orders.html`
- [E-receipts](https://github.com/sephguirren/inventory_system/blob/main/frontend/receipt.html): `frontend/receipt.html`
- [Customer records](https://github.com/sephguirren/inventory_system/blob/main/frontend/customers.html): `frontend/customers.html`
- [Personnel management](https://github.com/sephguirren/inventory_system/blob/main/frontend/supervisors.html): `frontend/supervisors.html`
- [Warehouse management](https://github.com/sephguirren/inventory_system/blob/main/frontend/warehouses.html): `frontend/warehouses.html`

### Application service

- [Flask API](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`
- [Role and zone access](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`
- [Inventory operations](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`
- [POS and sales](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`
- [Sales analytics](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`
- [Customer and VIP insights](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`
- [Activity audit](https://github.com/sephguirren/inventory_system/blob/main/backend/app.py): `backend/app.py`

### Persistent data

- [MySQL database](https://github.com/sephguirren/inventory_system/blob/main/dbase/celeste_inventory.sql): `dbase/celeste_inventory.sql`

### Other components

- **Staff**

## Connections

- Staff → Sign-in: signs in
- Sign-in → API and auth client: uses auth
- Analytics dashboards → API and auth client: requests analytics
- Supervisor dashboard → API and auth client: requests analytics
- Product management → API and auth client: manages products
- Orders and POS → API and auth client: submits orders
- E-receipts → API and auth client: requests receipt
- Customer records → API and auth client: requests customers
- Personnel management → API and auth client: manages personnel
- Warehouse management → API and auth client: manages warehouses
- API and auth client → Flask API: calls API
- Flask API → Role and zone access: applies roles
- Flask API → Inventory operations: handles product requests
- Flask API → POS and sales: handles order requests
- Flask API → Sales analytics: handles dashboard requests
- Flask API → Customer and VIP insights: handles customer requests
- Flask API → Activity audit: records activity
- Flask API → MySQL database: queries and updates
