# beexoul/delicious_restaurant_management_system architecture

> Architecture diagram of the GitHub repository beexoul/delicious_restaurant_management_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/beexoul/delicious_restaurant_management_system
- Repository: https://github.com/beexoul/delicious_restaurant_management_system

## Overview

##### Project Type and Purpose
- This is a monolithic, role-based CLI application (not a web app) for a **Food Ordering System** written in Python.
- It supports four user roles (Admin, Manager, Chef, Customer), each with its own module folder under the root.
- The entry point (`main.py`) handles authentication, password recovery, and dispatches control to the appropriate role module.

##### File Structure
- Top-level:
- `main.py`: CLI controller & router
- `User_Data/`: JSON files as the (flat-file) data store
- `user_admin/`, `user_manager/`, `user_chef/`, `user_customer/`: role-specific packages
- Each role package:
- A `*.py` driver (e.g. `admin.py`, `manager.py`, `chef.py`, `customer.py`)
- Supporting scripts for profile, domain actions, reporting, feedback, orders, etc.
- No external database—data persistence via JSON files.

##### README for Additional Insights
- Describes each role’s CRUD-style capabilities:
- Admin: staff mgmt, reports, feedback
- Manager: customer/menu mgmt, ingredient requests
- Chef: order processing, ingredient requests
- Customer: browsing, ordering, feedback
- Future direction: migrate to text files, add validation & error handling.

##### Elements
- Component Names: `main.py`, each `user_<role>` package, `User_Data/*.json`
- Arrowheads showing request/response or read/write

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        CLI["CLI Interface"]:::presentation
    end

    %% Control Layer
    subgraph "Control Layer"
        Auth["Authentication & Authorization Layer"]:::control
    end

    %% Role Modules
    subgraph "Role Modules"
        subgraph "Admin Module"
            A1["admin.py"]:::role
            A2["adminprofile.py"]:::role
            A3["feedback.py"]:::role
            A4["manage_staff.py"]:::role
            A5["view_reports.py"]:::role
        end
        subgraph "Manager Module"
            M1["manager.py"]:::role
            M2["managerprofile.py"]:::role
            M3["managecustomer.py"]:::role
            M4["manageitem.py"]:::role
            M5["managemenu.py"]:::role
        end
        subgraph "Chef Module"
            C1["chef.py"]:::role
            C2["chefprofile.py"]:::role
            C3["Request_ingredients.py"]:::role
            C4["updateorder.py"]:::role
            C5["vieworder.py"]:::role
        end
        subgraph "Customer Module"
            U1["customer.py"]:::role
            U2["customerprofile.py"]:::role
            U3["order.py"]:::role
            U4["orderstatus.py"]:::role
            U5["sendfeedback.py"]:::role
        end
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        DS["JSON Data Store"]:::data
        DS1["customer_credentials.json"]:::data
        DS2["feedbacks.json"]:::data
        DS3["inventory.json"]:::data
        DS4["menu.json"]:::data
        DS5["orders.json"]:::data
        DS6["users.json"]:::data
    end

    %% Connections
    CLI -->|"start / input"| Auth
    Auth -->|"dispatch to Admin"| A1
    Auth -->|"dispatch to Manager"| M1
    Auth -->|"dispatch to Chef"| C1
    Auth -->|"dispatch to Customer"| U1

    A1 -->|"read/write users, feedbacks"| DS
    M1 -->|"read/write users, menu, inventory"| DS
    C1 -->|"read/write orders, inventory"| DS
    U1 -->|"read/write orders, feedbacks"| DS

    %% Click Events
    click CLI "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/main.py"
    click Auth "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/main.py"

    click DS "https://github.com/beexoul/delicious_restaurant_management_system/tree/main/User_Data/"
    click DS1 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/User_Data/customer_credentials.json"
    click DS2 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/User_Data/feedbacks.json"
    click DS3 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/User_Data/inventory.json"
    click DS4 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/User_Data/menu.json"
    click DS5 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/User_Data/orders.json"
    click DS6 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/User_Data/users.json"

    click A1 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_admin/admin.py"
    click A2 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_admin/adminprofile.py"
    click A3 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_admin/feedback.py"
    click A4 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_admin/manage_staff.py"
    click A5 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_admin/view_reports.py"

    click M1 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_manager/manager.py"
    click M2 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_manager/managerprofile.py"
    click M3 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_manager/managecustomer.py"
    click M4 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_manager/manageitem.py"
    click M5 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_manager/managemenu.py"

    click C1 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_chef/chef.py"
    click C2 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_chef/chefprofile.py"
    click C3 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_chef/Request_ingredients.py"
    click C4 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_chef/updateorder.py"
    click C5 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_chef/vieworder.py"

    click U1 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_customer/customer.py"
    click U2 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_customer/customerprofile.py"
    click U3 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_customer/order.py"
    click U4 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_customer/orderstatus.py"
    click U5 "https://github.com/beexoul/delicious_restaurant_management_system/blob/main/user_customer/sendfeedback.py"

    %% Styles
    classDef presentation fill:#DDEBF7,stroke:#000
    classDef control fill:#BDD7EE,stroke:#000
    classDef role fill:#D9EAD3,stroke:#000
    classDef data fill:#FCE4D6,stroke:#000
```
