# yarlinriverar/tienda-shalom architecture

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

- Interactive diagram: https://gitdiagram.com/yarlinriverar/tienda-shalom
- Repository: https://github.com/yarlinriverar/tienda-shalom

## Overview

##### Project type and purpose
- This is a monolithic, full-stack PHP web application following a custom MVC pattern.
- It provides both an administrative dashboard (“Admin” controllers & views) and a public-facing storefront/profile area (“Principal” controllers & views).
- It uses Composer for dependency management (e.g., PHPMailer), serves static assets (JS/CSS/images), and connects to a relational database (likely MySQL).

##### File structure
- Top level
- index.php – front controller
- composer.json / composer.lock – PHP dependencies (PHPMailer)
- .htaccess – URL rewriting for pretty routes
- Config/ – core framework bootstrap, autoload, DB connection, query builder, view loader, helper functions
- MVC folders
- Controllers/ – one controller per resource (Admin, Usuarios, Productos, Pedidos, etc.)
- Models/ – corresponding data access classes (AdminModel, UsuariosModel, etc.)
- Views/ – PHP templates, split into “admin” and “principal” subfolders and shared templates
- Static assets
- assets/ – DataTables plugins, admin UI CSS/JS (Material Dashboard), principal site CSS/JS, images, fonts, favicon
- README.md
- Instructs to run composer install for PHPMailer and gives SMTP credentials.

##### README for additional insights
- PHPMailer is used for outbound email notifications.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients"
        AdminBrowser["Browser (Admin)"]:::frontend
        PrincipalBrowser["Browser (Principal)"]:::frontend
    end

    WebServer["Web Server (Apache/Nginx + PHP)"]:::backend
    FrontController["Front Controller & Router"]:::backend

    subgraph "Dependencies"
        composerJson["composer.json"]:::config
        composerLock["composer.lock"]:::config
    end

    subgraph "Config & Bootstrap"
        Autoload["Autoload"]:::config
        Conexion["DB Connection"]:::config
        ControllerCore["Base Controller"]:::config
        Query["Query Builder"]:::config
        ViewsCore["View Loader"]:::config
        ConfigFile["Config Settings"]:::config
        Helpers["Helpers"]:::config
    end

    subgraph "MVC Application"
        subgraph "Controllers"
            ControllersNode["Controllers/*"]:::backend
        end
        subgraph "Models"
            ModelsNode["Models/*"]:::backend
        end
        subgraph "Views"
            ViewsNode["Views/*"]:::frontend
        end
    end

    Database["Relational Database (MySQL)"]:::database
    Assets["Static Assets (CSS/JS/Images)"]:::assets
    SMTP["SMTP Service (PHPMailer Gmail)"]:::external
    README["README.md"]:::config

    %% Connections
    AdminBrowser -->|HTTP Request| WebServer
    PrincipalBrowser -->|HTTP Request| WebServer
    WebServer --> FrontController
    FrontController --> Autoload
    FrontController --> ControllerCore
    FrontController --> composerJson
    FrontController --> composerLock
    FrontController -->|routes to| ControllersNode
    ControllersNode --> ModelsNode
    ModelsNode --> Database
    ControllersNode -->|renders| ViewsNode
    ViewsNode -->|HTML Response| FrontController
    FrontController --> WebServer
    WebServer -->|HTTP Response| AdminBrowser
    WebServer -->|HTTP Response| PrincipalBrowser
    ControllersNode --> SMTP
    AdminBrowser -->|fetch| Assets
    PrincipalBrowser -->|fetch| Assets
    FrontController --> ConfigFile
    FrontController --> Helpers
    FrontController --> Query
    FrontController --> ViewsCore
    FrontController --> Conexion

    %% Click Events
    click FrontController "https://github.com/yarlinriverar/tienda-shalom/blob/main/index.php"
    click FrontController "https://github.com/yarlinriverar/tienda-shalom/blob/main/.htaccess"
    click composerJson "https://github.com/yarlinriverar/tienda-shalom/blob/main/composer.json"
    click composerLock "https://github.com/yarlinriverar/tienda-shalom/blob/main/composer.lock"
    click Autoload "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/App/Autoload.php"
    click Conexion "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/App/Conexion.php"
    click ControllerCore "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/App/Controller.php"
    click Query "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/App/Query.php"
    click ViewsCore "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/App/Views.php"
    click ConfigFile "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/Config.php"
    click Helpers "https://github.com/yarlinriverar/tienda-shalom/blob/main/Config/Helpers.php"
    click ControllersNode "https://github.com/yarlinriverar/tienda-shalom/tree/main/Controllers/"
    click ModelsNode "https://github.com/yarlinriverar/tienda-shalom/tree/main/Models/"
    click ViewsNode "https://github.com/yarlinriverar/tienda-shalom/tree/main/Views/"
    click Assets "https://github.com/yarlinriverar/tienda-shalom/tree/main/assets/"
    click README "https://github.com/yarlinriverar/tienda-shalom/blob/main/README.md"

    %% Styles
    classDef frontend fill:#e0f7fa,stroke:#006064,stroke-width:1px
    classDef backend fill:#bbdefb,stroke:#0d47a1,stroke-width:1px
    classDef config fill:#c8e6c9,stroke:#1b5e20,stroke-width:1px
    classDef database fill:#ffe0b2,stroke:#bf360c,stroke-width:1px
    classDef assets fill:#f3e5f5,stroke:#4a148c,stroke-width:1px
    classDef external fill:#ffccbc,stroke:#e64a19,stroke-width:1px
```
