# tnoob-dev/ds-menu architecture

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

- Interactive diagram: https://gitdiagram.com/tnoob-dev/ds-menu
- Repository: https://github.com/tnoob-dev/ds-menu

## Overview

##### Main Components
- Data Sources:
- Data files within "notebook/src/files" (this includes the "helps" folder, with "lha.geojson" and "municipalities.json", and the "restaurants" folder with subdirectories for various regions containing "data.json" files).
- Processing & Utility Modules:
- The "notebook/src/utils" folder contains modules such as filesManagement.py, funcs.py, and graphs.py. These serve as the core processing units that:
▫ Load and manage file data.
▫ Process data (e.g., filtering, cleaning).
▫ Generate and manage visualizations.
- Interactive Notebook:
- "notebook/main.ipynb" acts as the main user interface where the analysis is conducted, combining data ingestion, processing, and visualization.
- Dependencies & Environment:
- The "requirements.txt" file suggests external libraries used (likely for data processing, geospatial analysis, and plotting).

##### Component Relationships and Data Flow
- The Data Sources provide the raw input (static files in JSON and GeoJSON) which the utility modules ingest and process.
- The Jupyter Notebook ties everything together by orchestrating the data ingestion, processing, and visualization tasks using these utilities.
- Data flow from Data Sources to the utility modules.
- Then from utility modules into the Notebook for final analysis and display.

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- Data ingestion and processing is separated in dedicated utility modules, while the Notebook is focused on the high-level orchestration and visualization.
- Modular Design:
- Data Flow Pipeline:
- Flow starting from raw data files -> processing modules -> interactive analysis in the Notebook.

##### Instructing the Principal Software Engineer
- A block for Data Sources (showing a subcomponent for "restaurants data" and another for "geo and municipalities data").
- Optionally, add a block or note for the “Dependencies/Environment” (e.g., Python packages defined in requirements.txt).
Data Sources → Utility Modules → Jupyter Notebook.
- Details indicating major files or subcomponents (like the restaurant regional sub-directories under “restaurants”, and the geo data in “helps”) are mentioned as needed for clarity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Sources"
        GD["Geo & Municipal Data"]:::data
        RD["Restaurants Data"]:::data
    end

    subgraph "Processing & Utility Modules"
        FM["File Management"]:::utility
        Func["Functions"]:::utility
        G["Graphs"]:::utility
    end

    subgraph "Interactive Notebook"
        JN["Main Analysis Interface"]:::notebook
    end

    dep["Dependencies & Environment"]:::dependencies

    %% Data Sources to Utility Modules
    GD -->|"provides"| FM
    GD -->|"provides"| Func
    GD -->|"provides"| G

    RD -->|"provides"| FM
    RD -->|"provides"| Func
    RD -->|"provides"| G

    %% Utility Modules to Notebook
    FM -->|"processes"| JN
    Func -->|"processes"| JN
    G -->|"visualizes"| JN

    %% Dependencies to Utility Modules and Notebook
    dep -->|"supports"| FM
    dep -->|"supports"| Func
    dep -->|"supports"| G
    dep -->|"supports"| JN

    %% Click Events
    click GD "https://github.com/tnoob-dev/ds-menu/tree/master/notebook/src/files/helps"
    click RD "https://github.com/tnoob-dev/ds-menu/tree/master/notebook/src/files/restaurants"
    click FM "https://github.com/tnoob-dev/ds-menu/blob/master/notebook/src/utils/filesManagement.py"
    click Func "https://github.com/tnoob-dev/ds-menu/blob/master/notebook/src/utils/funcs.py"
    click G "https://github.com/tnoob-dev/ds-menu/blob/master/notebook/src/utils/graphs.py"
    click JN "https://github.com/tnoob-dev/ds-menu/blob/master/notebook/main.ipynb"
    click dep "https://github.com/tnoob-dev/ds-menu/blob/master/requirements.txt"

    %% Styles
    classDef data fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef utility fill:#A9DFBF,stroke:#239B56,stroke-width:2px;
    classDef notebook fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef dependencies fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
```
