# fuongz/image-proxy architecture

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

- Interactive diagram: https://gitdiagram.com/fuongz/image-proxy
- Repository: https://github.com/fuongz/image-proxy

## Overview

##### Main Components Identification
The system consists of these primary components:

a) API Service (FastAPI Backend):
- Image Processing Service
- File Handling Service
- Configuration Management
- CORS Handler

b) Frontend Landing Page:
- React/TypeScript Application
- User Interface
- API Integration

c) Infrastructure:
- Kubernetes Deployment
- Docker Container
- CI/CD Pipeline

**┌─────────────────────────────────────────┐**
- Image Proxy Service          │
- ┬───────────────────┤
- FastAPI Backend   │  Landing Frontend │
- ┴───────────────────┘

**Client Request → CORS Handler → Image Processor → Response**

##### Component Details

- Request Handler (FastAPI)
- Image Processing Service (Pillow)
- File Handler
- Configuration Manager

- React/TypeScript UI
- API Integration Layer

- Kubernetes Deployment
- Docker Container
- GitHub Actions CI/CD

##### Specific Implementation Details

- Rectangles: Main services
- Hexagons: Processing modules
- Clouds: External services/clients

- Blue: Backend services
- Green: Frontend components
- Gray: Infrastructure
- Orange: Processing modules

##### Key Relationships to Highlight

- HTTP requests flow
- Image processing pipeline
- CORS handling
- Service interactions

##### Technical Specifications to Note

Technical details:
- FastAPI endpoints
- Supported image formats
- Size limitations
- Timeout configurations

##### Deployment Flow

Deployment pipeline:
**GitHub → GitHub Actions → Docker Build → Kubernetes Deploy**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        C[Client Request]
    end

    subgraph "Core Services"
        subgraph "FastAPI Backend"
            FH["FastAPI Handler"]:::backend
            CH["CORS Handler"]:::backend
            IP["Image Processor"]:::processor
            FHS["File Handler"]:::backend
            CM["Config Manager"]:::backend
        end

        subgraph "Frontend Layer"
            UI["React UI"]:::frontend
            API["API Integration"]:::frontend
            CSS["Styling"]:::frontend
        end
    end

    subgraph "Infrastructure"
        K8S["Kubernetes"]:::infra
        DOCKER["Docker Container"]:::infra
        CICD["GitHub Actions"]:::infra
    end

    C --> CH
    CH --> FH
    FH --> IP
    IP --> FHS
    FH --> CM
    
    UI --> API
    API --> CH
    UI --> CSS

    CICD --> DOCKER
    DOCKER --> K8S

    %% Click Events
    click FH "https://github.com/fuongz/image-proxy/blob/main/app/main.py"
    click CM "https://github.com/fuongz/image-proxy/blob/main/app/config.py"
    click IP "https://github.com/fuongz/image-proxy/blob/main/app/utils/image.py"
    click FHS "https://github.com/fuongz/image-proxy/blob/main/app/utils/file.py"
    click UI "https://github.com/fuongz/image-proxy/blob/main/landing/src/App.tsx"
    click API "https://github.com/fuongz/image-proxy/blob/main/landing/src/main.tsx"
    click CSS "https://github.com/fuongz/image-proxy/blob/main/landing/src/App.css"
    click K8S "https://github.com/fuongz/image-proxy/blob/main/.k8s/kubernetes.yaml"
    click DOCKER "https://github.com/fuongz/image-proxy/tree/main/Dockerfile"
    click CICD "https://github.com/fuongz/image-proxy/blob/main/.github/workflows/publish.yml"

    %% Styles
    classDef backend fill:#2374ab
    classDef processor fill:#ff7f50
    classDef frontend fill:#4CAF50
    classDef infra fill:#607d8b
    
    %% Legend
    subgraph Legend
        L1["Backend Service"]:::backend
        L2["Processing Module"]:::processor
        L3["Frontend Component"]:::frontend
        L4["Infrastructure"]:::infra
    end
```
