# yontu24/php-mvc-example-tw-project architecture

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

- Interactive diagram: https://gitdiagram.com/yontu24/php-mvc-example-tw-project
- Repository: https://github.com/yontu24/php-mvc-example-tw-project

## Overview

OBIS is an obesity-prevalence visualizer with a PHP MVC web application and a REST API. The user-facing flow enters through the web front controller, routes to an MVC controller, and renders views; filter models retrieve reference data from REST endpoints. The API also exposes information-management and user endpoints, including JWT-protected operations. A separate `sesiune` tree contains a parallel charting and information-management implementation. Several controller, view, and endpoint files were not sampled, so their internal call relationships are not asserted.

Main entry points: [`Proiect/app/models/Model.php`](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Model.php) (HTTP data client), [`Proiect/REST/api/info`](https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/REST/api/info) (Information endpoints), [`Proiect/REST/api/user`](https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/REST/api/user) (User endpoints), [`Proiect/app/core/App.php`](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/core/App.php) (MVC router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_front["Web entry<br/>[index.php]"]
  node_router["MVC router<br/>[App.php]"]
  node_basecontroller["Controller base<br/>[Controller.php]"]
  node_controllers["Page controllers"]
  node_views["Visualizer pages"]
end

subgraph group_webdata["Web data models"]
  node_filtermodels["Filter models<br/>[AllFilters.php]"]
  node_yearmodel["Year model<br/>[Year.php]"]
  node_locationmodel["Location model<br/>[Location.php]"]
  node_categorymodel["Category model<br/>[Category.php]"]
  node_responsemodel["Response model<br/>[Response.php]"]
  node_comparisonmodel["Comparison model<br/>[Comparison.php]"]
  node_modelbase["HTTP data client<br/>[Model.php]"]
end

subgraph group_rest["REST API"]
  node_restinfo["Information endpoints"]
  node_restuser["User endpoints"]
  node_infomodel["Information model<br/>[Info.php]"]
  node_usermodel["User model<br/>[User.php]"]
end

subgraph group_storage["Persistence and auth"]
  node_database[("REST database<br/>[Database.php]")]
  node_jwt["JWT library<br/>[JWT.php]"]
end

subgraph group_legacy["Session implementation"]
  node_legacycharts["Session charting"]
  node_legacyquery["Year query controller<br/>[cgetbyyears.js]"]
  node_legacyadd["Session add endpoint"]
  node_legacydb[("Session database<br/>[database.php]")]
end

node_user(("Visualizer user"))

node_user -->|"opens"| node_front
node_front -->|"starts"| node_router
node_router -->|"routes to"| node_controllers
node_router -.->|"dispatches through"| node_basecontroller
node_basecontroller -->|"loads"| node_views
node_basecontroller -->|"loads model"| node_filtermodels
node_yearmodel -->|"uses"| node_modelbase
node_yearmodel -->|"requests years"| node_restinfo
node_filtermodels -->|"uses"| node_modelbase
node_locationmodel -->|"uses"| node_modelbase
node_categorymodel -->|"uses"| node_modelbase
node_responsemodel -->|"uses"| node_modelbase
node_comparisonmodel -->|"uses"| node_modelbase
node_restinfo -->|"uses"| node_infomodel
node_restinfo -->|"opens connection"| node_database
node_restinfo -->|"verifies token"| node_jwt
node_restuser -->|"uses"| node_usermodel
node_restuser -->|"opens connection"| node_database
node_restuser -->|"verifies token"| node_jwt
node_infomodel -.->|"queries"| node_database
node_legacycharts -->|"requests years"| node_legacyquery
node_legacyadd -->|"opens connection"| node_legacydb
node_legacyadd -->|"verifies token"| node_jwt

click node_front "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/public/index.php"
click node_router "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/core/App.php"
click node_basecontroller "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/core/Controller.php"
click node_controllers "https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/app/controllers"
click node_views "https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/app/views"
click node_filtermodels "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/AllFilters.php"
click node_yearmodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Year.php"
click node_locationmodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Location.php"
click node_categorymodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Category.php"
click node_responsemodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Response.php"
click node_comparisonmodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Comparison.php"
click node_modelbase "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Model.php"
click node_restinfo "https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/REST/api/info"
click node_restuser "https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/REST/api/user"
click node_infomodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/models/Info.php"
click node_usermodel "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/models/User.php"
click node_database "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/config/Database.php"
click node_jwt "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/config/JWT/php-jwt-master/src/JWT.php"
click node_legacycharts "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/View/vchartcomparatie.js"
click node_legacyquery "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/Controller/cgetbyyears.js"
click node_legacyadd "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/Model/MAaddinformations.php"
click node_legacydb "https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/DB/database.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_basecontroller,node_controllers,node_views,node_user toneBlue
class node_filtermodels,node_yearmodel,node_locationmodel,node_categorymodel,node_responsemodel,node_comparisonmodel,node_modelbase toneAmber
class node_restinfo,node_restuser,node_infomodel,node_usermodel toneMint
class node_database,node_jwt toneRose
class node_legacycharts,node_legacyquery,node_legacyadd,node_legacydb toneIndigo
```

## Components

### Web application

- [Web entry](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/public/index.php): `Proiect/public/index.php`
- [MVC router](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/core/App.php): `Proiect/app/core/App.php`
- [Controller base](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/core/Controller.php): `Proiect/app/core/Controller.php`
- [Page controllers](https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/app/controllers): `Proiect/app/controllers`
- [Visualizer pages](https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/app/views): `Proiect/app/views`

### Web data models

- [Filter models](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/AllFilters.php): `Proiect/app/models/AllFilters.php`
- [Year model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Year.php): `Proiect/app/models/Year.php`
- [Location model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Location.php): `Proiect/app/models/Location.php`
- [Category model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Category.php): `Proiect/app/models/Category.php`
- [Response model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Response.php): `Proiect/app/models/Response.php`
- [Comparison model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Comparison.php): `Proiect/app/models/Comparison.php`
- [HTTP data client](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/app/models/Model.php): `Proiect/app/models/Model.php`

### REST API

- [Information endpoints](https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/REST/api/info): `Proiect/REST/api/info`
- [User endpoints](https://github.com/yontu24/php-mvc-example-tw-project/tree/master/Proiect/REST/api/user): `Proiect/REST/api/user`
- [Information model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/models/Info.php): `Proiect/REST/models/Info.php`
- [User model](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/models/User.php): `Proiect/REST/models/User.php`

### Persistence and auth

- [REST database](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/config/Database.php): `Proiect/REST/config/Database.php`
- [JWT library](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/REST/config/JWT/php-jwt-master/src/JWT.php): `Proiect/REST/config/JWT/php-jwt-master/src/JWT.php`

### Session implementation

- [Session charting](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/View/vchartcomparatie.js): `Proiect/sesiune/View/vchartcomparatie.js`
- [Year query controller](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/Controller/cgetbyyears.js): `Proiect/sesiune/Controller/cgetbyyears.js`
- [Session add endpoint](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/Model/MAaddinformations.php): `Proiect/sesiune/Model/MAaddinformations.php`
- [Session database](https://github.com/yontu24/php-mvc-example-tw-project/blob/master/Proiect/sesiune/DB/database.php): `Proiect/sesiune/DB/database.php`

### Other components

- **Visualizer user**

## Connections

- Visualizer user → Web entry: opens
- Web entry → MVC router: starts (evidence: `Proiect/public/index.php`)
- MVC router → Page controllers: routes to (evidence: `Proiect/app/core/App.php`)
- MVC router → Controller base: dispatches through
- Controller base → Visualizer pages: loads (evidence: `Proiect/app/core/Controller.php`)
- Controller base → Filter models: loads model (evidence: `Proiect/app/core/Controller.php`)
- Year model → HTTP data client: uses (evidence: `Proiect/app/models/Year.php`)
- Year model → Information endpoints: requests years (evidence: `Proiect/app/models/Year.php`)
- Filter models → HTTP data client: uses (evidence: `Proiect/app/models/AllFilters.php`)
- Location model → HTTP data client: uses (evidence: `Proiect/app/models/Location.php`)
- Category model → HTTP data client: uses (evidence: `Proiect/app/models/Category.php`)
- Response model → HTTP data client: uses (evidence: `Proiect/app/models/Response.php`)
- Comparison model → HTTP data client: uses (evidence: `Proiect/app/models/Comparison.php`)
- Information endpoints → Information model: uses (evidence: `Proiect/REST/api/info/delete.php`)
- Information endpoints → REST database: opens connection (evidence: `Proiect/REST/api/info/delete.php`)
- Information endpoints → JWT library: verifies token (evidence: `Proiect/REST/api/info/delete.php`)
- User endpoints → User model: uses (evidence: `Proiect/REST/api/user/read.php`)
- User endpoints → REST database: opens connection (evidence: `Proiect/REST/api/user/read.php`)
- User endpoints → JWT library: verifies token (evidence: `Proiect/REST/api/user/read.php`)
- Information model → REST database: queries
- Session charting → Year query controller: requests years (evidence: `Proiect/sesiune/View/vchartcomparatie.js`)
- Session add endpoint → Session database: opens connection (evidence: `Proiect/sesiune/Model/MAaddinformations.php`)
- Session add endpoint → JWT library: verifies token (evidence: `Proiect/sesiune/Model/MAaddinformations.php`)
