# php-coder/mystamps architecture

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

- Interactive diagram: https://gitdiagram.com/php-coder/mystamps
- Repository: https://github.com/php-coder/mystamps

## Overview

##### Main Components Overview
The system should be represented as a multi-tier application with these key components:

a. Client Layer:
- Web Browsers
- React Components (src/main/frontend/src/components)
- Static Resources (CSS, JavaScript)

b. Application Layer:
- Spring Boot Application
- Feature Modules:
- Account Management
- Category Management
- Collection Management
- Country Management
- Image Management
- Series Management
- Site Management
- Import/Export

c. Data Layer:
- Database (H2/MySQL/PostgreSQL)
- Image Storage (File System/Database)

##### Key Architectural Elements

a. Core Framework Components:
- Spring Security (Authentication/Authorization)
- Spring MVC (Web Layer)
- Thymeleaf (Server-side Templates)
- JdbcTemplate (Data Access)
- Liquibase (Database Migrations)

b. External Integrations:
- Mailgun Service (Email Notifications)
- WireMock (Testing)

**[Web Browsers] → [CDN/Static Assets]**
- ↓
**[Nginx Reverse Proxy]**
- ↓
**[Spring Boot Application]**
- [Security Layer]
- [Web Layer (Controllers)]
- [Service Layer]
- [Data Access Layer]
- [External Services Layer]
- ↓
**[Database Layer]**
**[File Storage]**

##### Important Flows to Highlight

a. Authentication Flow:
- User Registration
- Account Activation
- Login/Logout

b. Core Features Flow:
- Series Management
- Collection Management
- Image Upload/Storage

c. Import/Export Flow:
- Series Import
- Sales Import

##### Additional Elements

- Database migrations path
- Async operations
- Security boundaries
- Caching layers
- Feature toggles (Togglz)

##### Infrastructure Components

- Deployment elements (Ansible/Terraform)
- Monitoring points
- Backup paths

##### Testing Components

- Integration test boundaries
- WireMock interfaces
- Robot Framework test points

Remember to include:
- Version control flow
- CI/CD pipeline
- Backup systems
- Monitoring points
- Security boundaries
- Cache layers
- Feature toggle points
- Database migration paths

This will provide a complete picture of the system's architecture while keeping it manageable and understandable.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Clients
        WB[Web Browsers]:::client
        RC["React Components"]:::client
        SR["Static Resources"]:::client
    end

    subgraph Security
        SS["Spring Security"]:::security
    end

    subgraph "Application Core"
        direction TB
        AC["Account Management"]:::module
        CM["Category Management"]:::module
        CO["Collection Management"]:::module
        CY["Country Management"]:::module
        IM["Image Management"]:::module
        SM["Series Management"]:::module
        ST["Site Management"]:::module
    end

    subgraph "Infrastructure"
        direction TB
        CF["Application Config"]:::infra
        MG["Mailgun Service"]:::external
        WM["WireMock"]:::testing
        TH["Thymeleaf Templates"]:::view
    end

    subgraph "Data Layer"
        direction TB
        JT["JdbcTemplate"]:::data
        LB["Liquibase Migrations"]:::data
        DB[(Database)]:::storage
        IS[(Image Storage)]:::storage
    end

    WB --> SS
    RC --> SS
    SR --> SS

    SS --> AC
    SS --> CM
    SS --> CO
    SS --> CY
    SS --> IM
    SS --> SM
    SS --> ST

    AC --> JT
    CM --> JT
    CO --> JT
    CY --> JT
    IM --> JT
    SM --> JT
    ST --> JT

    JT --> DB
    IM --> IS
    LB --> DB

    AC --> MG
    ST --> WM
    ST --> TH

    %% Component mappings
    click RC "https://github.com/php-coder/mystamps/tree/master/src/main/frontend/src/components/"
    click SR "https://github.com/php-coder/mystamps/tree/master/src/main/webapp/WEB-INF/static/"
    click AC "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/account/"
    click CM "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/category/"
    click CO "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/collection/"
    click CY "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/country/"
    click IM "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/image/"
    click SM "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/series/"
    click ST "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/feature/site/"
    click SS "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/support/spring/security/"
    click LB "https://github.com/php-coder/mystamps/tree/master/src/main/resources/liquibase/"
    click MG "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/support/mailgun/"
    click WM "https://github.com/php-coder/mystamps/tree/master/src/test/wiremock/"
    click TH "https://github.com/php-coder/mystamps/tree/master/src/main/webapp/WEB-INF/views/"
    click CF "https://github.com/php-coder/mystamps/tree/master/src/main/java/ru/mystamps/web/config/"

    classDef client fill:#2374AB
    classDef security fill:#FFD400
    classDef module fill:#41B883
    classDef data fill:#FF7F11
    classDef storage fill:#FF1B1C
    classDef external fill:#666666
    classDef testing fill:#CCCCCC
    classDef view fill:#95B8D1
    classDef infra fill:#4B644A
```
