# wiggle22/store_mng_app architecture

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

- Interactive diagram: https://gitdiagram.com/wiggle22/store_mng_app
- Repository: https://github.com/wiggle22/store_mng_app

## Overview

##### Main Components
- Application Logic: At the core is the module represented by mng_app.cpp along with its header mng_app.h. This component encapsulates the essential business logic for phone store management.
- Data Interaction: Two files (category.txt and customerdata.txt) are used as data repositories. They represent the persistent storage for product categories and customer-related data.
- Utility Module: The file format.cpp indicates additional functionality such as formatting or processing data that might be used by the main application logic.
- Build & Debug Tools: The Makefile outlines procedures for compiling, cleaning, and debugging the application, emphasizing how the app is built and maintained.
- User Interface: Though not a separate GUI module, the application is intended to be used via the command-line (as inferred by terminal commands in the README).

##### Relationships and Interactions
- The User (via CLI) launches the application, which triggers the execution of the main application (mng_app.cpp).
- The core application interacts with the text files (category.txt and customerdata.txt) for reading and updating store data.
- format.cpp is utilized by mng_app.cpp to perform any specialized formatting or pre/post-processing operations.
- The Makefile orchestrates the build process, ensuring that changes in the source files compile into the final executable, and also supports debugging functionalities (via “make debug”).

##### Architectural Patterns and Design Principles
- Separation of Concerns: Even in a small code base, the project separates core logic (mng_app.*) from data storage (the text files) and from any utility functions (format.cpp).
- Simplicity and Modularity: The design emphasizes straightforward file operations and logic handling, without the overhead of a complex multi-layered architecture.
- Build Process Integration: Use of a Makefile to manage compilation, cleaning, and debugging indicates good automatic build and maintenance practices.

##### Relevant Technologies/Frameworks
- C++ is the main programming language.
- The build system is based on GNU Make.
- GDB is referenced for debugging operations.

- User/CLI Interface (entry point)
- Utility Functions (format.cpp)
- Build & Debug System (Makefile with annotations for “make”, “make clean”, and “make debug”)
- Data flow from the User to the Application Logic.
- Interaction from the Application Logic to Data Files during read/write operations.
- Utilization of the Utility Module by the Application Logic.
- The relationship between the Makefile and the source code components.
- Clear labels to each component.

## Diagram (Mermaid)

```mermaid
flowchart TD
    CLI["User/CLI Interface"]:::cli
    subgraph "Phone Store Management Engine"
        EngineCPP["mng_app.cpp"]:::logic
        EngineHeader["mng_app.h"]:::logic
    end
    Utility["format.cpp"]:::utility
    subgraph "Data Files"
        Category["category.txt"]:::data
        Customer["customerdata.txt"]:::data
    end
    Makefile["Makefile"]:::build

    CLI -->|"launches"| EngineCPP
    EngineCPP -->|"calls_formatting"| Utility
    EngineCPP -->|"read_write"| Category
    EngineCPP -->|"read_write"| Customer
    Makefile -->|"builds"| EngineCPP
    Makefile -->|"builds"| Utility

    click EngineCPP "https://github.com/wiggle22/store_mng_app/blob/main/mng_app.cpp"
    click EngineHeader "https://github.com/wiggle22/store_mng_app/blob/main/mng_app.h"
    click Utility "https://github.com/wiggle22/store_mng_app/blob/main/format.cpp"
    click Category "https://github.com/wiggle22/store_mng_app/blob/main/category.txt"
    click Customer "https://github.com/wiggle22/store_mng_app/blob/main/customerdata.txt"
    click Makefile "https://github.com/wiggle22/store_mng_app/tree/main/Makefile"

    classDef cli fill:#ffd700,stroke:#333,stroke-width:2px;
    classDef logic fill:#87cefa,stroke:#333,stroke-width:2px;
    classDef utility fill:#98fb98,stroke:#333,stroke-width:2px;
    classDef data fill:#f08080,stroke:#333,stroke-width:2px;
    classDef build fill:#dda0dd,stroke:#333,stroke-width:2px;
```
