# sh6ta-thecat/proyecto_salon architecture

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

- Interactive diagram: https://gitdiagram.com/sh6ta-thecat/proyecto_salon
- Repository: https://github.com/sh6ta-thecat/proyecto_salon

## Overview

##### Main Components Identification
- Frontend/UI Layer: This includes the static HTML pages (index.php, login.php, register.html, etc.), the CSS and SCSS assets (css/, scss/), and JavaScript files (js/, including demo scripts for charts and datatables). These provide the user interface and visualization.
- Backend/Application Layer: The PHP controllers (controllers/UsuarioController.php) and data models (models/UsuarioModel.php, models/conexionDB.php, models/config.php) implement the MVC structure. This layer handles business logic, data management, and database connectivity.
- Database/Data Storage: Although the project does not include a standalone database, files like the SQL script (sql/a.sql) indicate that a relational database is expected. Include this as the data storage component.
- Development and Build Tools: The Gulp build system (gulpfile.js), package.json configuration (and lock file), and related tasks (CSS and JS minification, SCSS compilation, vendor dependency copying) form a separate layer that manages asset building and live reload during development.
- Third-Party Dependencies: The vendor directory and external libraries (Bootstrap, jQuery, etc.) imported via npm and included in the project should be represented as external services or integration components.

##### Relationships and Interactions
- How the user’s browser interacts with the Frontend/UI components (HTML, CSS, JS) that render the admin dashboard.
- That user requests (for login, data visualization, navigation) are sent to the backend controllers (in PHP) which in turn call the respective models for database operations.
- Interactions where build tools process the SCSS and JavaScript files, generating optimized assets deployed in the static asset directories.
- External dependencies (such as Bootstrap’s CSS/JS) as inputs into the UI layer.

##### Architectural Patterns and Design Principles
- MVC Separation: Clearly differentiate between the View (HTML/CSS/JS), the Controller (PHP controllers), and the Model (PHP models and DB connectivity).
- Modular Asset Management: The use of Gulp tasks and SCSS indicates an organized, modular approach to asset compilation and management.

##### Relevant Technologies and Frameworks
- Frontend: Bootstrap (for responsive design), custom SCSS, and JavaScript (including demo scripts for charts and tables).
- Backend: PHP-based controllers and models implementing business logic and database interactions.
- Build Tools: Gulp, npm, and package management to facilitate asset compilation and dependency management.
- Deployment/CI: .travis.yml signifies integration with Travis CI for automatic testing/builds.

##### Elements
- Use clear labels for each component: “Frontend (HTML, CSS, JS)”, “Controllers (PHP)”, “Models (Data/DB Connectivity)”, “Database”, “Build Tools (Gulp, npm)”, “Third-Party Libraries (Bootstrap, etc.)”, and “CI/CD (Travis CI)”.
- To detail the separation of concerns (MVC) and how external services like Bootstrap are integrated.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    Browser["Browser"]:::ci

    %% Frontend/UI Layer
    subgraph "Frontend/UI"
        indexPHP["index.php"]:::frontend
        loginPHP["login.php"]:::frontend
        registerHTML["register.html"]:::frontend
        _404HTML["404.html"]:::frontend
        buttonsHTML["buttons.html"]:::frontend
        cardsHTML["cards.html"]:::frontend
        chartsHTML["charts.html"]:::frontend
        forgotHTML["forgot-password.html"]:::frontend
        blankHTML["blank.html"]:::frontend
        tablesHTML["tables.html"]:::frontend
        utilitiesAnimation["utilities-animation.html"]:::frontend
        utilitiesBorder["utilities-border.html"]:::frontend
        utilitiesColor["utilities-color.html"]:::frontend
        utilitiesOther["utilities-other.html"]:::frontend

        sbAdminCSS["sb-admin-2.css"]:::frontend
        scssDir["scss/"]:::frontend
        sbAdminJS["sb-admin-2.js"]:::frontend

        chartArea["chart-area-demo.js"]:::frontend
        chartBar["chart-bar-demo.js"]:::frontend
        chartPie["chart-pie-demo.js"]:::frontend
        datatablesDemo["datatables-demo.js"]:::frontend
    end

    %% Backend/Application Layer
    subgraph "Backend/Application"
        usuarioController["UsuarioController.php"]:::backend
        usuarioModel["UsuarioModel.php"]:::backend
        conexionDB["conexionDB.php"]:::backend
        config["config.php"]:::backend
    end

    %% Database/Data Storage
    aSQL["a.sql"]:::database

    %% Development and Build Tools
    subgraph "Development/Build Tools"
        gulpfile["gulpfile.js"]:::build
        packageJSON["package.json"]:::build
        packageLock["package-lock.json"]:::build
    end

    %% Third-Party Dependencies
    vendor["vendor"]:::external

    %% CI/CD Integration
    travis["Travis CI"]:::ci

    %% Connections
    Browser -->|"loads"| indexPHP
    indexPHP -->|"triggers"| usuarioController
    usuarioController -->|"calls"| usuarioModel
    usuarioModel -->|"uses"| conexionDB
    conexionDB -->|"connects to"| aSQL

    %% Build Tools integrate into Frontend assets
    gulpfile -->|"compiles"| scssDir
    gulpfile -->|"bundles"| sbAdminJS
    packageJSON --> packageLock
    travis -->|"invokes"| gulpfile

    %% Third-Party Dependencies provide assets to Frontend
    vendor -->|"supplies"| sbAdminCSS
    vendor -->|"supplies"| sbAdminJS

    %% Class Definitions for styling
    classDef frontend fill:#CDE1F9,stroke:#2D7EC1,stroke-width:2px;
    classDef backend fill:#F9D6C1,stroke:#C16B2D,stroke-width:2px;
    classDef database fill:#FFF6A5,stroke:#C1A52D,stroke-width:2px;
    classDef build fill:#C1F9D6,stroke:#2DC16B,stroke-width:2px;
    classDef external fill:#F9C1F9,stroke:#C12DC1,stroke-width:2px;
    classDef ci fill:#D6C1F9,stroke:#7E2DC1,stroke-width:2px;

    %% Click Events
    click indexPHP "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/index.php"
    click loginPHP "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/login.php"
    click registerHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/register.html"
    click _404HTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/404.html"
    click buttonsHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/buttons.html"
    click cardsHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/cards.html"
    click chartsHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/charts.html"
    click forgotHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/forgot-password.html"
    click blankHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/blank.html"
    click tablesHTML "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/tables.html"
    click utilitiesAnimation "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/utilities-animation.html"
    click utilitiesBorder "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/utilities-border.html"
    click utilitiesColor "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/utilities-color.html"
    click utilitiesOther "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/utilities-other.html"

    click sbAdminCSS "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/css/sb-admin-2.css"
    click scssDir "https://github.com/sh6ta-thecat/proyecto_salon/tree/main/scss/"
    click sbAdminJS "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/js/sb-admin-2.js"
    click chartArea "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/js/demo/chart-area-demo.js"
    click chartBar "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/js/demo/chart-bar-demo.js"
    click chartPie "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/js/demo/chart-pie-demo.js"
    click datatablesDemo "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/js/demo/datatables-demo.js"

    click usuarioController "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/controllers/UsuarioController.php"
    click usuarioModel "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/models/UsuarioModel.php"
    click conexionDB "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/models/conexionDB.php"
    click config "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/models/config.php"

    click aSQL "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/sql/a.sql"

    click gulpfile "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/gulpfile.js"
    click packageJSON "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/package.json"
    click packageLock "https://github.com/sh6ta-thecat/proyecto_salon/blob/main/package-lock.json"

    click vendor "https://github.com/sh6ta-thecat/proyecto_salon/tree/main/vendor"
```
