# joaovieitas420/modocacador architecture

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

- Interactive diagram: https://gitdiagram.com/joaovieitas420/modocacador
- Repository: https://github.com/joaovieitas420/modocacador

## Overview

ModoCacador is a PHP web application for managing hunting-related articles, categories, variants, profiles and user accounts. Its request workflow starts at the front controller, routes through access checks to a controller action, and uses models for database operations before rendering a view. Authentication and administrator access are explicit capabilities in sampled code. The README contains only the product name; article and category management are reflected in the source tree, but their controller implementations were not sampled, so their detailed behavior and links are not asserted.

Main entry points: [`app/core/App.php`](https://github.com/joaovieitas420/modocacador/blob/master/app/core/App.php) (URL router), [`app/models/Utilizadores.php`](https://github.com/joaovieitas420/modocacador/blob/master/app/models/Utilizadores.php) (User records), [`app/core/Db.php`](https://github.com/joaovieitas420/modocacador/blob/master/app/core/Db.php) (SQL access), [`app/core/Controller.php`](https://github.com/joaovieitas420/modocacador/blob/master/app/core/Controller.php) (Controller base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request runtime"]
  node_front["Front controller<br/>[index.php]"]
  node_router["URL router<br/>[App.php]"]
  node_controller["Controller base<br/>[Controller.php]"]
  node_views["Page views"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[Auth.php]"]
  node_session["Session and CSRF<br/>[Sessao.php]"]
  node_useradmin["User administration<br/>[Utilizador.php]"]
  node_userprofile["User profile<br/>[Perfil.php]"]
end

subgraph group_catalog["Catalog management"]
  node_article["Article management<br/>[Artigo.php]"]
  node_category["Category management<br/>[Categoria.php]"]
  node_variant["Variant management<br/>[Variante.php]"]
end

subgraph group_persistence["Persistence"]
  node_userrecords["User records<br/>[Utilizadores.php]"]
  node_articledata["Article records<br/>[Artigos.php]"]
  node_categorydata["Category records<br/>[Categorias.php]"]
  node_imagedata["Article images<br/>[Imagens.php]"]
  node_variantdata["Variant records<br/>[Variantes.php]"]
  node_dbaccess["SQL access<br/>[Db.php]"]
end

node_visitor(("Browser user"))
node_mysql[("MySQL database")]

node_visitor -->|"requests pages"| node_front
node_front -->|"starts routing"| node_router
node_router -->|"dispatches routes"| node_auth
node_router -->|"dispatches routes"| node_useradmin
node_router -->|"dispatches routes"| node_userprofile
node_router -->|"inherits from"| node_controller
node_router -->|"checks access"| node_session
node_auth -->|"starts session"| node_session
node_auth -->|"checks credentials"| node_userrecords
node_useradmin -->|"manages accounts"| node_userrecords
node_userprofile -->|"loads account data"| node_userrecords
node_controller -->|"renders pages"| node_views
node_controller -->|"reads session"| node_session
node_userrecords -->|"queries"| node_dbaccess
node_categorydata -->|"queries"| node_dbaccess
node_variantdata -->|"queries"| node_dbaccess
node_dbaccess -->|"executes SQL"| node_mysql
node_router -.->|"loads routed controller"| node_article
node_router -.->|"loads routed controller"| node_category
node_router -.->|"loads routed controller"| node_variant
node_article -.->|"uses model"| node_articledata
node_article -.->|"uses model"| node_imagedata
node_category -.->|"uses model"| node_categorydata
node_variant -.->|"uses model"| node_variantdata

click node_front "https://github.com/joaovieitas420/modocacador/blob/master/index.php"
click node_router "https://github.com/joaovieitas420/modocacador/blob/master/app/core/App.php"
click node_controller "https://github.com/joaovieitas420/modocacador/blob/master/app/core/Controller.php"
click node_auth "https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Auth.php"
click node_session "https://github.com/joaovieitas420/modocacador/blob/master/app/core/Sessao.php"
click node_useradmin "https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Utilizador.php"
click node_userprofile "https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Perfil.php"
click node_userrecords "https://github.com/joaovieitas420/modocacador/blob/master/app/models/Utilizadores.php"
click node_article "https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Artigo.php"
click node_category "https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Categoria.php"
click node_variant "https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Variante.php"
click node_articledata "https://github.com/joaovieitas420/modocacador/blob/master/app/models/Artigos.php"
click node_categorydata "https://github.com/joaovieitas420/modocacador/blob/master/app/models/Categorias.php"
click node_imagedata "https://github.com/joaovieitas420/modocacador/blob/master/app/models/Imagens.php"
click node_variantdata "https://github.com/joaovieitas420/modocacador/blob/master/app/models/Variantes.php"
click node_views "https://github.com/joaovieitas420/modocacador/tree/master/app/views"
click node_dbaccess "https://github.com/joaovieitas420/modocacador/blob/master/app/core/Db.php"

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_front,node_router,node_controller,node_views,node_visitor toneBlue
class node_auth,node_session,node_useradmin,node_userprofile,node_mysql toneAmber
class node_article,node_category,node_variant toneMint
class node_userrecords,node_articledata,node_categorydata,node_imagedata,node_variantdata,node_dbaccess toneRose
```

## Components

### Request runtime

- [Front controller](https://github.com/joaovieitas420/modocacador/blob/master/index.php): `index.php`
- [URL router](https://github.com/joaovieitas420/modocacador/blob/master/app/core/App.php): `app/core/App.php`
- [Controller base](https://github.com/joaovieitas420/modocacador/blob/master/app/core/Controller.php): `app/core/Controller.php`
- [Page views](https://github.com/joaovieitas420/modocacador/tree/master/app/views): `app/views`

### Identity and access

- [Authentication](https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Auth.php): `app/controllers/Auth.php`
- [Session and CSRF](https://github.com/joaovieitas420/modocacador/blob/master/app/core/Sessao.php): `app/core/Sessao.php`
- [User administration](https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Utilizador.php): `app/controllers/Utilizador.php`
- [User profile](https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Perfil.php): `app/controllers/Perfil.php`

### Catalog management

- [Article management](https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Artigo.php): `app/controllers/Artigo.php`
- [Category management](https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Categoria.php): `app/controllers/Categoria.php`
- [Variant management](https://github.com/joaovieitas420/modocacador/blob/master/app/controllers/Variante.php): `app/controllers/Variante.php`

### Persistence

- [User records](https://github.com/joaovieitas420/modocacador/blob/master/app/models/Utilizadores.php): `app/models/Utilizadores.php`
- [Article records](https://github.com/joaovieitas420/modocacador/blob/master/app/models/Artigos.php): `app/models/Artigos.php`
- [Category records](https://github.com/joaovieitas420/modocacador/blob/master/app/models/Categorias.php): `app/models/Categorias.php`
- [Article images](https://github.com/joaovieitas420/modocacador/blob/master/app/models/Imagens.php): `app/models/Imagens.php`
- [Variant records](https://github.com/joaovieitas420/modocacador/blob/master/app/models/Variantes.php): `app/models/Variantes.php`
- [SQL access](https://github.com/joaovieitas420/modocacador/blob/master/app/core/Db.php): `app/core/Db.php`

### Other components

- **Browser user**
- **MySQL database**

## Connections

- Browser user → Front controller: requests pages (evidence: `index.php`)
- Front controller → URL router: starts routing (evidence: `index.php`)
- URL router → Authentication: dispatches routes (evidence: `app/core/App.php`)
- URL router → User administration: dispatches routes (evidence: `app/core/App.php`)
- URL router → User profile: dispatches routes (evidence: `app/core/App.php`)
- URL router → Controller base: inherits from (evidence: `app/core/App.php`)
- URL router → Session and CSRF: checks access (evidence: `app/core/App.php`)
- Authentication → Session and CSRF: starts session (evidence: `app/controllers/Auth.php`)
- Authentication → User records: checks credentials (evidence: `app/controllers/Auth.php`)
- User administration → User records: manages accounts (evidence: `app/controllers/Utilizador.php`)
- User profile → User records: loads account data (evidence: `app/controllers/Perfil.php`)
- Controller base → Page views: renders pages (evidence: `app/core/Controller.php`)
- Controller base → Session and CSRF: reads session (evidence: `app/core/Controller.php`)
- User records → SQL access: queries (evidence: `app/models/Utilizadores.php`)
- Category records → SQL access: queries (evidence: `app/models/Categorias.php`)
- Variant records → SQL access: queries (evidence: `app/models/Variantes.php`)
- SQL access → MySQL database: executes SQL (evidence: `app/core/Db.php`)
- URL router → Article management: loads routed controller
- URL router → Category management: loads routed controller
- URL router → Variant management: loads routed controller
- Article management → Article records: uses model
- Article management → Article images: uses model
- Category management → Category records: uses model
- Variant management → Variant records: uses model (evidence: `app/controllers/Variante.php`)
