# nullx5/proyecto architecture

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

- Interactive diagram: https://gitdiagram.com/nullx5/proyecto
- Repository: https://github.com/nullx5/proyecto

## Overview

The project you’re working on is not a single monolithic application but rather a compilation of several lab environments that showcase different virtualization and containerization tools. Each lab (Lab01 through Lab05) demonstrates a specific technology stack and use case, ranging from a classic LAMP stack, CMS deployments (WordPress), Django with container orchestration, an intentionally insecure application (OWASP Juice Shop), to an open source IP address management tool (PhpIPAM). The overarching purpose is to illustrate how to create portable, consistent, and reproducible development environments using Vagrant and Docker.

##### Main Components
- Virtualization Platforms:
– Vagrant is used in Lab01, Lab02, Lab03, Lab04, and Lab05 as indicated by the “Vagrantfile” in most labs.
– Docker and docker-compose: Showcase container orchestration in Lab02, Lab03, Lab04, and Lab05.
- Application Stacks per Lab:
– Lab01: A LAMP stack setup (likely including Apache, PHP, and MySQL) with specific instructions for Joomla.
– Lab02: A WordPress CMS running with a MySQL database through a Docker network.
– Lab03: A Django-based web application (with a typical Django project structure including settings, urls, wsgi, etc.) paired with a database. Although the file tree shows “db.sqlite3,” the README mentions PostgreSQL, indicating a containerized database managed via docker-compose.
– Lab04: OWASP Juice Shop, an insecure web application container.
– Lab05: PhpIPAM, an IP address management application container.
- Underlying Infrastructure:
– The host machine that runs VirtualBox, Vagrant, and Docker.
– Networking configurations, with specific notes in the README on setting up network segments (e.g., “networks.conf”) for VirtualBox.
- Supporting Tools:
– Git for version control.
– The various scripts (bootstrap.sh, default.conf) and configuration files (for Django’s settings, URLs, etc.) to set up services inside containers.

##### File Structure for Diagramming
- Notice the presence of multiple “Vagrantfile” instances; this indicates a design where Vagrant is used to provision individual virtualized environments.
- Lab03’s detailed substructure (including config files, manage.py, and docker-compose.yml) is a sign that this lab involves a more complex web application architecture, consisting of application logic, database, and orchestration.
- Files like Dockerfile and docker-compose.yml (in Lab03) and bootstrap.sh and default.conf (in Lab04) indicate custom configurations for containerized environments.

– The Virtual Machine layer managed by VirtualBox/Vagrant.
– The Container layer where Docker and docker-compose orchestrate services.
– A label identifying the lab (e.g., “Lab01 – LAMP Stack (Vagrant)”).
– Data flow between web servers and databases (e.g., in Lab02 and Lab03).
– Dependencies between the orchestration tool (Docker or docker-compose) and the individual application containers.
– Network communications between host, VMs, and containers.
– Use another to represent Docker containers.
e. Label Connections:
– Clearly label connections such as “HTTP/HTTPS requests,” “DB queries,” “Container orchestration,” etc.
– For Lab03, show internal interactions between Django (application server) and its database.
– In Lab02, illustrate the CMS (WordPress) connecting to the MySQL service.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Host("Host Machine"):::host
    Host --> VMs("Virtual Machines (Vagrant)"):::vagrantLayer
    Host --> Containers("Containers (Docker)"):::dockerLayer

    subgraph "Virtual Machines (Vagrant)"
        L1("Lab01 - LAMP (Vagrant)"):::vagrant
        L2("Lab02 - WordPress (Vagrant)"):::vagrant
        L3("Lab03 - Django (Vagrant)"):::vagrant
        L4("Lab04 - Juice Shop (Vagrant)"):::vagrant
        L5("Lab05 - PhpIPAM (Vagrant)"):::vagrant
    end

    %% Lab01 File Components
    JIdx("Joomla Index"):::file
    JInst("Joomla INSTALL"):::file
    L1 --- JIdx
    L1 --- JInst

    %% Lab02 File Component
    L2V("Vagrantfile"):::file
    L2 --- L2V

    %% Lab03 File Components
    L3V("Vagrantfile"):::file
    DFile("Dockerfile"):::file
    DCompose("docker-compose.yml"):::file
    DConfig("Django Config"):::file
    Mpy("manage.py"):::file
    L3 --- L3V
    L3 --- DFile
    L3 --- DCompose
    L3 --- DConfig
    L3 --- Mpy

    %% Lab04 File Components
    L4V("Vagrantfile"):::file
    Bsh("bootstrap.sh"):::file
    DConf("default.conf"):::file
    L4 --- L4V
    L4 --- Bsh
    L4 --- DConf

    %% Lab05 File Component
    L5V("Vagrantfile"):::file
    L5 --- L5V

    subgraph "Containers (Docker)"
        WP("WordPress Container"):::docker
        MySQL("MySQL Container"):::docker
        DjangoC("Django Container"):::docker
        DB("PostgreSQL Container"):::docker
        Juice("Juice Shop Container"):::docker
        PhpIPAM("PhpIPAM Container"):::docker
    end

    %% Connections from Vagrant environments to their containers
    L2 -->|"orchestrates"| WP
    L2 -->|"orchestrates"| MySQL
    L3 -->|"orchestrates"| DjangoC
    L3 -->|"orchestrates"| DB
    L4 -->|"orchestrates"| Juice
    L5 -->|"orchestrates"| PhpIPAM

    %% Internal container interactions
    WP -->|"queries"| MySQL
    DjangoC -->|"queries"| DB

    %% Click Events for Lab01
    click L1 "https://github.com/nullx5/proyecto/tree/master/lab01/Vagrantfile"
    click JIdx "https://github.com/nullx5/proyecto/blob/master/lab01/index.php"
    click JInst "https://github.com/nullx5/proyecto/blob/master/lab01/INSTALL JOOMLA.md"
    
    %% Click Events for Lab02
    click L2V "https://github.com/nullx5/proyecto/tree/master/lab02/Vagrantfile"
    
    %% Click Events for Lab03
    click L3V "https://github.com/nullx5/proyecto/tree/master/lab03/Vagrantfile"
    click DFile "https://github.com/nullx5/proyecto/tree/master/lab03/Dockerfile"
    click DCompose "https://github.com/nullx5/proyecto/blob/master/lab03/docker-compose.yml"
    click DConfig "https://github.com/nullx5/proyecto/tree/master/lab03/config"
    click Mpy "https://github.com/nullx5/proyecto/blob/master/lab03/manage.py"
    
    %% Click Events for Lab04
    click L4V "https://github.com/nullx5/proyecto/tree/master/lab04/Vagrantfile"
    click Bsh "https://github.com/nullx5/proyecto/blob/master/lab04/bootstrap.sh"
    click DConf "https://github.com/nullx5/proyecto/blob/master/lab04/default.conf"
    
    %% Click Events for Lab05
    click L5V "https://github.com/nullx5/proyecto/tree/master/lab05/Vagrantfile"

    %% Styles
    classDef host fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef vagrant fill:#aaffaa,stroke:#333,stroke-width:2px;
    classDef docker fill:#aaccff,stroke:#333,stroke-width:2px;
    classDef file fill:#dddddd,stroke:#888, stroke-dasharray:5,5;
    classDef vagrantLayer fill:#ccffcc,stroke:#333;
    classDef dockerLayer fill:#ccf,stroke:#333;
```
