# rahil312/food-manufacturing-inventory-management-system architecture

> Architecture diagram of the GitHub repository rahil312/food-manufacturing-inventory-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rahil312/food-manufacturing-inventory-management-system
- Repository: https://github.com/rahil312/food-manufacturing-inventory-management-system

## Overview

This is a Python CLI backed by MySQL for food-manufacturing inventory and production. A user logs in, is routed by role, and performs manufacturer, supplier, or read-only viewer operations against the database. The README describes database-enforced capabilities including FEFO consumption, recipes, supplier formulations, compliance, auditability, and reporting. The excerpts confirm login and database access; role-operation links beyond the shown entry-point dispatch are documented or unverified, so those edges are dashed.

Main entry points: [`app/db.py`](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/db.py) (Database helpers), [`app/menus.py`](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/menus.py) (Role menus), [`app/main.py`](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/main.py) (Application entry), [`app/auth.py`](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/auth.py) (Login authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI access"]
  node_entry["Application entry<br/>[main.py]"]
  node_auth["Login authentication<br/>[auth.py]"]
  node_menus["Role menus<br/>[menus.py]"]
end

subgraph group_operations["Business operations"]
  node_manufacturer["Manufacturing operations"]
  node_supplier["Supplier operations"]
  node_viewer["Read-only browsing<br/>[viewer_actions.py]"]
  node_reports["Inventory queries<br/>[queries.py]"]
end

subgraph group_data["Database access"]
  node_dbaccess["Database helpers<br/>[db.py]"]
  node_businessdb[("Inventory business logic")]
end

subgraph group_maintenance["Data maintenance"]
  node_clear["Data clearing<br/>[clear_data.py]"]
end

node_user(("CLI user"))
node_mysql[("MySQL server")]

node_user -->|"starts"| node_entry
node_entry -->|"authenticates"| node_auth
node_entry -->|"dispatches by role"| node_menus
node_menus -.->|"offers operations"| node_manufacturer
node_menus -.->|"offers operations"| node_supplier
node_menus -.->|"offers browsing"| node_viewer
node_auth -->|"queries accounts"| node_dbaccess
node_manufacturer -.->|"uses queries"| node_dbaccess
node_supplier -.->|"uses queries"| node_dbaccess
node_viewer -->|"queries data"| node_dbaccess
node_reports -->|"runs queries"| node_dbaccess
node_clear -->|"deletes records"| node_dbaccess
node_dbaccess -->|"executes SQL"| node_mysql
node_businessdb -->|"defines schema logic"| node_mysql

click node_entry "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/main.py"
click node_auth "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/auth.py"
click node_menus "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/menus.py"
click node_manufacturer "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/manufacturer_actions.py"
click node_supplier "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/supplier_actions.py"
click node_viewer "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/viewer_actions.py"
click node_reports "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/queries.py"
click node_dbaccess "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/db.py"
click node_businessdb "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/01_schema_and_logic.sql"
click node_clear "https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/clear_data.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_entry,node_auth,node_menus,node_user toneBlue
class node_manufacturer,node_supplier,node_viewer,node_reports,node_mysql toneAmber
class node_dbaccess,node_businessdb toneMint
class node_clear toneRose
```

## Components

### CLI access

- [Application entry](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/main.py): `app/main.py`
- [Login authentication](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/auth.py): `app/auth.py`
- [Role menus](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/menus.py): `app/menus.py`

### Business operations

- [Manufacturing operations](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/manufacturer_actions.py): `app/manufacturer_actions.py`
- [Supplier operations](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/supplier_actions.py): `app/supplier_actions.py`
- [Read-only browsing](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/viewer_actions.py): `app/viewer_actions.py`
- [Inventory queries](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/queries.py): `app/queries.py`

### Database access

- [Database helpers](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/db.py): `app/db.py`
- [Inventory business logic](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/01_schema_and_logic.sql): `01_schema_and_logic.sql`

### Data maintenance

- [Data clearing](https://github.com/rahil312/food-manufacturing-inventory-management-system/blob/main/app/clear_data.py): `app/clear_data.py`

### Other components

- **CLI user**
- **MySQL server**

## Connections

- CLI user → Application entry: starts (evidence: `README.md`)
- Application entry → Login authentication: authenticates (evidence: `app/main.py`)
- Application entry → Role menus: dispatches by role (evidence: `app/main.py`)
- Role menus → Manufacturing operations: offers operations
- Role menus → Supplier operations: offers operations
- Role menus → Read-only browsing: offers browsing
- Login authentication → Database helpers: queries accounts (evidence: `app/auth.py`)
- Manufacturing operations → Database helpers: uses queries
- Supplier operations → Database helpers: uses queries
- Read-only browsing → Database helpers: queries data (evidence: `app/viewer_actions.py`)
- Inventory queries → Database helpers: runs queries (evidence: `app/queries.py`)
- Data clearing → Database helpers: deletes records (evidence: `app/clear_data.py`)
- Database helpers → MySQL server: executes SQL (evidence: `app/db.py`)
- Inventory business logic → MySQL server: defines schema logic (evidence: `README.md`)
