# thu-master/oop_java_project architecture

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

- Interactive diagram: https://gitdiagram.com/thu-master/oop_java_project
- Repository: https://github.com/thu-master/oop_java_project

## Overview

##### Detailed Component Breakdown

A. User Management Subsystem (Left Side):
- Components for:
- User (base class)
- Admin
- Manager
- Employee
- To User_Management.java as the controller

B. Bookstore Operations Subsystem (Right Side):
- Components for:
- Product (base class)
- Book
- Bill
- Discount
- DiscountManager
- Relationships between these classes

##### Data Flow Representation

- User authentication flow
- Book management operations
- Approval workflows
- Data persistence operations

##### Storage Integration

Connections to file storage:
- -NV.txt (Employee data)
- approval_history.txt (Approval logs)
- sach.txt (Book inventory)
- invoices.txt (Sales records)
- discounts.txt (Discount information)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[("SMB - System for Managing Bookstore")]:::title

    %% User Interface Layer
    subgraph UI["User Interface Layer"]
        CLI["Command Line Interface"]
    end

    %% Business Logic Layer
    subgraph BL["Business Logic Layer"]
        subgraph UMS["User Management System"]
            User["User Base Class"]:::user
            Admin["Admin"]:::user
            Manager["Manager"]:::user
            Employee["Employee"]:::user
            UserMgmt["User Management"]:::user
            SysMgr["System Manager"]:::user

            User --> Admin
            User --> Manager
            User --> Employee
            UserMgmt --> User
            SysMgr --> UserMgmt
        end

        subgraph OPS["Bookstore Operations"]
            Product["Product Base Class"]:::ops
            Book["Book"]:::ops
            Bill["Bill"]:::ops
            Discount["Discount"]:::ops
            DiscountMgr["Discount Manager"]:::ops

            Product --> Book
            DiscountMgr --> Discount
            Bill --> Book
            Bill --> Discount
        end
    end

    %% Data Storage Layer
    subgraph DS["Data Storage Layer"]
        UserData["List-NV.txt"]:::storage
        ApprovalData["approval_history.txt"]:::storage
        BookData["sach.txt"]:::storage
        DiscountData["discounts.txt"]:::storage
        InvoiceData["invoices.txt"]:::storage
    end

    %% Connections
    CLI --> SysMgr
    CLI --> OPS
    UserMgmt -.-> UserData
    Book -.-> BookData
    Discount -.-> DiscountData
    Bill -.-> InvoiceData
    SysMgr -.-> ApprovalData

    %% Main Entry Point
    MainApp["Main Application"]:::entry
    MainApp --> CLI

    %% Click Events
    click User "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Decentralization/User.java"
    click Admin "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Decentralization/Admin.java"
    click Manager "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Decentralization/Manager.java"
    click Employee "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Decentralization/Employee.java"
    click UserMgmt "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Decentralization/User_Management.java"
    click SysMgr "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Decentralization/SystemManager.java"
    click UMS "https://github.com/Thu-master/OOP_Java_Project/tree/master/src/Decentralization/"
    click Product "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Funtion/Product.java"
    click Book "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Funtion/Book.java"
    click Bill "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Funtion/Bill.java"
    click Discount "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Funtion/Discount.java"
    click DiscountMgr "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/Funtion/DiscountManager.java"
    click OPS "https://github.com/Thu-master/OOP_Java_Project/tree/master/src/Funtion/"
    click MainApp "https://github.com/Thu-master/OOP_Java_Project/blob/master/src/oop_java_project/OOP_Java_Project.java"
    click UserData "https://github.com/Thu-master/OOP_Java_Project/blob/master/List-NV.txt"
    click ApprovalData "https://github.com/Thu-master/OOP_Java_Project/blob/master/approval_history.txt"
    click BookData "https://github.com/Thu-master/OOP_Java_Project/blob/master/sach.txt"
    click DiscountData "https://github.com/Thu-master/OOP_Java_Project/blob/master/discounts.txt"
    click InvoiceData "https://github.com/Thu-master/OOP_Java_Project/blob/master/invoices.txt"

    %% Styles
    classDef title fill:#f9f,stroke:#333,stroke-width:4px
    classDef user fill:#ffb366,stroke:#333
    classDef ops fill:#b366ff,stroke:#333
    classDef storage fill:#ffff99,stroke:#333
    classDef entry fill:#66b3ff,stroke:#333

    %% Legend
    subgraph Legend
        L1["User Management"]:::user
        L2["Bookstore Operations"]:::ops
        L3["Data Storage"]:::storage
        L4["Entry Point"]:::entry
    end
```
