# stevenvdsouza/python_assignment architecture

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

- Interactive diagram: https://gitdiagram.com/stevenvdsouza/python_assignment
- Repository: https://github.com/stevenvdsouza/python_assignment

## Overview

This is a restaurant operations system covering order placement and billing, ingredient inventory, restaurant/review analytics, and operational reports; it also provides a separate website-scraping capability. The main order workflow is represented through the sampled OrderManager and its database, inventory, model, and exception dependencies. The README is empty and main.py/database.py were not excerpted, so their internal wiring is not inferred; scraper integration with the operations workflow is likewise unverified.

Main entry points: [`restaurant_system/reports.py`](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/reports.py) (Operational Reports), [`restaurant_system/order_manager.py`](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/order_manager.py) (Order Manager), [`restaurant_system/database.py`](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/database.py) (Restaurant Database), [`restaurant_system/scraper.py`](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/scraper.py) (Website Scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Order Operations"]
  node_main["Application Entry<br/>[main.py]"]
  node_orders["Order Manager<br/>[order_manager.py]"]
  node_order_models["Domain Models<br/>[models.py]"]
  node_order_errors["Order Exceptions<br/>[exceptions.py]"]
end

subgraph group_data["Data And Inventory"]
  node_database[("Restaurant Database<br/>[database.py]")]
  node_inventory["Inventory Management<br/>[inventory.py]"]
end

subgraph group_insights["Analytics And Reports"]
  node_analytics["Business Analytics<br/>[analytics.py]"]
  node_validators["Feedback Validators<br/>[validators.py]"]
  node_reports["Operational Reports<br/>[reports.py]"]
end

subgraph group_scraping["Restaurant Scraping"]
  node_scraper["Website Scraper<br/>[scraper.py]"]
  node_sample_html["Sample Restaurant HTML"]
end

node_operator(("System User"))
node_restaurant_site(("Restaurant Website"))
node_export_files["CSV Excel Files"]

node_orders -->|"reads and writes"| node_database
node_orders -->|"refreshes availability"| node_inventory
node_orders -->|"creates orders"| node_order_models
node_orders -->|"raises errors"| node_order_errors
node_inventory -->|"updates ingredients"| node_database
node_analytics -->|"queries records"| node_database
node_analytics -->|"extracts keywords"| node_validators
node_reports -->|"builds metrics"| node_analytics
node_reports -->|"reads stock"| node_inventory
node_reports -->|"places sample orders"| node_orders
node_reports -->|"queries records"| node_database
node_reports -->|"exports reports"| node_export_files
node_scraper -->|"fetches permitted pages"| node_restaurant_site
node_scraper -->|"loads fallback"| node_sample_html
node_scraper -->|"saves scraped data"| node_export_files

click node_main "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/main.py"
click node_orders "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/order_manager.py"
click node_order_models "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/models.py"
click node_order_errors "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/exceptions.py"
click node_database "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/database.py"
click node_inventory "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/inventory.py"
click node_analytics "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/analytics.py"
click node_validators "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/validators.py"
click node_reports "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/reports.py"
click node_scraper "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/scraper.py"
click node_sample_html "https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/data/sample_restaurant.html"

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_main,node_orders,node_order_models,node_order_errors,node_operator toneBlue
class node_database,node_inventory toneAmber
class node_analytics,node_validators,node_reports toneMint
class node_scraper,node_sample_html toneRose
class node_restaurant_site,node_export_files toneIndigo
```

## Components

### Order Operations

- [Application Entry](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/main.py): `restaurant_system/main.py`
- [Order Manager](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/order_manager.py): `restaurant_system/order_manager.py`
- [Domain Models](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/models.py): `restaurant_system/models.py`
- [Order Exceptions](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/exceptions.py): `restaurant_system/exceptions.py`

### Data And Inventory

- [Restaurant Database](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/database.py): `restaurant_system/database.py`
- [Inventory Management](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/inventory.py): `restaurant_system/inventory.py`

### Analytics And Reports

- [Business Analytics](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/analytics.py): `restaurant_system/analytics.py`
- [Feedback Validators](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/validators.py): `restaurant_system/validators.py`
- [Operational Reports](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/reports.py): `restaurant_system/reports.py`

### Restaurant Scraping

- [Website Scraper](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/scraper.py): `restaurant_system/scraper.py`
- [Sample Restaurant HTML](https://github.com/stevenvdsouza/python_assignment/blob/main/restaurant_system/data/sample_restaurant.html): `restaurant_system/data/sample_restaurant.html`

### Other components

- **System User**
- **Restaurant Website**
- **CSV Excel Files**

## Connections

- Order Manager → Restaurant Database: reads and writes (evidence: `restaurant_system/order_manager.py`)
- Order Manager → Inventory Management: refreshes availability (evidence: `restaurant_system/order_manager.py`)
- Order Manager → Domain Models: creates orders (evidence: `restaurant_system/order_manager.py`)
- Order Manager → Order Exceptions: raises errors (evidence: `restaurant_system/order_manager.py`)
- Inventory Management → Restaurant Database: updates ingredients (evidence: `restaurant_system/inventory.py`)
- Business Analytics → Restaurant Database: queries records (evidence: `restaurant_system/analytics.py`)
- Business Analytics → Feedback Validators: extracts keywords (evidence: `restaurant_system/analytics.py`)
- Operational Reports → Business Analytics: builds metrics (evidence: `restaurant_system/reports.py`)
- Operational Reports → Inventory Management: reads stock (evidence: `restaurant_system/reports.py`)
- Operational Reports → Order Manager: places sample orders (evidence: `restaurant_system/reports.py`)
- Operational Reports → Restaurant Database: queries records (evidence: `restaurant_system/reports.py`)
- Operational Reports → CSV Excel Files: exports reports (evidence: `restaurant_system/reports.py`)
- Website Scraper → Restaurant Website: fetches permitted pages (evidence: `restaurant_system/scraper.py`)
- Website Scraper → Sample Restaurant HTML: loads fallback (evidence: `restaurant_system/scraper.py`)
- Website Scraper → CSV Excel Files: saves scraped data (evidence: `restaurant_system/scraper.py`)
