# hiannetto/ccmpt architecture

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

- Interactive diagram: https://gitdiagram.com/hiannetto/ccmpt
- Repository: https://github.com/hiannetto/ccmpt

## Overview

CCMPT is a decoupled cultural-center website and content-management back office: public visitors browse institutional pages, news, galleries, and historical artifacts, while staff authenticate and manage that content and incoming contacts. The Vue SPA communicates with a PHP REST API, whose routed controllers validate requests, apply domain operations, and persist through models to MySQL. The graph preserves the documented public and administrative capabilities. Some feature connections are supported only by route declarations or README descriptions; unsampled frontend/API details are not inferred beyond those links.

Main entry points: [`api/public/index.php`](https://github.com/hiannetto/ccmpt/blob/main/api/public/index.php) (API entry and routes), [`api/models`](https://github.com/hiannetto/ccmpt/tree/main/api/models) (Domain models), [`api/controllers/PostController.php`](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/PostController.php) (News and events), [`frontend/src/router/index.js`](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/router/index.js) (SPA routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Vue applications"]
  node_public_views["Public views"]
  node_admin_views["Admin views"]
  node_spa_router["SPA routes<br/>[index.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_auth_store["Auth state<br/>[auth.js]"]
  node_gallery_ui["Gallery editor<br/>[GalleryEdit.vue]"]
  node_gallery_detail_ui["Gallery detail<br/>[GalleryDetail.vue]"]
  node_memorial_ui["Memorial editor<br/>[MemorialForm.vue]"]
end

subgraph group_api["REST API"]
  node_api_entry["API entry and routes<br/>[index.php]"]
end

subgraph group_domain["Content domains"]
  node_auth_controller["Authentication<br/>[AuthController.php]"]
  node_users_controller["User management<br/>[UserController.php]"]
  node_posts_controller["News and events<br/>[PostController.php]"]
  node_pages_controller["Institutional pages<br/>[PageController.php]"]
  node_gallery_controller["Photo archive"]
  node_memorial_controller["Historical archive"]
  node_contacts_controller["Contact inbox"]
  node_stats_controller["Admin statistics"]
end

subgraph group_infra["Shared services"]
  node_models["Domain models"]
  node_image_service["Image processing<br/>[ImageService.php]"]
  node_request_input["Request validation<br/>[Input.php]"]
  node_request["HTTP request<br/>[Request.php]"]
  node_response["HTTP response<br/>[Response.php]"]
  node_database[("MySQL connection<br/>[Database.php]")]
  node_model_base["Model base<br/>[Model.php]"]
  node_config["Runtime configuration<br/>[Config.php]"]
end

node_visitor(("Public visitor"))
node_staff(("Admin staff"))

node_visitor -->|"opens site"| node_spa_router
node_staff -->|"opens back office"| node_spa_router
node_spa_router -->|"routes to"| node_public_views
node_spa_router -->|"routes to"| node_admin_views
node_spa_router -->|"checks access"| node_auth_store
node_gallery_ui -->|"requests data"| node_api_client
node_gallery_detail_ui -->|"requests data"| node_api_client
node_memorial_ui -->|"requests data"| node_api_client
node_api_client -.->|"calls REST API"| node_api_entry
node_api_entry -->|"routes requests"| node_auth_controller
node_api_entry -->|"routes requests"| node_users_controller
node_api_entry -->|"routes requests"| node_posts_controller
node_api_entry -->|"routes requests"| node_pages_controller
node_api_entry -->|"routes requests"| node_gallery_controller
node_api_entry -->|"routes requests"| node_memorial_controller
node_api_entry -->|"routes requests"| node_contacts_controller
node_api_entry -->|"routes requests"| node_stats_controller
node_auth_controller -->|"uses user model"| node_models
node_users_controller -->|"uses user model"| node_models
node_posts_controller -->|"reads and writes"| node_models
node_posts_controller -->|"processes cover"| node_image_service
node_gallery_controller -->|"reads and writes"| node_models
node_gallery_controller -->|"processes uploads"| node_image_service
node_memorial_controller -->|"reads and writes"| node_models
node_memorial_controller -->|"processes images"| node_image_service
node_contacts_controller -->|"manages messages"| node_models
node_pages_controller -->|"manages pages"| node_models
node_stats_controller -->|"queries counts"| node_database
node_posts_controller -->|"reads input"| node_request
node_posts_controller -->|"validates content"| node_request_input
node_gallery_controller -->|"reads uploads"| node_request
node_memorial_controller -->|"reads uploads"| node_request
node_model_base -->|"opens connection"| node_database
node_models -.->|"shares persistence"| node_model_base
node_database -->|"loads settings"| node_config
node_image_service -->|"loads upload settings"| node_config

click node_public_views "https://github.com/hiannetto/ccmpt/tree/main/frontend/src/views/public"
click node_admin_views "https://github.com/hiannetto/ccmpt/tree/main/frontend/src/views/admin"
click node_spa_router "https://github.com/hiannetto/ccmpt/blob/main/frontend/src/router/index.js"
click node_api_client "https://github.com/hiannetto/ccmpt/blob/main/frontend/src/api.js"
click node_auth_store "https://github.com/hiannetto/ccmpt/blob/main/frontend/src/store/auth.js"
click node_gallery_ui "https://github.com/hiannetto/ccmpt/blob/main/frontend/src/views/admin/GalleryEdit.vue"
click node_gallery_detail_ui "https://github.com/hiannetto/ccmpt/blob/main/frontend/src/views/public/GalleryDetail.vue"
click node_memorial_ui "https://github.com/hiannetto/ccmpt/blob/main/frontend/src/views/admin/MemorialForm.vue"
click node_api_entry "https://github.com/hiannetto/ccmpt/blob/main/api/public/index.php"
click node_auth_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/AuthController.php"
click node_users_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/UserController.php"
click node_posts_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/PostController.php"
click node_pages_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/PageController.php"
click node_gallery_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/GalleryController.php"
click node_memorial_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/MemorialController.php"
click node_contacts_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/ContactController.php"
click node_stats_controller "https://github.com/hiannetto/ccmpt/blob/main/api/controllers/StatsController.php"
click node_models "https://github.com/hiannetto/ccmpt/tree/main/api/models"
click node_image_service "https://github.com/hiannetto/ccmpt/blob/main/api/core/ImageService.php"
click node_request_input "https://github.com/hiannetto/ccmpt/blob/main/api/core/Input.php"
click node_request "https://github.com/hiannetto/ccmpt/blob/main/api/core/Request.php"
click node_response "https://github.com/hiannetto/ccmpt/blob/main/api/core/Response.php"
click node_database "https://github.com/hiannetto/ccmpt/blob/main/api/core/Database.php"
click node_model_base "https://github.com/hiannetto/ccmpt/blob/main/api/models/Model.php"
click node_config "https://github.com/hiannetto/ccmpt/blob/main/api/core/Config.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_public_views,node_admin_views,node_spa_router,node_api_client,node_auth_store,node_gallery_ui,node_gallery_detail_ui,node_memorial_ui toneBlue
class node_api_entry toneAmber
class node_auth_controller,node_users_controller,node_posts_controller,node_pages_controller,node_gallery_controller,node_memorial_controller,node_contacts_controller,node_stats_controller toneMint
class node_models,node_image_service,node_request_input,node_request,node_response,node_database,node_model_base,node_config toneRose
class node_visitor,node_staff toneIndigo
```

## Components

### Vue applications

- [Public views](https://github.com/hiannetto/ccmpt/tree/main/frontend/src/views/public): `frontend/src/views/public`
- [Admin views](https://github.com/hiannetto/ccmpt/tree/main/frontend/src/views/admin): `frontend/src/views/admin`
- [SPA routes](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/router/index.js): `frontend/src/router/index.js`
- [API client](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Auth state](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/store/auth.js): `frontend/src/store/auth.js`
- [Gallery editor](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/views/admin/GalleryEdit.vue): `frontend/src/views/admin/GalleryEdit.vue`
- [Gallery detail](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/views/public/GalleryDetail.vue): `frontend/src/views/public/GalleryDetail.vue`
- [Memorial editor](https://github.com/hiannetto/ccmpt/blob/main/frontend/src/views/admin/MemorialForm.vue): `frontend/src/views/admin/MemorialForm.vue`

### REST API

- [API entry and routes](https://github.com/hiannetto/ccmpt/blob/main/api/public/index.php): `api/public/index.php`

### Content domains

- [Authentication](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/AuthController.php): `api/controllers/AuthController.php`
- [User management](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/UserController.php): `api/controllers/UserController.php`
- [News and events](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/PostController.php): `api/controllers/PostController.php`
- [Institutional pages](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/PageController.php): `api/controllers/PageController.php`
- [Photo archive](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/GalleryController.php): `api/controllers/GalleryController.php`
- [Historical archive](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/MemorialController.php): `api/controllers/MemorialController.php`
- [Contact inbox](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/ContactController.php): `api/controllers/ContactController.php`
- [Admin statistics](https://github.com/hiannetto/ccmpt/blob/main/api/controllers/StatsController.php): `api/controllers/StatsController.php`

### Shared services

- [Domain models](https://github.com/hiannetto/ccmpt/tree/main/api/models): `api/models`
- [Image processing](https://github.com/hiannetto/ccmpt/blob/main/api/core/ImageService.php): `api/core/ImageService.php`
- [Request validation](https://github.com/hiannetto/ccmpt/blob/main/api/core/Input.php): `api/core/Input.php`
- [HTTP request](https://github.com/hiannetto/ccmpt/blob/main/api/core/Request.php): `api/core/Request.php`
- [HTTP response](https://github.com/hiannetto/ccmpt/blob/main/api/core/Response.php): `api/core/Response.php`
- [MySQL connection](https://github.com/hiannetto/ccmpt/blob/main/api/core/Database.php): `api/core/Database.php`
- [Model base](https://github.com/hiannetto/ccmpt/blob/main/api/models/Model.php): `api/models/Model.php`
- [Runtime configuration](https://github.com/hiannetto/ccmpt/blob/main/api/core/Config.php): `api/core/Config.php`

### Other components

- **Public visitor**
- **Admin staff**

## Connections

- Public visitor → SPA routes: opens site (evidence: `README.md`)
- Admin staff → SPA routes: opens back office (evidence: `README.md`)
- SPA routes → Public views: routes to (evidence: `frontend/src/router/index.js`)
- SPA routes → Admin views: routes to (evidence: `frontend/src/router/index.js`)
- SPA routes → Auth state: checks access (evidence: `frontend/src/router/index.js`)
- Gallery editor → API client: requests data (evidence: `frontend/src/views/admin/GalleryEdit.vue`)
- Gallery detail → API client: requests data (evidence: `frontend/src/views/public/GalleryDetail.vue`)
- Memorial editor → API client: requests data (evidence: `frontend/src/views/admin/MemorialForm.vue`)
- API client → API entry and routes: calls REST API (evidence: `README.md`)
- API entry and routes → Authentication: routes requests (evidence: `api/public/index.php`)
- API entry and routes → User management: routes requests (evidence: `api/public/index.php`)
- API entry and routes → News and events: routes requests (evidence: `api/public/index.php`)
- API entry and routes → Institutional pages: routes requests (evidence: `api/public/index.php`)
- API entry and routes → Photo archive: routes requests (evidence: `api/public/index.php`)
- API entry and routes → Historical archive: routes requests (evidence: `api/public/index.php`)
- API entry and routes → Contact inbox: routes requests (evidence: `api/public/index.php`)
- API entry and routes → Admin statistics: routes requests (evidence: `api/public/index.php`)
- Authentication → Domain models: uses user model (evidence: `api/controllers/AuthController.php`)
- User management → Domain models: uses user model (evidence: `api/controllers/UserController.php`)
- News and events → Domain models: reads and writes (evidence: `api/controllers/PostController.php`)
- News and events → Image processing: processes cover (evidence: `api/controllers/PostController.php`)
- Photo archive → Domain models: reads and writes (evidence: `api/controllers/GalleryController.php`)
- Photo archive → Image processing: processes uploads (evidence: `api/controllers/GalleryController.php`)
- Historical archive → Domain models: reads and writes (evidence: `api/controllers/MemorialController.php`)
- Historical archive → Image processing: processes images (evidence: `api/controllers/MemorialController.php`)
- Contact inbox → Domain models: manages messages (evidence: `api/controllers/ContactController.php`)
- Institutional pages → Domain models: manages pages (evidence: `api/controllers/PageController.php`)
- Admin statistics → MySQL connection: queries counts (evidence: `api/controllers/StatsController.php`)
- News and events → HTTP request: reads input (evidence: `api/controllers/PostController.php`)
- News and events → Request validation: validates content (evidence: `api/controllers/PostController.php`)
- Photo archive → HTTP request: reads uploads (evidence: `api/controllers/GalleryController.php`)
- Historical archive → HTTP request: reads uploads (evidence: `api/controllers/MemorialController.php`)
- Model base → MySQL connection: opens connection (evidence: `api/models/Model.php`)
- Domain models → Model base: shares persistence (evidence: `api/models/MemorialItem.php`)
- MySQL connection → Runtime configuration: loads settings (evidence: `api/core/Database.php`)
- Image processing → Runtime configuration: loads upload settings (evidence: `api/core/ImageService.php`)
