# andes-hosting/website architecture

> Architecture diagram of the GitHub repository andes-hosting/website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andes-hosting/website
- Repository: https://github.com/andes-hosting/website

## Overview

##### Project Type and Purpose
- From the file tree and minimal README, this is a static single-page application (SPA) built with React (“website-andes-hosting” directory) that is containerized and served via Nginx.
- The repository includes Docker assets (dockerfile, docker-compose.yml), an Nginx configuration, and a GitHub Actions workflow for building and releasing a Docker image.

##### File Structure Analysis
- Top‐level:
– dockerfile & docker-compose.yml → container build and orchestration
– nginx.conf → reverse‐proxy / static file server config
– .github/workflows/publish-image-and-release.yml → CI/CD pipeline
– website-andes-hosting/ → React app (public, src/components, src/pages, utils, tests)
- Patterns:
– SPA frontend only, no backend code
– Componentized UI under src/components and pages
– Static assets in public/ served by Nginx
– Utility scripts (contactoPixel, iniciarPagoPixel) that integrate third-party analytics/payment services

##### README Insights
- No further architectural details beyond “# WebSite,” confirming the repo’s focus on delivering a static React SPA.

a. Main Components
1. Developer (local machine)
2. GitHub Repository
3. CI/CD Pipeline (GitHub Actions)
4. Docker Registry (Docker Hub or GitHub Container Registry)
5. Hosting Environment (VM or Kubernetes cluster)
6. Nginx Container (serving static files)
7. React Application Container (bundled static assets)
8. End User Browser
9. External Services (analytics/payment pixel endpoints)
b. Relationships & Data Flows
- Developer pushes code → triggers GitHub Actions
- Actions checkout code → install dependencies → run tests → build React static bundle → build Docker image → push to registry → (optionally) trigger deployment
- Hosting environment pulls new image → spins up Nginx+React container via docker-compose or orchestrator
- User’s browser → HTTP(S) request → Nginx reverse‐proxy serves static files → browser runs React app
- React app calls external analytics/payment services via pixel utilities
c. Architectural Patterns & Principles
- “Single‐page application + reverse-proxy” pattern
- CI/CD pipeline for automated builds and releases
- Containerization for environment parity and simplified deployment
- Clear separation of concerns: code repo, build pipeline, image registry, runtime environment
d. Key Technologies & Frameworks
- React (frontend SPA)
- Nginx (static file server / reverse proxy)
- Docker (containerization) & Docker Compose (local orchestration)
- GitHub Actions (CI/CD)
- Third-party analytics/payment pixels (via utils scripts)

## Diagram (Mermaid)

```mermaid
graph TD
    %% Actors and Environments
    Developer["Developer"]:::dev
    Browser["End User Browser"]:::browser

    %% Version Control & CI/CD
    GitHubRepo["GitHub Repository"]:::repo
    CICD["GitHub Actions CI/CD"]:::ci

    %% Build Process
    Dockerfile["Dockerfile"]:::dockerfile
    DockerCompose["Docker Compose"]:::docker
    PackageJSON["package.json"]:::code
    DockerIgnore[".dockerignore"]:::code

    %% Registry & Hosting
    Registry["Docker Registry"]:::registry
    Hosting["Hosting Environment"]:::hosting

    %% Containers
    NginxContainer["Nginx Proxy Container"]:::container
    ReactContainer["React App Container"]:::container

    %% React App Code
    subgraph "React App Code"
        ReactEntry["Entry Point (index.js)"]:::react
        ReactRoot["Root Component (App.js)"]:::react
        Components["UI Components"]:::code
        Pages["Page Views"]:::code
        UtilsContacto["contactoPixel.js"]:::code
        UtilsPago["iniciarPagoPixel.js"]:::code
        Tests["Test Suites"]:::test
        PublicHTML["Static Assets (index.html)"]:::static
    end

    %% External Services
    ExtServices["External Services (Analytics/Payment)"]:::external

    %% Subgraphs for organization
    subgraph "Local Environment"
        Developer
        DockerCompose
        DockerIgnore
    end

    subgraph "Version Control & CI/CD"
        GitHubRepo
        CICD
    end

    subgraph "Build Artifacts"
        Dockerfile
        PackageJSON
    end

    subgraph "Registry & Runtime"
        Registry
        Hosting
    end

    subgraph "Containers"
        NginxContainer
        ReactContainer
    end

    %% Data Flows
    Developer -->|push code to| GitHubRepo
    GitHubRepo -->|triggers| CICD
    CICD -->|checkout code| GitHubRepo
    CICD -->|install dependencies| PackageJSON
    CICD -->|run tests| Tests
    CICD -->|build React bundle| ReactEntry
    CICD -->|build Docker image| Dockerfile
    CICD -->|use compose| DockerCompose
    CICD -->|push image to| Registry
    Registry -->|pull image| Hosting
    Hosting -->|deploy| NginxContainer
    Hosting -->|deploy| ReactContainer
    Browser -->|HTTP request| NginxContainer
    NginxContainer -->|serve static assets| PublicHTML
    NginxContainer -->|serve React bundle| ReactContainer
    ReactContainer -->|runs React app| Browser
    ReactContainer -->|calls| ExtServices

    %% Click Events
    click GitHubRepo "https://github.com/andes-hosting/website/tree/main/./"
    click CICD "https://github.com/andes-hosting/website/blob/main/.github/workflows/publish-image-and-release.yml"
    click Dockerfile "https://github.com/andes-hosting/website/tree/main/dockerfile"
    click DockerCompose "https://github.com/andes-hosting/website/blob/main/docker-compose.yml"
    click PackageJSON "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/package.json"
    click DockerIgnore "https://github.com/andes-hosting/website/blob/main/.dockerignore"
    click ReactEntry "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/src/index.js"
    click ReactRoot "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/src/App.js"
    click Components "https://github.com/andes-hosting/website/tree/main/website-andes-hosting/src/components/"
    click Pages "https://github.com/andes-hosting/website/tree/main/website-andes-hosting/src/pages/"
    click UtilsContacto "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/src/utils/contactoPixel.js"
    click UtilsPago "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/src/utils/iniciarPagoPixel.js"
    click Tests "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/src/App.test.js"
    click PublicHTML "https://github.com/andes-hosting/website/blob/main/website-andes-hosting/public/index.html"
    click GitHubRepo "https://github.com/andes-hosting/website/blob/main/./README.md"
    click GitHubRepo "https://github.com/andes-hosting/website/tree/main/./LICENSE"

    %% Styles
    classDef dev fill:#AEDFF7,stroke:#333,stroke-width:1px
    classDef browser fill:#F5E68E,stroke:#333,stroke-width:1px
    classDef repo fill:#E2E2E2,stroke:#333,stroke-width:1px
    classDef ci fill:#C8E6C9,stroke:#333,stroke-width:1px
    classDef dockerfile fill:#FFD54F,stroke:#333,stroke-width:1px
    classDef docker fill:#FFF59D,stroke:#333,stroke-width:1px
    classDef code fill:#B2EBF2,stroke:#333,stroke-width:1px
    classDef test fill:#FFF9C4,stroke:#333,stroke-width:1px
    classDef static fill:#FFFDE7,stroke:#333,stroke-width:1px
    classDef react fill:#CE93D8,stroke:#333,stroke-width:1px
    classDef registry fill:#EF9A9A,stroke:#333,stroke-width:1px
    classDef hosting fill:#90CAF9,stroke:#333,stroke-width:1px
    classDef container fill:#80DEEA,stroke:#333,stroke-width:1px
    classDef external fill:#E1BEE7,stroke:#333,stroke-width:1px
```
