# axb2002/project architecture

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

- Interactive diagram: https://gitdiagram.com/axb2002/project
- Repository: https://github.com/axb2002/project

## Overview

This is a PHP MVC web application for the Port-Cartier municipal library. Users enter through the URL dispatcher, authenticate, then search documents and make reservations; employees and administrators can also manage reservations and member records. The README additionally describes loan/return workflows, account creation, and staff reports. Sampled code supports the dispatcher, document/reservation actions, and shared rendering; loan/return and some report details are documented but their implementation was not sampled.

Main entry points: [`view/template-frontend.php`](https://github.com/axb2002/project/blob/main/view/template-frontend.php) (Frontend layout), [`index.php`](https://github.com/axb2002/project/blob/main/index.php) (URL dispatcher), [`controller/ControllerDocument.php`](https://github.com/axb2002/project/blob/main/controller/ControllerDocument.php) (Document actions), [`library/Template.php`](https://github.com/axb2002/project/blob/main/library/Template.php) (Template renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and views"]
  node_router["URL dispatcher<br/>[index.php]"]
  node_template["Template renderer<br/>[Template.php]"]
  node_frontend["Frontend layout"]
  node_loginview["Login form<br/>[connexion.php]"]
  node_docview["Document list"]
  node_reservationview["Reservation list"]
  node_usercreateview["User creation form"]
  node_userlistview["User list"]
end

subgraph group_accounts["Accounts and access"]
  node_authcontroller["Authentication actions"]
  node_usercontroller["User management"]
  node_validation["Input validation<br/>[Validation.php]"]
  node_utilisateur["User model<br/>[Utilisateur.php]"]
end

subgraph group_circulation["Catalog and circulation"]
  node_doccontroller["Document actions"]
  node_reservationcontroller["Reservation actions"]
  node_document["Document model<br/>[Document.php]"]
  node_reservation["Reservation model<br/>[Reservation.php]"]
  node_loanops["Loan and return management"]
end

subgraph group_data["Persistence"]
  node_crud["PDO CRUD base<br/>[CRUD.php]"]
  node_mysql[("MySQL library database")]
  node_schema["Library schema and seeds"]
end

node_visitor(("Library user"))

node_visitor -->|"requests pages"| node_router
node_router -->|"dispatches login"| node_authcontroller
node_router -->|"dispatches document actions"| node_doccontroller
node_router -->|"dispatches reservation actions"| node_reservationcontroller
node_router -->|"dispatches user actions"| node_usercontroller
node_authcontroller -->|"checks credentials"| node_utilisateur
node_authcontroller -->|"uses validation"| node_validation
node_usercontroller -->|"manages users"| node_utilisateur
node_usercontroller -->|"validates input"| node_validation
node_doccontroller -->|"searches and reserves"| node_document
node_doccontroller -->|"checks and updates status"| node_reservation
node_doccontroller -->|"loads members"| node_utilisateur
node_reservationcontroller -->|"searches and cancels"| node_reservation
node_authcontroller -->|"renders login"| node_template
node_doccontroller -->|"renders document pages"| node_template
node_reservationcontroller -->|"renders reservation list"| node_template
node_usercontroller -->|"renders user pages"| node_template
node_template -->|"uses layout"| node_frontend
node_frontend -->|"includes page"| node_loginview
node_frontend -->|"includes page"| node_docview
node_frontend -->|"includes page"| node_reservationview
node_frontend -->|"includes page"| node_usercreateview
node_frontend -->|"includes page"| node_userlistview
node_utilisateur -->|"extends"| node_crud
node_document -->|"extends"| node_crud
node_reservation -->|"extends"| node_crud
node_crud -->|"connects and queries"| node_mysql
node_schema -.->|"defines tables"| node_mysql

click node_router "https://github.com/axb2002/project/blob/main/index.php"
click node_template "https://github.com/axb2002/project/blob/main/library/Template.php"
click node_frontend "https://github.com/axb2002/project/blob/main/view/template-frontend.php"
click node_loginview "https://github.com/axb2002/project/blob/main/view/connexion.php"
click node_docview "https://github.com/axb2002/project/blob/main/view/lister-documents.php"
click node_reservationview "https://github.com/axb2002/project/blob/main/view/lister-reservations.php"
click node_usercreateview "https://github.com/axb2002/project/blob/main/view/creer-utilisateur.php"
click node_userlistview "https://github.com/axb2002/project/blob/main/view/lister-utilisateurs.php"
click node_authcontroller "https://github.com/axb2002/project/blob/main/controller/ControllerConnexion.php"
click node_usercontroller "https://github.com/axb2002/project/blob/main/controller/ControllerUtilisateur.php"
click node_validation "https://github.com/axb2002/project/blob/main/library/Validation.php"
click node_utilisateur "https://github.com/axb2002/project/blob/main/model/Utilisateur.php"
click node_doccontroller "https://github.com/axb2002/project/blob/main/controller/ControllerDocument.php"
click node_reservationcontroller "https://github.com/axb2002/project/blob/main/controller/ControllerReservation.php"
click node_document "https://github.com/axb2002/project/blob/main/model/Document.php"
click node_reservation "https://github.com/axb2002/project/blob/main/model/Reservation.php"
click node_loanops "https://github.com/axb2002/project/tree/main/controller"
click node_crud "https://github.com/axb2002/project/blob/main/model/CRUD.php"
click node_schema "https://github.com/axb2002/project/blob/main/_DATABASE/Query_1%20-%20Creation%20des%20tables.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_router,node_template,node_frontend,node_loginview,node_docview,node_reservationview,node_usercreateview,node_userlistview,node_visitor toneBlue
class node_authcontroller,node_usercontroller,node_validation,node_utilisateur toneAmber
class node_doccontroller,node_reservationcontroller,node_document,node_reservation,node_loanops toneMint
class node_crud,node_mysql,node_schema toneRose
```

## Components

### Web entry and views

- [URL dispatcher](https://github.com/axb2002/project/blob/main/index.php): `index.php`
- [Template renderer](https://github.com/axb2002/project/blob/main/library/Template.php): `library/Template.php`
- [Frontend layout](https://github.com/axb2002/project/blob/main/view/template-frontend.php): `view/template-frontend.php`
- [Login form](https://github.com/axb2002/project/blob/main/view/connexion.php): `view/connexion.php`
- [Document list](https://github.com/axb2002/project/blob/main/view/lister-documents.php): `view/lister-documents.php`
- [Reservation list](https://github.com/axb2002/project/blob/main/view/lister-reservations.php): `view/lister-reservations.php`
- [User creation form](https://github.com/axb2002/project/blob/main/view/creer-utilisateur.php): `view/creer-utilisateur.php`
- [User list](https://github.com/axb2002/project/blob/main/view/lister-utilisateurs.php): `view/lister-utilisateurs.php`

### Accounts and access

- [Authentication actions](https://github.com/axb2002/project/blob/main/controller/ControllerConnexion.php): `controller/ControllerConnexion.php`
- [User management](https://github.com/axb2002/project/blob/main/controller/ControllerUtilisateur.php): `controller/ControllerUtilisateur.php`
- [Input validation](https://github.com/axb2002/project/blob/main/library/Validation.php): `library/Validation.php`
- [User model](https://github.com/axb2002/project/blob/main/model/Utilisateur.php): `model/Utilisateur.php`

### Catalog and circulation

- [Document actions](https://github.com/axb2002/project/blob/main/controller/ControllerDocument.php): `controller/ControllerDocument.php`
- [Reservation actions](https://github.com/axb2002/project/blob/main/controller/ControllerReservation.php): `controller/ControllerReservation.php`
- [Document model](https://github.com/axb2002/project/blob/main/model/Document.php): `model/Document.php`
- [Reservation model](https://github.com/axb2002/project/blob/main/model/Reservation.php): `model/Reservation.php`
- [Loan and return management](https://github.com/axb2002/project/tree/main/controller): `controller`

### Persistence

- [PDO CRUD base](https://github.com/axb2002/project/blob/main/model/CRUD.php): `model/CRUD.php`
- **MySQL library database**
- [Library schema and seeds](https://github.com/axb2002/project/blob/main/_DATABASE/Query_1%20-%20Creation%20des%20tables.sql): `_DATABASE/Query_1 - Creation des tables.sql`

### Other components

- **Library user**

## Connections

- Library user → URL dispatcher: requests pages
- URL dispatcher → Authentication actions: dispatches login
- URL dispatcher → Document actions: dispatches document actions
- URL dispatcher → Reservation actions: dispatches reservation actions
- URL dispatcher → User management: dispatches user actions
- Authentication actions → User model: checks credentials
- Authentication actions → Input validation: uses validation
- User management → User model: manages users
- User management → Input validation: validates input
- Document actions → Document model: searches and reserves
- Document actions → Reservation model: checks and updates status
- Document actions → User model: loads members
- Reservation actions → Reservation model: searches and cancels
- Authentication actions → Template renderer: renders login
- Document actions → Template renderer: renders document pages
- Reservation actions → Template renderer: renders reservation list
- User management → Template renderer: renders user pages
- Template renderer → Frontend layout: uses layout
- Frontend layout → Login form: includes page
- Frontend layout → Document list: includes page
- Frontend layout → Reservation list: includes page
- Frontend layout → User creation form: includes page
- Frontend layout → User list: includes page
- User model → PDO CRUD base: extends
- Document model → PDO CRUD base: extends
- Reservation model → PDO CRUD base: extends
- PDO CRUD base → MySQL library database: connects and queries
- Library schema and seeds → MySQL library database: defines tables
