# unim0cha/inhatc-spring architecture

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

- Interactive diagram: https://gitdiagram.com/unim0cha/inhatc-spring
- Repository: https://github.com/unim0cha/inhatc-spring

## Overview

##### Main Components Identification

The system is a Spring Boot e-commerce application with the following core components:

a. Presentation Layer:
- Web Controllers (MVC pattern)
- Thymeleaf templates for views
- Static resources (CSS)

b. Application Layer:
- Services for business logic
- DTOs for data transfer
- Security configuration
- File handling services

c. Domain Layer:
- Entity models
- Business logic
- Domain-specific constants

d. Infrastructure Layer:
- Repositories
- Configuration
- Security
- Audit functionality

##### Component Relationships

- User requests flow from client to controllers
- Controller interactions with services
- Service interactions with repositories
- Data flow between layers
- Security filter chain flow

##### Additional Details

Annotations for:
- Security boundaries
- External service integrations
- Database interactions
- File storage
- Authentication flow

##### Technical Stack Indicators

Technology labels:
- Spring Boot
- Spring Security
- Spring Data JPA
- Thymeleaf
- H2/MySQL Database
- Maven

- The overall system architecture
- Component interactions
- Data flow
- Security boundaries
- Technical stack implementation

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph Clients
        Browser["Web Browser"]
        Mobile["Mobile Device"]
    end

    %% Presentation Layer
    subgraph WebLayer["Web Layer"]
        Controllers["Controllers"]:::controller
        Templates["Thymeleaf Templates"]:::template
        Static["Static Resources"]:::static
    end

    %% Application Layer
    subgraph ServiceLayer["Service Layer"]
        Services["Business Services"]:::service
        Security["Security Components"]:::security
        FileHandler["File Handling Service"]:::service
    end

    %% Domain Layer
    subgraph DomainLayer["Domain Layer"]
        Entities["Domain Entities"]:::domain
        DTOs["Data Transfer Objects"]:::domain
        Constants["Domain Constants"]:::domain
    end

    %% Data Access Layer
    subgraph DataLayer["Data Access Layer"]
        Repos["Repositories"]:::repository
        DB[(Database)]:::database
    end

    %% Relationships
    Browser --> Controllers
    Mobile --> Controllers
    Controllers --> Templates
    Controllers --> Static
    Controllers --> Services
    Services --> Repos
    Services --> FileHandler
    Services --> DTOs
    Services --> Entities
    Repos --> DB
    Security --> Controllers

    %% Click Events
    click Controllers "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/java/com/shop/controller/"
    click Templates "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/resources/templates/"
    click Static "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/resources/static/"
    click Security "https://github.com/UniM0cha/Inhatc-Spring/blob/main/shop-master/src/main/java/com/shop/config/SecurityConfig.java"
    click Services "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/java/com/shop/service/"
    click Entities "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/java/com/shop/entity/"
    click DTOs "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/java/com/shop/dto/"
    click Repos "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/java/com/shop/repository/"
    click Constants "https://github.com/UniM0cha/Inhatc-Spring/tree/main/shop-master/src/main/java/com/shop/constant/"
    click FileHandler "https://github.com/UniM0cha/Inhatc-Spring/blob/main/shop-master/src/main/java/com/shop/service/FileService.java"

    %% Styles
    classDef controller fill:#2196F3,stroke:#1565C0,color:white
    classDef template fill:#4CAF50,stroke:#2E7D32,color:white
    classDef static fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef service fill:#FF9800,stroke:#EF6C00,color:white
    classDef security fill:#F44336,stroke:#C62828,color:white
    classDef domain fill:#FFC107,stroke:#FFA000,color:black
    classDef repository fill:#795548,stroke:#4E342E,color:white
    classDef database fill:#607D8B,stroke:#37474F,color:white

    %% Legend
    subgraph Legend
        L1["Controller"]:::controller
        L2["Template"]:::template
        L3["Service"]:::service
        L4["Domain"]:::domain
        L5["Repository"]:::repository
        L6["Database"]:::database
    end
```
