# andrescutellez/sistema-tickets architecture

> Architecture diagram of the GitHub repository andrescutellez/sistema-tickets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andrescutellez/sistema-tickets
- Repository: https://github.com/andrescutellez/sistema-tickets

## Overview

1. This is a classic PHP monolith for “Sistema de Interventoría - Security Shops”: one server-side application, backed by MySQL, with a largely server-rendered UI and some JavaScript-driven interactivity.

2. The main entry point is `index.php`. From the structure, it acts as the app’s front door and likely decides which view to load based on session/auth state and requested module.

3. The backend is organized in an MVC-like split:
   - `config/conexion.php` holds the database connection.
   - `models/` contains the domain models: `Usuario`, `Proyecto`, and `Categoria`.
   - `controller/` contains the action layer for those same domains: `usuario.php`, `proyecto.php`, and `categoria.php`.

4. The domain model is centered on three business entities:
   - Users for authentication and role-based access.
   - Projects for the interventoría workflow.
   - Categories for classifying projects.
   The README also implies project priority, status, assignment, and comment/traceability data are part of the project lifecycle.

5. The UI is split into reusable layout partials under `view/`:
   - `MainCabecera/`, `MainHeader/`, `MainNav/`, and `MainJS/`
   These are the shared shell around the feature screens, which keeps the app visually consistent across modules.

6. Feature screens live in dedicated view folders:
   - `home/` for the dashboard
   - `mntusuarios/` for user administration
   - `nuevoProyecto/` for creating projects
   - `consultarProyecto/` for searching/assigning projects
   - `detalleProyecto/` for project detail and traceability
   - `Logout/` for sign-out
   This suggests a menu-driven, module-by-module navigation model rather than a single-page app.

7. Each feature view has its own companion JavaScript file:
   - `home/home.js`
   - `mntusuarios/mntusuarios.js`
   - `nuevoProyecto/nuevoProyecto.js`
   - `consultarProyecto/consultarProyecto.js`
   - `detalleProyecto/detalleProyecto.js`
   This indicates the browser side handles form behavior, table interaction, and likely AJAX calls to the PHP controllers.

8. The database is externalized as `interventoria_securityshops.sql`, which is the authoritative schema/data seed for local setup. The README confirms MySQL as the persistence layer and `config/conexion.php` as the environment-specific connection point.

9. `public/` is mostly a full admin-template asset bundle: HTML examples, Bootstrap-based CSS, jQuery plugins, charts, tables, calendars, editors, notifications, and other UI utilities. These assets are not the core business logic; they provide the presentation layer and interactions for the PHP views.

10. The architectural boundary is clear:
   - Controllers expose app actions.
   - Models encapsulate database-backed entities.
   - Views render the UI and include shared layout fragments.
   - Client-side JS enhances the screens and talks back to the backend.
   - MySQL stores users, projects, categories, and traceability records.
   This is a straightforward layered CRUD architecture with authentication and workflow tracking as the main business concerns.

Main entry points: [`view/home/index.php`](https://github.com/andrescutellez/sistema-tickets/blob/main/view/home/index.php) (Dashboard), [`view/mntusuarios/index.php`](https://github.com/andrescutellez/sistema-tickets/blob/main/view/mntusuarios/index.php) (Users), [`view/nuevoProyecto/index.php`](https://github.com/andrescutellez/sistema-tickets/blob/main/view/nuevoProyecto/index.php) (New project), [`view/consultarProyecto/index.php`](https://github.com/andrescutellez/sistema-tickets/blob/main/view/consultarProyecto/index.php) (Search project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core app"]
  node_index["Front door<br/>php entrypoint<br/>[index.php]"]
  node_db["DB config<br/>mysql connection<br/>[conexion.php]"]
  node_ctrl_usuario["User ctrl<br/>controller<br/>[usuario.php]"]
  node_ctrl_proyecto["Project ctrl<br/>controller<br/>[proyecto.php]"]
  node_ctrl_categoria["Category ctrl<br/>controller<br/>[categoria.php]"]
  node_model_usuario["User model<br/>domain model<br/>[Usuario.php]"]
  node_model_proyecto["Project model<br/>domain model<br/>[Proyecto.php]"]
  node_model_categoria["Category model<br/>domain model<br/>[Categoria.php]"]
end

subgraph group_ui["UI shell"]
  node_layout_head["Header shell<br/>layout partial<br/>[cabecera.php]"]
  node_layout_nav["Nav shell<br/>layout partial<br/>[Nav.php]"]
  node_layout_header["Top bar<br/>layout partial<br/>[MainHeader.php]"]
  node_layout_js["Script shell<br/>layout partial<br/>[js.php]"]
end

subgraph group_features["Feature views"]
  node_view_home["Dashboard<br/>screen<br/>[index.php]"]
  node_js_home["Home JS<br/>browser script<br/>[home.js]"]
  node_view_users["Users<br/>admin screen<br/>[index.php]"]
  node_js_users["Users JS<br/>browser script<br/>[mntusuarios.js]"]
  node_view_project_new["New project<br/>screen<br/>[index.php]"]
  node_js_project_new["New JS<br/>browser script<br/>[nuevoProyecto.js]"]
  node_view_project_search["Search project<br/>screen<br/>[index.php]"]
  node_js_project_search["Search JS<br/>browser script"]
  node_view_project_detail["Project detail<br/>screen<br/>[index.php]"]
  node_js_project_detail["Detail JS<br/>browser script<br/>[detalleProyecto.js]"]
end

subgraph group_data["Data store"]
  node_sql_schema[("SQL seed<br/>mysql schema")]
end

node_index -->|"connects"| node_db
node_index -->|"routes"| node_ctrl_usuario
node_index -->|"routes"| node_ctrl_proyecto
node_index -->|"routes"| node_ctrl_categoria
node_ctrl_usuario -->|"uses"| node_model_usuario
node_ctrl_proyecto -->|"uses"| node_model_proyecto
node_ctrl_categoria -->|"uses"| node_model_categoria
node_model_usuario -->|"queries"| node_db
node_model_proyecto -->|"queries"| node_db
node_model_categoria -->|"queries"| node_db
node_sql_schema -.->|"defines"| node_db
node_view_home -->|"includes"| node_layout_head
node_view_home -->|"includes"| node_layout_nav
node_view_home -->|"includes"| node_layout_header
node_view_home -->|"includes"| node_layout_js
node_view_home -->|"loads"| node_js_home
node_view_users -->|"includes"| node_layout_head
node_view_users -->|"includes"| node_layout_nav
node_view_users -->|"includes"| node_layout_header
node_view_users -->|"includes"| node_layout_js
node_view_users -->|"loads"| node_js_users
node_view_project_new -->|"includes"| node_layout_head
node_view_project_new -->|"includes"| node_layout_nav
node_view_project_new -->|"includes"| node_layout_header
node_view_project_new -->|"includes"| node_layout_js
node_view_project_new -->|"loads"| node_js_project_new
node_view_project_search -->|"includes"| node_layout_head
node_view_project_search -->|"includes"| node_layout_nav
node_view_project_search -->|"includes"| node_layout_header
node_view_project_search -->|"includes"| node_layout_js
node_view_project_search -->|"loads"| node_js_project_search
node_view_project_detail -->|"includes"| node_layout_head
node_view_project_detail -->|"includes"| node_layout_nav
node_view_project_detail -->|"includes"| node_layout_header
node_view_project_detail -->|"includes"| node_layout_js
node_view_project_detail -->|"loads"| node_js_project_detail

click node_index "https://github.com/andrescutellez/sistema-tickets/blob/main/index.php"
click node_db "https://github.com/andrescutellez/sistema-tickets/blob/main/config/conexion.php"
click node_ctrl_usuario "https://github.com/andrescutellez/sistema-tickets/blob/main/controller/usuario.php"
click node_ctrl_proyecto "https://github.com/andrescutellez/sistema-tickets/blob/main/controller/proyecto.php"
click node_ctrl_categoria "https://github.com/andrescutellez/sistema-tickets/blob/main/controller/categoria.php"
click node_model_usuario "https://github.com/andrescutellez/sistema-tickets/blob/main/models/Usuario.php"
click node_model_proyecto "https://github.com/andrescutellez/sistema-tickets/blob/main/models/Proyecto.php"
click node_model_categoria "https://github.com/andrescutellez/sistema-tickets/blob/main/models/Categoria.php"
click node_layout_head "https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainCabecera/cabecera.php"
click node_layout_nav "https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainNav/Nav.php"
click node_layout_header "https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainHeader/MainHeader.php"
click node_layout_js "https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainJS/js.php"
click node_view_home "https://github.com/andrescutellez/sistema-tickets/blob/main/view/home/index.php"
click node_js_home "https://github.com/andrescutellez/sistema-tickets/blob/main/view/home/home.js"
click node_view_users "https://github.com/andrescutellez/sistema-tickets/blob/main/view/mntusuarios/index.php"
click node_js_users "https://github.com/andrescutellez/sistema-tickets/blob/main/view/mntusuarios/mntusuarios.js"
click node_view_project_new "https://github.com/andrescutellez/sistema-tickets/blob/main/view/nuevoProyecto/index.php"
click node_js_project_new "https://github.com/andrescutellez/sistema-tickets/blob/main/view/nuevoProyecto/nuevoProyecto.js"
click node_view_project_search "https://github.com/andrescutellez/sistema-tickets/blob/main/view/consultarProyecto/index.php"
click node_js_project_search "https://github.com/andrescutellez/sistema-tickets/blob/main/view/consultarProyecto/consultarProyecto.js"
click node_view_project_detail "https://github.com/andrescutellez/sistema-tickets/blob/main/view/detalleProyecto/index.php"
click node_js_project_detail "https://github.com/andrescutellez/sistema-tickets/blob/main/view/detalleProyecto/detalleProyecto.js"
click node_sql_schema "https://github.com/andrescutellez/sistema-tickets/blob/main/interventoria_securityshops.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_index,node_db,node_ctrl_usuario,node_ctrl_proyecto,node_ctrl_categoria,node_model_usuario,node_model_proyecto,node_model_categoria toneBlue
class node_layout_head,node_layout_nav,node_layout_header,node_layout_js toneAmber
class node_view_home,node_js_home,node_view_users,node_js_users,node_view_project_new,node_js_project_new,node_view_project_search,node_js_project_search,node_view_project_detail,node_js_project_detail toneMint
class node_sql_schema toneRose
```

## Components

### Core app

Front controller, config, and domain/backend layer

- [Front door](https://github.com/andrescutellez/sistema-tickets/blob/main/index.php): php entrypoint · Application entry point and route dispatcher · `index.php`
- [DB config](https://github.com/andrescutellez/sistema-tickets/blob/main/config/conexion.php): mysql connection · Database connection bootstrap · `config/conexion.php`
- [User ctrl](https://github.com/andrescutellez/sistema-tickets/blob/main/controller/usuario.php): controller · User actions for auth and administration · `controller/usuario.php`
- [Project ctrl](https://github.com/andrescutellez/sistema-tickets/blob/main/controller/proyecto.php): controller · Project workflow actions · `controller/proyecto.php`
- [Category ctrl](https://github.com/andrescutellez/sistema-tickets/blob/main/controller/categoria.php): controller · Category management actions · `controller/categoria.php`
- [User model](https://github.com/andrescutellez/sistema-tickets/blob/main/models/Usuario.php): domain model · User entity and persistence logic · `models/Usuario.php`
- [Project model](https://github.com/andrescutellez/sistema-tickets/blob/main/models/Proyecto.php): domain model · Project entity and persistence logic · `models/Proyecto.php`
- [Category model](https://github.com/andrescutellez/sistema-tickets/blob/main/models/Categoria.php): domain model · Category entity and persistence logic · `models/Categoria.php`

### UI shell

Shared layout fragments used by rendered views

- [Header shell](https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainCabecera/cabecera.php): layout partial · Shared page head and top chrome · `view/MainCabecera/cabecera.php`
- [Nav shell](https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainNav/Nav.php): layout partial · Shared navigation menu · `view/MainNav/Nav.php`
- [Top bar](https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainHeader/MainHeader.php): layout partial · Shared application header · `view/MainHeader/MainHeader.php`
- [Script shell](https://github.com/andrescutellez/sistema-tickets/blob/main/view/MainJS/js.php): layout partial · Shared client-side script includes · `view/MainJS/js.php`

### Feature views

Module-oriented screens and their client-side behavior

- [Dashboard](https://github.com/andrescutellez/sistema-tickets/blob/main/view/home/index.php): screen · Home dashboard screen · `view/home/index.php`
- [Home JS](https://github.com/andrescutellez/sistema-tickets/blob/main/view/home/home.js): browser script · Dashboard behavior and interactions · `view/home/home.js`
- [Users](https://github.com/andrescutellez/sistema-tickets/blob/main/view/mntusuarios/index.php): admin screen · User maintenance screen · `view/mntusuarios/index.php`
- [Users JS](https://github.com/andrescutellez/sistema-tickets/blob/main/view/mntusuarios/mntusuarios.js): browser script · User administration behavior · `view/mntusuarios/mntusuarios.js`
- [New project](https://github.com/andrescutellez/sistema-tickets/blob/main/view/nuevoProyecto/index.php): screen · Project creation screen · `view/nuevoProyecto/index.php`
- [New JS](https://github.com/andrescutellez/sistema-tickets/blob/main/view/nuevoProyecto/nuevoProyecto.js): browser script · Project creation form behavior · `view/nuevoProyecto/nuevoProyecto.js`
- [Search project](https://github.com/andrescutellez/sistema-tickets/blob/main/view/consultarProyecto/index.php): screen · Project consultation and assignment screen · `view/consultarProyecto/index.php`
- [Search JS](https://github.com/andrescutellez/sistema-tickets/blob/main/view/consultarProyecto/consultarProyecto.js): browser script · Project lookup and assignment behavior · `view/consultarProyecto/consultarProyecto.js`
- [Project detail](https://github.com/andrescutellez/sistema-tickets/blob/main/view/detalleProyecto/index.php): screen · Project detail and traceability screen · `view/detalleProyecto/index.php`
- [Detail JS](https://github.com/andrescutellez/sistema-tickets/blob/main/view/detalleProyecto/detalleProyecto.js): browser script · Project detail interactions · `view/detalleProyecto/detalleProyecto.js`

### Data store

Database schema and seed for the application

- [SQL seed](https://github.com/andrescutellez/sistema-tickets/blob/main/interventoria_securityshops.sql): mysql schema · Database schema and seed data · `interventoria_securityshops.sql`

## Connections

- Front door → DB config: connects · Bootstraps persistence before loading modules
- Front door → User ctrl: routes · Dispatches user-related actions
- Front door → Project ctrl: routes · Dispatches project-related actions
- Front door → Category ctrl: routes · Dispatches category-related actions
- User ctrl → User model: uses · Reads and writes user data
- Project ctrl → Project model: uses · Reads and writes project data
- Category ctrl → Category model: uses · Reads and writes category data
- User model → DB config: queries · Persists through the shared connection
- Project model → DB config: queries · Persists through the shared connection
- Category model → DB config: queries · Persists through the shared connection
- SQL seed → DB config: defines · Schema matches the runtime connection target
- Dashboard → Header shell: includes · Uses shared page shell
- Dashboard → Nav shell: includes · Uses shared navigation
- Dashboard → Top bar: includes · Uses shared header
- Dashboard → Script shell: includes · Uses shared scripts
- Dashboard → Home JS: loads · Enhances dashboard interactions
- Users → Header shell: includes · Uses shared page shell
- Users → Nav shell: includes · Uses shared navigation
- Users → Top bar: includes · Uses shared header
- Users → Script shell: includes · Uses shared scripts
- Users → Users JS: loads · Enhances user admin interactions
- New project → Header shell: includes · Uses shared page shell
- New project → Nav shell: includes · Uses shared navigation
- New project → Top bar: includes · Uses shared header
- New project → Script shell: includes · Uses shared scripts
- New project → New JS: loads · Enhances project creation form
- Search project → Header shell: includes · Uses shared page shell
- Search project → Nav shell: includes · Uses shared navigation
- Search project → Top bar: includes · Uses shared header
- Search project → Script shell: includes · Uses shared scripts
- Search project → Search JS: loads · Enhances search and assignment flows
- Project detail → Header shell: includes · Uses shared page shell
- Project detail → Nav shell: includes · Uses shared navigation
- Project detail → Top bar: includes · Uses shared header
- Project detail → Script shell: includes · Uses shared scripts
- Project detail → Detail JS: loads · Enhances traceability and detail interactions
