# katar012/microproyecto2 architecture

> Architecture diagram of the GitHub repository katar012/microproyecto2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/katar012/microproyecto2
- Repository: https://github.com/katar012/microproyecto2

## Overview

This repository contains infrastructure-as-code for provisioning and configuring VMs, Docker, microservice containers, and HAProxy. The evidenced Chef workflow is role selection → cookbook recipes → host configuration; the microservices recipe launches paired HTTP-echo containers for users, products, and orders. The README adds no product detail. Terraform and Vagrant are present, but their contents were not sampled, so their relationships and responsibilities cannot be established here.

Main entry points: [`1-2. Infraestructura/chef/cookbooks/microservices/recipes/default.rb`](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/microservices/recipes/default.rb) (Microservice containers), [`1-2. Infraestructura/chef/roles/microservices.rb`](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/roles/microservices.rb) (Docker role), [`1-2. Infraestructura/chef/cookbooks/docker/recipes/default.rb`](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/docker/recipes/default.rb) (Docker installation), [`1-2. Infraestructura/chef/cookbooks/haproxy/recipes/default.rb`](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/haproxy/recipes/default.rb) (HAProxy installation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["Provisioning"]
  node_terraform["Terraform definitions<br/>[terraform]"]
  node_vagrant["Vagrant environment"]
end

subgraph group_chef["Chef configuration"]
  node_solo["Chef Solo settings<br/>[solo.rb]"]
  node_docker_role["Docker role<br/>[microservices.rb]"]
  node_haproxy_role["HAProxy role<br/>[haproxy.rb]"]
end

subgraph group_services["Runtime services"]
  node_docker_recipe["Docker installation<br/>[default.rb]"]
  node_micro_recipe["Microservice containers<br/>[default.rb]"]
  node_haproxy_recipe["HAProxy installation<br/>[default.rb]"]
  node_haproxy_config["HAProxy configuration<br/>[haproxy.cfg.erb]"]
end

node_docker_engine["Docker Engine"]
node_echo_image["HTTP echo image"]

node_docker_role -->|"runs recipe"| node_docker_recipe
node_docker_role -->|"runs recipe"| node_micro_recipe
node_haproxy_role -->|"runs recipe"| node_haproxy_recipe
node_docker_recipe -->|"installs and starts"| node_docker_engine
node_micro_recipe -->|"runs containers"| node_docker_engine
node_micro_recipe -->|"runs image"| node_echo_image
node_haproxy_recipe -->|"installs template"| node_haproxy_config

click node_terraform "https://github.com/katar012/microproyecto2/tree/main/1-2.%20Infraestructura/terraform"
click node_vagrant "https://github.com/katar012/microproyecto2/blob/main/Vagrantfile"
click node_solo "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/solo.rb"
click node_docker_role "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/roles/microservices.rb"
click node_haproxy_role "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/roles/haproxy.rb"
click node_docker_recipe "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/docker/recipes/default.rb"
click node_micro_recipe "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/microservices/recipes/default.rb"
click node_haproxy_recipe "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/haproxy/recipes/default.rb"
click node_haproxy_config "https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/haproxy/templates/default/haproxy.cfg.erb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_terraform,node_vagrant toneBlue
class node_solo,node_docker_role,node_haproxy_role toneAmber
class node_docker_recipe,node_micro_recipe,node_haproxy_recipe,node_haproxy_config toneMint
class node_docker_engine,node_echo_image toneIndigo
```

## Components

### Provisioning

- [Terraform definitions](https://github.com/katar012/microproyecto2/tree/main/1-2.%20Infraestructura/terraform): `1-2. Infraestructura/terraform`
- [Vagrant environment](https://github.com/katar012/microproyecto2/blob/main/Vagrantfile): `Vagrantfile`

### Chef configuration

- [Chef Solo settings](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/solo.rb): `1-2. Infraestructura/chef/solo.rb`
- [Docker role](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/roles/microservices.rb): `1-2. Infraestructura/chef/roles/microservices.rb`
- [HAProxy role](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/roles/haproxy.rb): `1-2. Infraestructura/chef/roles/haproxy.rb`

### Runtime services

- [Docker installation](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/docker/recipes/default.rb): `1-2. Infraestructura/chef/cookbooks/docker/recipes/default.rb`
- [Microservice containers](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/microservices/recipes/default.rb): `1-2. Infraestructura/chef/cookbooks/microservices/recipes/default.rb`
- [HAProxy installation](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/haproxy/recipes/default.rb): `1-2. Infraestructura/chef/cookbooks/haproxy/recipes/default.rb`
- [HAProxy configuration](https://github.com/katar012/microproyecto2/blob/main/1-2.%20Infraestructura/chef/cookbooks/haproxy/templates/default/haproxy.cfg.erb): `1-2. Infraestructura/chef/cookbooks/haproxy/templates/default/haproxy.cfg.erb`

### Other components

- **Docker Engine**
- **HTTP echo image**

## Connections

- Docker role → Docker installation: runs recipe (evidence: `1-2. Infraestructura/chef/roles/microservices.rb`)
- Docker role → Microservice containers: runs recipe (evidence: `1-2. Infraestructura/chef/roles/microservices.rb`)
- HAProxy role → HAProxy installation: runs recipe (evidence: `1-2. Infraestructura/chef/roles/haproxy.rb`)
- Docker installation → Docker Engine: installs and starts (evidence: `1-2. Infraestructura/chef/cookbooks/docker/recipes/default.rb`)
- Microservice containers → Docker Engine: runs containers (evidence: `1-2. Infraestructura/chef/cookbooks/microservices/recipes/default.rb`)
- Microservice containers → HTTP echo image: runs image (evidence: `1-2. Infraestructura/chef/cookbooks/microservices/recipes/default.rb`)
- HAProxy installation → HAProxy configuration: installs template (evidence: `1-2. Infraestructura/chef/cookbooks/haproxy/recipes/default.rb`)
