# jesus2421/natura architecture

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

- Interactive diagram: https://gitdiagram.com/jesus2421/natura
- Repository: https://github.com/jesus2421/natura

## Overview

##### Project type and purpose
- This is a Java-based desktop application (packaged as Natura.jar) designed to simulate and manage inventory flows for businesses.
- It uses NetBeans-generated Swing forms for its GUI (under `src/interfacez`) and contains core simulation and domain logic under `src/natura`.

##### File structure
- Top-level sources live in `src/`:
- `src/interfacez/`: Swing UI forms and controllers (`natura.java`, `Resultados.java`, etc.).
- `src/natura/`: Domain classes (`Inventario.java`, `demanda.java`, `entrega.java`).
- Build metadata in `nbproject/` and `build.xml` supports an Ant-based build.
- The output is a self-contained JAR (`dist/Natura.jar`).

##### README
- Confirms it’s a standalone Java application requiring only the JRE.
- Describes high-level features: automated inventory management, simulation of stock flows, real-time reports.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Deployment Artifact and Environment
    subgraph "Deployment"
        JAR["Natura.jar"]:::deploy
    end
    JAR -->|"runs on"| JRE["Java Runtime Environment (JRE)"]:::env

    %% Application Layers within JAR
    subgraph "Natura.jar Contents"
        direction TB

        subgraph "Presentation Layer"
            direction TB
            MainWindow["Main Window\n(natura.java)"]:::presentation
            SimulationDialog["Simulation Input Dialog\n(datosdelasimulacion.java)"]:::presentation
            ResultsView["Results View\n(Resultados.java)"]:::presentation
            UIForms["UI Form Definitions\n(*.form)"]:::presentation
        end

        subgraph "Business Logic Layer"
            direction TB
            SimulationEngine["Simulation Engine\n(coordinator)"]:::logic
            DemandModel["Demand Event Model\n(demanda.java)"]:::logic
            ReplenishModel["Replenishment Event Model\n(entrega.java)"]:::logic
        end

        subgraph "Data Model Layer"
            direction TB
            InventoryModel["Inventory Model\n(Inventario.java)"]:::data
        end
    end

    %% Build & Packaging
    subgraph "Build & Packaging"
        direction TB
        AntBuild["Ant Build Script\n(build.xml)"]:::build
        NBProj["NetBeans Project Metadata\n(nbproject/)"]:::build
    end
    AntBuild -->|produces| JAR
    NBProj -->|configures| AntBuild

    %% Data Flows
    MainWindow -->|"startSimulation(params)"| SimulationEngine
    SimulationDialog -->|collects params| SimulationEngine
    SimulationEngine -->|"updateStock()"| InventoryModel
    SimulationEngine -->|"generateDemand()"| DemandModel
    SimulationEngine -->|"generateReplenishment()"| ReplenishModel
    SimulationEngine -->|"getResults()"| ResultsView

    %% Click Events
    click MainWindow "https://github.com/jesus2421/natura/blob/master/src/interfacez/natura.java"
    click SimulationDialog "https://github.com/jesus2421/natura/blob/master/src/interfacez/datosdelasimulacion.java"
    click ResultsView "https://github.com/jesus2421/natura/blob/master/src/interfacez/Resultados.java"
    click UIForms "https://github.com/jesus2421/natura/blob/master/src/interfacez/*.form"
    click InventoryModel "https://github.com/jesus2421/natura/blob/master/src/natura/Inventario.java"
    click DemandModel "https://github.com/jesus2421/natura/blob/master/src/natura/demanda.java"
    click ReplenishModel "https://github.com/jesus2421/natura/blob/master/src/natura/entrega.java"
    click AntBuild "https://github.com/jesus2421/natura/blob/master/build.xml"
    click NBProj "https://github.com/jesus2421/natura/tree/master/nbproject/"
    click JAR "https://github.com/jesus2421/natura/blob/master/dist/Natura.jar"

    %% Styles
    classDef presentation fill:#AED6F1,stroke:#2980B9,color:#154360
    classDef logic fill:#ABEBC6,stroke:#27AE60,color:#1E5128
    classDef data fill:#F9E79F,stroke:#F1C40F,color:#7D6608
    classDef build fill:#D7DBDD,stroke:#7F8C8D,color:#424949
    classDef deploy fill:#E8DAEF,stroke:#8E44AD,color:#4A235A
    classDef env fill:#F4F6F6,stroke:#BDC3C7,color:#566573
```
