# 7dg84/cecyayuda architecture

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

- Interactive diagram: https://gitdiagram.com/7dg84/cecyayuda
- Repository: https://github.com/7dg84/cecyayuda

## Overview

##### Project type and purpose
- This is a containerized, full-stack web application (“CECyAYUDA”) that serves user-facing HTML/JS/CSS pages and PHP-based endpoints, backed by a relational database.
- Key indicators:
- Top‐level folders: “db” (database scripts), “nginx” (reverse proxy), “webpage” (web app).
- A docker-compose.yml that wires up three containers (db, nginx, webpage).
- Static assets, PHP scripts, Composer dependencies under “webpage”.

##### File structure
- db/
- Dockerfile and a SQL dump (cecyayuda.sql) to build a MySQL (or MariaDB) image.
- nginx/
- Dockerfile and default.conf define an Nginx container to serve static files and reverse-proxy PHP requests.
- webpage/
- Dockerfile builds a PHP runtime with your application code, Composer dependencies, and static assets.
- Colonias/ HTML pages (static).
- PHP endpoints (consultar.php, save-report.php, admin/*.php, logic.php, etc.).
- JS under scripts/, CSS under styles/.
- docker-compose.yml
- Orchestrates three services: db, nginx, webpage.
- loadhtdochs.py
- A utility script (likely data loader or maintenance tool) run from the host or in a separate container.

##### README for additional insights
- Minimal instructions: “docker compose build” and “docker compose up -d.”

##### Detail without overthinking
- Static Assets (Colonias/*.html, styles/, scripts/)
- PHP API Layer (logic.php, save-report.php, admin/*.php)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    Client["Web Browser"]:::external

    %% Docker Compose Boundary
    subgraph "Docker Compose Orchestration"
        direction TB
        Compose["docker-compose.yml"]:::compose

        %% Nginx Container
        subgraph "nginx Container" 
            direction TB
            NginxImage["nginx/Dockerfile"]:::nginx
            NginxConf["nginx/default.conf"]:::nginx
            NginxProxy["Nginx Proxy & Static Server"]:::nginx
        end

        %% PHP Application Container
        subgraph "webpage Container"
            direction TB
            WebImage["webpage/Dockerfile"]:::app

            subgraph "Static Assets"
                direction TB
                HTMLPages["Index & Pages"]:::frontend
                Colonias["Colonias/*.html"]:::frontend
                CSS["styles/*.css"]:::frontend
                JS["scripts/*.js"]:::frontend
                Images["images/"]:::frontend
                Resources["resources/"]:::frontend
            end

            subgraph "PHP API & Logic"
                direction TB
                Logic["logic.php"]:::app
                Endpoints["consultar.php, save-report.php, delete-report.php, update-report.php, recuperar.php, verify.php"]:::app
                AdminAPI["admin/api.php, config.php, db.php, login.php, logout.php, main.php, verify.php"]:::app
                ComposerDeps["admin/composer.json, composer.lock, vendor/"]:::app
            end
        end

        %% Database Container
        subgraph "db Container"
            direction TB
            DBImage["db/Dockerfile"]:::db
            DBSchema["db/cecyayuda.sql"]:::db
            Database[(MySQL/MariaDB)]:::db
        end
    end

    %% Utility Script
    Loader["loadhtdochs.py"]:::external

    %% README
    Docs["README.md"]:::external

    %% Connections
    Client -->|"HTTP GET /index.html"| NginxProxy
    NginxProxy -->|"FastCGI /reportar.php"| Logic
    Logic -->|"SQL queries (3306)"| Database
    Loader -->|"Loads data"| Database

    %% Click Events
    click Compose "https://github.com/7dg84/cecyayuda/blob/main/docker-compose.yml"
    click NginxImage "https://github.com/7dg84/cecyayuda/tree/main/nginx/Dockerfile"
    click NginxConf "https://github.com/7dg84/cecyayuda/blob/main/nginx/default.conf"
    click WebImage "https://github.com/7dg84/cecyayuda/tree/main/webpage/Dockerfile"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/index.html"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/Mapa.html"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/consultar.html"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/reportar.html"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/informacion.html"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/sobre-nosotros.html"
    click HTMLPages "https://github.com/7dg84/cecyayuda/blob/main/webpage/no_encontrada.html"
    click Colonias "https://github.com/7dg84/cecyayuda/tree/main/webpage/Colonias/"
    click Logic "https://github.com/7dg84/cecyayuda/blob/main/webpage/logic.php"
    click Endpoints "https://github.com/7dg84/cecyayuda/blob/main/webpage/consultar.php"
    click Endpoints "https://github.com/7dg84/cecyayuda/blob/main/webpage/save-report.php"
    click Endpoints "https://github.com/7dg84/cecyayuda/blob/main/webpage/delete-report.php"
    click Endpoints "https://github.com/7dg84/cecyayuda/blob/main/webpage/update-report.php"
    click Endpoints "https://github.com/7dg84/cecyayuda/blob/main/webpage/recuperar.php"
    click Endpoints "https://github.com/7dg84/cecyayuda/blob/main/webpage/verify.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/api.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/config.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/db.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/login.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/logout.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/main.php"
    click AdminAPI "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/verify.php"
    click ComposerDeps "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/composer.json"
    click ComposerDeps "https://github.com/7dg84/cecyayuda/blob/main/webpage/admin/composer.lock"
    click ComposerDeps "https://github.com/7dg84/cecyayuda/tree/main/webpage/admin/vendor/"
    click CSS "https://github.com/7dg84/cecyayuda/tree/main/webpage/styles/"
    click JS "https://github.com/7dg84/cecyayuda/tree/main/webpage/scripts/"
    click Images "https://github.com/7dg84/cecyayuda/tree/main/webpage/images/"
    click Resources "https://github.com/7dg84/cecyayuda/tree/main/webpage/resources/"
    click DBImage "https://github.com/7dg84/cecyayuda/tree/main/db/Dockerfile"
    click DBSchema "https://github.com/7dg84/cecyayuda/blob/main/db/cecyayuda.sql"
    click Loader "https://github.com/7dg84/cecyayuda/blob/main/loadhtdochs.py"
    click Docs "https://github.com/7dg84/cecyayuda/blob/main/README.md"

    %% Styles
    classDef external fill:#dddddd,stroke:#999999,color:#333333
    classDef compose fill:#f9f,stroke:#c69,color:#333333
    classDef nginx fill:#bbdefb,stroke:#2196f3,color:#0d47a1
    classDef app fill:#c8e6c9,stroke:#4caf50,color:#1b5e20
    classDef db fill:#ffe0b2,stroke:#ff9800,color:#e65100
    classDef frontend fill:#e1bee7,stroke:#9c27b0,color:#4a148c
```
