# shadowz-git/gestonino architecture

> Architecture diagram of the GitHub repository shadowz-git/gestonino, 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/shadowz-git/gestonino
- Repository: https://github.com/shadowz-git/gestonino

## Overview

##### Project Type & Purpose
- This is a full-stack application that supports management functionalities (as suggested by components such as “gestionale”, “product”, “category”, “activity”) for various user types (e.g., pizzeria, supermercato, palestra, etc.).
- The backend is built in Java (likely using Spring Boot judging by the structure and configuration files) and manages the core business logic, security, and database interactions.
- The frontend is built using Angular and provides a user interface that includes features such as authentication, product or inventory management, data visualization (dashboard charts), and even mapping.

##### Analyzing the File Structure
- Backend:
- The backend directory is structured in the standard Maven style (pom.xml, mvnw, src/main/java, etc.), with packages for controllers, security configurations (CorsConfig, SecurityConfig, WebConfig), models (domain objects, exceptions, request objects) and services.
- Controllers (ActivityController, AuthController, CategoryController, etc.) form the presentation layer handling HTTP requests.
- Service classes (ActivityService, AuthService, etc.) encapsulate business logic.
- Repositories (ActivityRepository, UserRepository, etc.) suggest that the application uses a persistence layer, likely connected to an SQL database (gestonino.db).
- Configuration files (application.properties) and static resources indicate there is also a delivery of static content possibly for a fallback or initial page.

- Frontend:
- The frontend directory is structured as an Angular CLI project, with a clear pattern of separation among different modules/components (e.g., auth, home, map, notification, and a more specialized “gestionale” section).
- Angular routing is evident (app.routes.ts, auth.routes.ts, gestionale.routes.ts) showing that the application navigates between distinct areas.
- Components are organized in folders with clear naming (e.g., header, footer, dashboard, dialogs) which implies robust UI modularity.
- Services declared in the frontend (auth.service, product.service, map.service, etc.) suggest that the frontend communicates with the backend over RESTful APIs.

##### Final Steps
- Layers appropriately—frontend calls to backend APIs, backend calls for data persistence.
- Double-check that all relevant components that you derived from the file tree and README are captured.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (Angular Client)"
        FSF["Full-Stack Frontend"]:::frontend
        AA["Angular Authentication Module"]:::frontend
        AAS["Auth Service"]:::frontend
        AG["Angular Gestionale Module"]:::frontend
        GGComp["Gestionale Components"]:::frontend
        GGDash["Gestionale Dashboard"]:::frontend
        GGInv["Gestionale Inventory"]:::frontend
        AM["Angular Map Component"]:::frontend
        AN["Angular Notification Component"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend (Java/Maven)"
        BE["Backend Application Entry Point"]:::backend
        AC["API Controllers"]:::backend
        SC["Security & Config"]:::backend
        BS["Business Services"]:::backend
        RP["Repositories"]:::backend
        DM["Database Manager"]:::backend
        SR["Static Resources"]:::backend
    end

    %% Database Layer
    subgraph "Database"
        DB["gestonino.db"]:::database
    end

    %% Frontend Internal Structure
    FSF --> AA
    FSF --> AG
    FSF --> AM
    FSF --> AN
    AA --> AAS

    %% Frontend to Backend Interactions
    AA -->|"RESTCall"| AC
    AG -->|"RESTCall"| AC
    AM -->|"RESTCall"| AC
    AN -->|"RESTCall"| AC

    %% Backend Process Flow
    BE -->|"starts"| AC
    SC -->|"secures"| AC
    AC -->|"invokes"| BS
    BS -->|"processes"| RP
    BS -->|"uses"| DM
    RP -->|"queries"| DB
    DM -->|"manages"| DB
    BE --> SR

    %% Gestionale Module Detailed Structure
    AG --> GGComp
    AG --> GGDash
    AG --> GGInv

    %% Click Events for Frontend Components
    click FSF "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app"
    click AA "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/auth"
    click AAS "https://github.com/shadowz-git/gestonino/blob/main/frontend/src/app/services/auth.service.ts"
    click AG "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/gestionale"
    click GGComp "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/gestionale/components"
    click GGDash "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/gestionale/dashboard"
    click GGInv "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/gestionale/inventory"
    click AM "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/map"
    click AN "https://github.com/shadowz-git/gestonino/tree/main/frontend/src/app/notification"

    %% Click Events for Backend Components
    click BE "https://github.com/shadowz-git/gestonino/blob/main/backend/src/main/java/com/gestonino/backend/BackendApplication.java"
    click AC "https://github.com/shadowz-git/gestonino/tree/main/backend/src/main/java/com/gestonino/backend/controllers"
    click SC "https://github.com/shadowz-git/gestonino/blob/main/backend/src/main/java/com/gestonino/backend/CorsConfig.java"
    click BS "https://github.com/shadowz-git/gestonino/tree/main/backend/src/main/java/com/gestonino/backend/model/services"
    click RP "https://github.com/shadowz-git/gestonino/tree/main/backend/src/main/java/com/gestonino/backend/model/dao"
    click DM "https://github.com/shadowz-git/gestonino/blob/main/backend/src/main/java/com/gestonino/backend/model/db/DatabaseManager.java"
    click SR "https://github.com/shadowz-git/gestonino/tree/main/backend/src/main/resources/static"

    %% Click Event for Database
    click DB "https://github.com/shadowz-git/gestonino/blob/main/backend/gestonino.db"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef database fill:#F9E79F,stroke:#B9770E,stroke-width:2px;
```
