# ahmedmbutt/supermarketmanagementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedmbutt/supermarketmanagementsystem
- Repository: https://github.com/ahmedmbutt/supermarketmanagementsystem

## Overview

##### Main Components

a. Presentation Layer (GUI Components):
- Login Form
- Admin Form
- Selling Form
- Start Form

b. Business Logic Layer:
- ProductManager
- SellerManager
- Main Supermarket class

c. Data Persistence Layer:
- File Storage:
- Seller.txt
- table.txt
- temp.txt

##### Component Relationships

**[Presentation Layer]**
- ↕
**[Business Logic Layer]**
- ↕
**[Data Layer]**

##### Specific Design Elements

- Rectangles: GUI Forms
- Rounded Rectangles: Manager Classes
- Diamonds: Main Application Class

- Blue: GUI Components
- Green: Business Logic
- Yellow: Data Storage
- Red: Main Application Entry Point

##### Detailed Component Breakdown

GUI Layer:
**[Login Form] ← → [Start Form] ← → [Admin Form]**
- ↓
- [Selling Form]

Business Layer:
**[ProductManager] ← → [SellerManager]**
- ↓                  ↓
- (File Access)     (File Access)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[Supermarket Management System]
    style title fill:#f9f,stroke:#333,stroke-width:4px

    %% Layers
    subgraph PresentationLayer[Presentation Layer]
        Login["Login Form"]:::gui
        Admin["Admin Form"]:::gui
        Selling["Selling Form"]:::gui
        Start["Start Form"]:::gui
    end

    subgraph BusinessLayer[Business Logic Layer]
        Supermarket["Supermarket"]:::main
        ProductMgr["Product Manager"]:::business
        SellerMgr["Seller Manager"]:::business
    end

    subgraph DataLayer[Data Layer]
        SellerFile[(Seller.txt)]:::storage
        TableFile[(table.txt)]:::storage
        TempFile[(temp.txt)]:::storage
    end

    %% Relationships
    Supermarket --> Login
    Login --> Start
    Start --> Admin
    Start --> Selling
    
    Admin --> ProductMgr
    Admin --> SellerMgr
    Selling --> ProductMgr
    
    ProductMgr --> TableFile
    ProductMgr --> TempFile
    SellerMgr --> SellerFile

    %% Click Events
    click Login "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/Login.java"
    click Admin "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/Admin.java"
    click Selling "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/Selling.java"
    click Start "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/Start.java"
    click ProductMgr "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/ProductManager.java"
    click SellerMgr "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/SellerManager.java"
    click Supermarket "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/src/supermarket/Supermarket.java"
    click SellerFile "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/Seller.txt"
    click TableFile "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/table.txt"
    click TempFile "https://github.com/ahmedmbutt/SuperMarketManagementSystem/blob/main/temp.txt"

    %% Styles
    classDef gui fill:#3498db,stroke:#2980b9,color:white
    classDef business fill:#2ecc71,stroke:#27ae60,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:black
    classDef main fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        GUI["GUI Component"]:::gui
        Business["Business Logic"]:::business
        Storage["Data Storage"]:::storage
        Main["Main Application"]:::main
    end
```
