# abdullahsajid007/automated-coffee-shop-in-java architecture

> Architecture diagram of the GitHub repository abdullahsajid007/automated-coffee-shop-in-java, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdullahsajid007/automated-coffee-shop-in-java
- Repository: https://github.com/abdullahsajid007/automated-coffee-shop-in-java

## Overview

##### Project type and purpose
- This is a standalone Java console application (“Automated Coffee Shop Management System”) that automates shop operations for two user roles (Admin and Customer).
- It uses file-based persistence (menu.txt, order.txt, customer.txt) rather than a database.

##### File structure
- Top-level: README.md, a PDF spec, and one folder: `src`.
- Classes in `src`:
- Main.java – entry point and console UI router
- Person.java – base model for shared attributes
– Admin.java and Customer.java extend Person
- Menu.java – business logic for menu CRUD and file I/O
- MenuItem.java – model for individual items
- TakeOrder.java – business logic for order processing, payment calculations, stock updates
- ShopDetails.java – static shop metadata
- No separate “frontend” or “backend” folders; UI and logic are co-located in console classes.
- Persistence is handled via simple file readers/writers (no ORM or DB).

##### README for additional insights
- Clearly split user flows: Admin features vs Customer features.
- Data persistence is file-based, with three text files.
- No external services or network calls.
- Future enhancements mention GUI or database integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Console UI Layer
    subgraph "Console UI Layer"
        direction TB
        Main["Main (Entry Point)"]:::ui
        AdminUI["Admin Console UI"]:::ui
        CustomerUI["Customer Console UI"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        direction TB
        MenuService["Menu Service"]:::service
        OrderService["Order Service"]:::service
    end

    %% Model Layer
    subgraph "Model Layer"
        direction TB
        Person["Person"]:::model
        AdminModel["Admin"]:::model
        CustomerModel["Customer"]:::model
        MenuItem["MenuItem"]:::model
        ShopDetails["ShopDetails"]:::model
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        direction TB
        MenuFile[(menu.txt)]:::datastore
        OrderFile[(order.txt)]:::datastore
        CustomerFile[(customer.txt)]:::datastore
    end

    %% UI to Services
    Main -->|"selectAdmin()"| AdminUI
    Main -->|"selectCustomer()"| CustomerUI

    AdminUI -->|"manageMenu()"| MenuService
    AdminUI -->|"generateReport()"| OrderService

    CustomerUI -->|"displayMenu()"| MenuService
    CustomerUI -->|"placeOrder()"| OrderService

    %% Service interactions
    MenuService -->|"readMenu()"| MenuFile
    MenuService -->|"writeMenu()"| MenuFile

    OrderService -->|"updateStock()"| MenuService
    OrderService -->|"writeOrder()"| OrderFile
    OrderService -->|"writeCustomer()"| CustomerFile

    %% Models inheritance
    Person -->|extends| AdminModel
    Person -->|extends| CustomerModel

    %% Service to Models (optional clarity)
    MenuService -->|uses| MenuItem
    OrderService -->|uses| MenuItem
    OrderService -->|uses| ShopDetails

    %% Click Events
    click Main "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Main.java"
    click AdminUI "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Admin.java"
    click CustomerUI "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Customer.java"
    click MenuService "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Menu.java"
    click OrderService "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/TakeOrder.java"
    click Person "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Person.java"
    click AdminModel "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Admin.java"
    click CustomerModel "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/Customer.java"
    click MenuItem "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/MenuItem.java"
    click ShopDetails "https://github.com/abdullahsajid007/automated-coffee-shop-in-java/blob/main/src/ShopDetails.java"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef service fill:#98FB98,stroke:#333,stroke-width:1px
    classDef model fill:#FFFFE0,stroke:#333,stroke-width:1px
    classDef datastore fill:#D3D3D3,stroke:#333,stroke-width:1px,shape:cylinder
```
