# deabreu1105/ingenieria-soft architecture

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

- Interactive diagram: https://gitdiagram.com/deabreu1105/ingenieria-soft
- Repository: https://github.com/deabreu1105/ingenieria-soft

## Overview

##### Project type and purpose
- From the file tree and minimal README, this is a Docker‐based microservices demo/platform (“ingenieria-soft”) showcasing:
- Two custom microservices (ms‐alpha, ms‐beta)
- A relational database (db)
- A caching layer (redis)
- Service discovery (Consul)
- An edge/router (Traefik)
- A “whoami” test service
- A load-testing tool (vegeta)
- Each service has its own Dockerfile and docker-compose.yml, indicating isolated containers managed via Compose.

##### File structure
- Top-level orchestrators:
- consul/ (service discovery)
- traefik/ (edge router with dynamic certs)
- db/ (Postgres or MySQL, SQL init script)
- redis/ (cache store)
- ms-alpha/, ms-beta/ (core business services)
- whoami/ (echo/test service)
- vegeta/ (load testing harness)
- Each microservice folder: app.py entrypoint, requirements.txt, test suite → standard Python Flask/HTTP service.
- docker-compose files in each folder, plus central Compose via traefik or top-level Compose for full stack.

##### README for additional insights
- README is a placeholder, so rely on file conventions and folder names.

##### Details
- Docker Compose boundary
- Ports (e.g., Traefik: 80/443, services: 5000) if known
- Important environment variables or mount points (e.g., traefik cert paths, db init script)
- Version labels if relevant (e.g., Consul v1.x, Redis v6.x)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Actors
    subgraph "External Actors"
        Client["Client/User"]:::external
        Vegeta["Vegeta (Load Testing)"]:::external
    end

    %% Edge and Discovery
    subgraph "Edge & Discovery"
        Traefik["Traefik (Edge Router\nPorts: 80/443)"]:::infra
        Consul["Consul (Service Discovery\nv1.x)"]:::infra
    end

    %% Application Services
    subgraph "Microservices (Stateless)"
        msAlpha["ms-alpha"]:::service
        msBeta["ms-beta"]:::service
        Whoami["whoami"]:::service
    end

    %% Stateful Services
    subgraph "Stateful Services"
        DB["Database (Postgres/MySQL)"]:::stateful
        Redis["Redis (Cache v6.x)"]:::stateful
    end

    %% Connections
    Client -->|"HTTP"| Traefik
    Vegeta -.->|"HTTP Load"| Traefik
    Traefik -->|"Query Services"| Consul
    Consul -->|"Service Endpoints"| Traefik

    Traefik -->|"Route"/ms-alpha| msAlpha
    Traefik -->|"Route"/ms-beta| msBeta
    Traefik -->|"Route"/whoami| Whoami

    msAlpha -->|"SQL Read/Write"| DB
    msBeta -->|"SQL Read/Write"| DB
    msAlpha -->|"Cache Read/Write"| Redis
    msBeta -->|"Cache Read/Write"| Redis

    %% Click Events
    click msAlpha "https://github.com/deabreu1105/ingenieria-soft/tree/main/ms-alpha/"
    click msBeta "https://github.com/deabreu1105/ingenieria-soft/tree/main/ms-beta/"
    click DB "https://github.com/deabreu1105/ingenieria-soft/tree/main/db/"
    click Redis "https://github.com/deabreu1105/ingenieria-soft/tree/main/redis/"
    click Consul "https://github.com/deabreu1105/ingenieria-soft/tree/main/consul/"
    click Traefik "https://github.com/deabreu1105/ingenieria-soft/tree/main/traefik/"
    click Whoami "https://github.com/deabreu1105/ingenieria-soft/tree/main/whoami/"
    click Vegeta "https://github.com/deabreu1105/ingenieria-soft/tree/main/vegeta/"

    %% Styles
    classDef infra fill:#E0F2F1,stroke:#00796B,color:#004D40
    classDef service fill:#E8F5E9,stroke:#388E3C,color:#1B5E20
    classDef stateful fill:#E1F5FE,stroke:#0288D1,color:#01579B
    classDef external fill:#FFF3E0,stroke:#F57C00,color:#E65100
    class Client,Vegeta external
    class Traefik,Consul infra
    class msAlpha,msBeta,Whoami service
    class DB,Redis stateful
```
