# kushdoshi07/restaurant-management-system architecture

> Architecture diagram of the GitHub repository kushdoshi07/restaurant-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kushdoshi07/restaurant-management-system
- Repository: https://github.com/kushdoshi07/restaurant-management-system

## Overview

##### Project Type and Purpose
- This is a single-tier desktop application written in Python using the Tkinter library.
- Its purpose is to provide a simple Restaurant Management System with GUI for item selection, cost calculation, receipt generation, file-based bill storage, and SMS sending via Fast2SMS API.

##### File Structure Analysis
- Top-level files:
- README.md – project description and feature list
- Restaurant Management System.py – the entire application code resides here
- There are no separate frontend/backend folders; everything runs as one process.

##### Key Insights from README
- GUI built with Tkinter
- Core features: item selection, quantity input, cost/subtotal calculation, service tax, total cost
- Receipt generation and “Save Bill” writes to a local text file
- External integration: Fast2SMS REST API for sending SMS

##### Main Components
a. User
b. GUI Layer (Tkinter windows, buttons, entry fields)
c. Business Logic Layer
- Item and quantity validators
- Cost calculation engine (food, drink, dessert, subtotal, tax, total)
- Receipt formatter
d. Persistence
- File System (write/read text files for saved bills)
e. External Service
- Fast2SMS REST API (HTTP request/response)
f. Optional: Logging/Error Handler if present in code

##### Relationships and Interactions
- User → GUI: clicks buttons, enters quantities
- GUI → Business Logic: passes item selection and quantity data
- Business Logic → GUI: returns calculated costs and formatted receipt text
- Business Logic → File System: sends “save” commands with receipt text
- Business Logic → Fast2SMS API: issues HTTP POST to send SMS, receives status
- File System & Fast2SMS → Business Logic: response codes or error messages
- Business Logic → GUI: displays success/failure notices

##### Architectural Patterns and Design Principles
- Layered approach (UI layer, logic layer, persistence/external layer)
- Single-process, event-driven model (Tkinter main loop)
- Separation of concerns: isolate GUI code from calculation logic and I/O

##### Relevant Technologies and Libraries
- Python 3.x
- Tkinter for GUI
- Standard file I/O (open, read, write)
- requests (or urllib) for Fast2SMS REST calls
- Optional: JSON parsing library for API payloads

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interaction"
        User["User"]:::user
    end

    subgraph "UI Layer"
        GUI["GUI Layer\n(Tkinter UI)"]:::gui
    end

    subgraph "Logic Layer"
        Logic["Business Logic Layer\n(Validation, Calculation, Formatting)"]:::logic
    end

    subgraph "Persistence"
        FS["File System\n(Local Text Files)"]:::persistence
    end

    subgraph "External Service"
        SMS["Fast2SMS API\n(HTTP REST Service)"]:::external
    end

    Doc["README.md\n(Project Documentation)"]:::doc

    User -->|"userEvent()"| GUI
    GUI -->|"validateInput(),calculateTotal()"| Logic
    Logic -->|"saveBill()"| FS
    FS -.->|"fileStatus"| Logic
    Logic -->|"POST /sendSMS"| SMS
    SMS -.->|"response"| Logic
    Logic -->|"displayReceipt(),showStatus()"| GUI

    click GUI "https://github.com/kushdoshi07/restaurant-management-system/blob/main/Restaurant Management System.py"
    click Logic "https://github.com/kushdoshi07/restaurant-management-system/blob/main/Restaurant Management System.py"
    click FS "https://github.com/kushdoshi07/restaurant-management-system/blob/main/Restaurant Management System.py"
    click SMS "https://github.com/kushdoshi07/restaurant-management-system/blob/main/Restaurant Management System.py"
    click Doc "https://github.com/kushdoshi07/restaurant-management-system/blob/main/README.md"

    classDef user fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef gui fill:#add8e6,stroke:#333,stroke-width:1px
    classDef logic fill:#90ee90,stroke:#333,stroke-width:1px
    classDef persistence fill:#ffffe0,stroke:#333,stroke-width:1px
    classDef external fill:#ffa500,stroke:#333,stroke-width:1px
    classDef doc fill:#f0f0f0,stroke:#333,stroke-width:1px
```
