# nobodyyon/metricscrud architecture

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

- Interactive diagram: https://gitdiagram.com/nobodyyon/metricscrud
- Repository: https://github.com/nobodyyon/metricscrud

## Overview

##### Project type and purpose
- This is a standalone Java CRUD application called “MetricsCRUD,” using JSON files for data storage.
- It implements basic client and product management (create, read, update, delete) via a console/menu-driven UI.

##### File structure
- Top level:
- Main.java – entry point
- libs/gson-2.13.1.jar – JSON serialization library
- json/… – data storage (clientes.json, productos.json)
- src/DAO – persistence layer (ClienteDAO, ProductoDAO, JsonUtil)
- src/controlador – business logic layer (ClienteControlador, ProductoControlador, MenuControlador)
- src/modelo – domain model classes (Cliente, Producto)
- src/vista – presentation layer (ClienteVista, ProductoVista, MenuGeneral)
- No separate frontend/backend services—everything runs in one JVM (monolithic).

##### README for additional insights
- The README only gives the project name, so our best clues come from code and folder names.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Entry Point"
        Main["Main.java"]:::entry
    end

    subgraph "Presentation Layer"
        MG["MenuGeneral.java"]:::view
        CV["ClienteVista.java"]:::view
        PV["ProductoVista.java"]:::view
    end

    subgraph "Controller Layer"
        MC["MenuControlador.java"]:::controller
        CC["ClienteControlador.java"]:::controller
        PC["ProductoControlador.java"]:::controller
    end

    subgraph "Model Layer"
        MCliente["Cliente.java"]:::model
        MProducto["Producto.java"]:::model
    end

    subgraph "Persistence Layer (DAO)"
        DAO1["ClienteDAO.java"]:::dao
        DAO2["ProductoDAO.java"]:::dao
    end

    subgraph "Utility"
        JsonU["JsonUtil.java"]:::util
    end

    subgraph "External Library"
        Gson["gson-2.13.1.jar"]:::external
    end

    subgraph "Storage (JSON Files)"
        JSON1["clientes.json"]:::storage
        JSON2["productos.json"]:::storage
    end

    %% Interactions
    Main -->|"init MenuControlador() "| MC
    MC -->|"showMenu()"| MG
    MG -->|"user input"| MC
    MC -->|"route to Cliente"| CC
    MC -->|"route to Producto"| PC

    CC -->|"display cliente menu"| CV
    PC -->|"display producto menu"| PV

    CC -->|"getAll()/save()/update()/delete()"| DAO1
    PC -->|"getAll()/save()/update()/delete()"| DAO2

    DAO1 -->|"read/write JSON"| JsonU
    DAO2 -->|"read/write JSON"| JsonU

    JsonU -->|"serialize/deserialize"| Gson
    JsonU -->|"file read/write"| JSON1
    JsonU -->|"file read/write"| JSON2

    JSON1 -->|"data"| JsonU
    JSON2 -->|"data"| JsonU

    JsonU -->|"model objects"| DAO1
    JsonU -->|"model objects"| DAO2

    DAO1 -->|"Cliente objects"| CC
    DAO2 -->|"Producto objects"| PC

    CC -->|"model data"| CV
    PC -->|"model data"| PV

    %% Click Events
    click Main "https://github.com/nobodyyon/metricscrud/blob/main/Main.java"
    click Gson "https://github.com/nobodyyon/metricscrud/blob/main/libs/gson-2.13.1.jar"
    click JSON1 "https://github.com/nobodyyon/metricscrud/blob/main/json/clientes.json"
    click JSON2 "https://github.com/nobodyyon/metricscrud/blob/main/json/productos.json"
    click JsonU "https://github.com/nobodyyon/metricscrud/blob/main/src/DAO/JsonUtil.java"
    click DAO1 "https://github.com/nobodyyon/metricscrud/blob/main/src/DAO/ClienteDAO.java"
    click DAO2 "https://github.com/nobodyyon/metricscrud/blob/main/src/DAO/ProductoDAO.java"
    click MC "https://github.com/nobodyyon/metricscrud/blob/main/src/controlador/MenuControlador.java"
    click CC "https://github.com/nobodyyon/metricscrud/blob/main/src/controlador/ClienteControlador.java"
    click PC "https://github.com/nobodyyon/metricscrud/blob/main/src/controlador/ProductoControlador.java"
    click MG "https://github.com/nobodyyon/metricscrud/blob/main/src/vista/MenuGeneral.java"
    click CV "https://github.com/nobodyyon/metricscrud/blob/main/src/vista/ClienteVista.java"
    click PV "https://github.com/nobodyyon/metricscrud/blob/main/src/vista/ProductoVista.java"
    click MCliente "https://github.com/nobodyyon/metricscrud/blob/main/src/modelo/Cliente.java"
    click MProducto "https://github.com/nobodyyon/metricscrud/blob/main/src/modelo/Producto.java"

    %% Styles
    classDef entry fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef view fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef controller fill:#90EE90,stroke:#333,stroke-width:1px
    classDef model fill:#FFC0CB,stroke:#333,stroke-width:1px
    classDef dao fill:#FFA500,stroke:#333,stroke-width:1px
    classDef util fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#EEEEEE,stroke:#333,stroke-width:1px
    classDef storage fill:#FFFF99,stroke:#333,stroke-width:1px
```
