# svo2001/pqrs architecture

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

- Interactive diagram: https://gitdiagram.com/svo2001/pqrs
- Repository: https://github.com/svo2001/pqrs

## Overview

##### Project type and purpose
- From the file tree and README (“read”), we see a PHP-based MVC web application named “ProyectoPQRS.”
- It handles PQRS (petitions, complaints, claims) with file uploads, DB persistence, and a classic Model-View-Controller structure.

##### File structure
- Top-level:
- config/ — database configuration (db_config.php)
- controllers/ — PHP controllers (PQRSController.php)
- model/ — business logic and data access (PQRSModel.php)
- views/ — PHP/HTML templates for UI (index.php, panel_control.php, etc.)
- public/ — entry point (index.php) for web server
- uploads/ — persisted user-uploaded documents
- vendor/ — 3rd-party dependencies via Composer
- tests/ — PHPUnit tests for the model
- Auxiliary:
- composer.json / composer.lock — dependency management
- .github/workflows — CI pipeline configuration
- SSL/ — root CA cert for secure outbound requests or server validation

##### README for additional insights
- Although minimal (“read”), we infer from code that the stack is PHP 7+, uses Composer for dependencies, PHPUnit for testing, and a relational database (likely MySQL/PostgreSQL).

##### Final guidance
- External dependencies (vendor libraries, SSL cert) as side services.
- CI/CD as a separate flow feeding into code repository → build/test → deployment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    Browser["Web Browser"]:::frontend

    %% Server Side
    subgraph "Web Server & Application"
        direction TB
        WebServer["Web Server\n(Nginx/Apache + PHP-FPM)"]:::backend
        Entry["public/index.php\n(Entry Point)"]:::backend
        Vendor["Composer Autoloader\n(vendor/)"]:::backend
        Controller["controllers/\nPQRSController.php"]:::backend
        Model["model/\nPQRSModel.php"]:::backend
        Views["views/"]:::frontend
        Config["config/db_config.php"]:::backend
        SSL["SSL Certificate Store\n(DigiCertGlobalRootCA.crt.pem)"]:::backend
    end

    %% Data Stores
    DB["Database Server\n(MySQL/PostgreSQL)"]:::db
    Storage["File Storage\n(uploads/)"]:::storage

    %% CI/CD
    CI["GitHub Actions CI/CD"]:::ci
    TestConn["DB Connectivity Test\n(test_connection.php)"]:::ci
    UnitTests["PHPUnit Tests\n(tests/PQRSModelTest.php)"]:::ci

    %% Flows
    Browser -->|HTTP/HTTPS| WebServer
    WebServer --> Entry
    Entry --> Vendor
    Entry --> Controller
    Controller --> Model
    Model -->|Reads/Writes| DB
    Controller -->|Handles| Views
    Views -->|Renders Response| Browser
    Controller -->|Uploads/Downloads| Storage
    Model -->|Uses Config| Config
    WebServer -->|TLS Validation| SSL

    CI -->|Runs| UnitTests
    CI -->|Runs| TestConn
    CI -->|Deploys| Entry

    %% Click Events
    click Entry "https://github.com/svo2001/pqrs/blob/master/public/index.php"
    click Controller "https://github.com/svo2001/pqrs/blob/master/controllers/PQRSController.php"
    click Model "https://github.com/svo2001/pqrs/blob/master/model/PQRSModel.php"
    click Views "https://github.com/svo2001/pqrs/tree/master/views/"
    click Config "https://github.com/svo2001/pqrs/blob/master/config/db_config.php"
    click Storage "https://github.com/svo2001/pqrs/tree/master/uploads/"
    click Vendor "https://github.com/svo2001/pqrs/tree/master/vendor/"
    click CI "https://github.com/svo2001/pqrs/blob/master/.github/workflows/master_proyectopqrs.yml"
    click SSL "https://github.com/svo2001/pqrs/blob/master/SSL/DigiCertGlobalRootCA.crt.pem"
    click UnitTests "https://github.com/svo2001/pqrs/blob/master/tests/PQRSModelTest.php"
    click TestConn "https://github.com/svo2001/pqrs/blob/master/test_connection.php"

    %% Styles
    classDef frontend fill:#a2fca2,stroke:#333,stroke-width:1px
    classDef backend fill:#a2d2fc,stroke:#333,stroke-width:1px
    classDef db fill:#ffcc80,stroke:#333,stroke-width:1px
    classDef storage fill:#e0e0e0,stroke:#333,stroke-width:1px
    classDef ci fill:#d4a6ff,stroke:#333,stroke-width:1px
```
