# 0x10-z/retrogasteiz architecture

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

- Interactive diagram: https://gitdiagram.com/0x10-z/retrogasteiz
- Repository: https://github.com/0x10-z/retrogasteiz

## Overview

##### Main System Components

A. Client-Side Layer
- Web Components architecture (all components in httpdocs/components)
- Modular structure (httpdocs/modules)
- Instant search functionality
- Project-specific implementations (retrogasteiz, retro-debug)

B. Infrastructure Layer
- Azure Blob Storage for image hosting
- AWS Rekognition for AI vision services
- Nginx web server (noted from nginx.conf)
- Docker containers (evident from Dockerfile presence)

##### Key Architectural Elements to Highlight

**[Client Browser]**

- ▼
**[Nginx Server (Docker Container)]**

- ► [Web Components]
- rs-grid
- rs-image
- rs-search
- ... (other components)

- ► [Core Modules]
- database.js
- history.js
- ... (other modules)

- ► [Azure Blob Storage]
- WebP Images

- ► [AWS Rekognition]
- AI Vision Processing

##### Important Flows

- Image delivery flow (Azure Blob → Client)
- Search functionality (Client-side instant search)
- AI processing flow (AWS Rekognition integration)
- User interaction paths

##### Technical Details

Annotations for:
- W3C standards compliance
- No backend database (static architecture)
- Docker deployment configuration
- Host-based project routing

##### Implementation Notes

Use these visual conventions:

##### Deployment Flow

A separate section showing:
- GitHub Actions workflow
- Docker container build process
- Production deployment path

- Minimal backend requirements
- Heavy client-side processing
- Efficient image delivery
- AI integration for photo analysis

This architecture represents a unique approach to serving historical photo archives with modern web technologies, emphasizing performance and user experience through client-side processing and AI enhancement.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Layer"]
        Browser["Web Browser"]
        
        subgraph Components["Web Components"]
            direction TB
            RSGrid["rs-grid"]:::component
            RSImage["rs-image"]:::component
            RSSearch["rs-search"]:::component
            RSPanel["rs-panel"]:::component
            RSLicense["License Components"]:::component
            RSUI["UI Components"]:::component
        end
        
        subgraph Modules["Core Modules"]
            direction TB
            Database["Database Module"]:::module
            History["History Module"]:::module
            Permalink["Permalink Module"]:::module
            Projects["Projects Module"]:::module
        end
        
        subgraph ProjectImpl["Project Implementations"]
            RetroGasteiz["RetroGasteiz"]:::project
            RetroDebug["RetroDebug"]:::project
        end
    end
    
    subgraph Infrastructure["Infrastructure Layer"]
        direction TB
        Nginx["Nginx Server"]:::infra
        Docker["Docker Container"]:::infra
        
        subgraph Cloud["Cloud Services"]
            direction TB
            Azure["Azure Blob Storage"]:::storage
            AWS["AWS Rekognition"]:::ai
        end
        
        subgraph CICD["CI/CD Pipeline"]
            direction TB
            GithubActions["GitHub Actions"]:::cicd
        end
    end
    
    Browser --> Nginx
    Nginx --> Components
    Components --> Modules
    Modules --> Cloud
    Components --> Cloud
    Cloud --> AWS
    GithubActions --> Docker
    Docker --> Nginx
    
    %% Click Events
    click RSGrid "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/components/rs-grid.js"
    click RSImage "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/components/rs-image.js"
    click RSSearch "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/components/rs-search.js"
    click RSPanel "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/components/rs-panel.js"
    click Database "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/modules/database.js"
    click History "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/modules/history.js"
    click Permalink "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/modules/permalink.js"
    click Projects "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/modules/projects.js"
    click RetroGasteiz "https://github.com/0x10-z/retrogasteiz/tree/develop/httpdocs/retrogasteiz"
    click RetroDebug "https://github.com/0x10-z/retrogasteiz/tree/develop/httpdocs/retro-debug"
    click Docker "https://github.com/0x10-z/retrogasteiz/tree/develop/Dockerfile"
    click Nginx "https://github.com/0x10-z/retrogasteiz/blob/develop/nginx.conf"
    click GithubActions "https://github.com/0x10-z/retrogasteiz/blob/develop/.github/workflows/master.yml"
    click RSLicense "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/components/rs-license-cc-by-nc-sa.js"
    click RSUI "https://github.com/0x10-z/retrogasteiz/blob/develop/httpdocs/components/rs-loading.js"
    
    %% Styles
    classDef component fill:#3498db,stroke:#2980b9,color:white
    classDef module fill:#2ecc71,stroke:#27ae60,color:white
    classDef project fill:#9b59b6,stroke:#8e44ad,color:white
    classDef infra fill:#34495e,stroke:#2c3e50,color:white
    classDef storage fill:#e67e22,stroke:#d35400,color:white
    classDef ai fill:#e74c3c,stroke:#c0392b,color:white
    classDef cicd fill:#f1c40f,stroke:#f39c12,color:black
    
    %% Legend
    subgraph Legend
        L1["Web Components"]:::component
        L2["Core Modules"]:::module
        L3["Projects"]:::project
        L4["Infrastructure"]:::infra
        L5["Storage"]:::storage
        L6["AI Services"]:::ai
        L7["CI/CD"]:::cicd
    end
```
