# evans2k25/cms architecture

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

- Interactive diagram: https://gitdiagram.com/evans2k25/cms
- Repository: https://github.com/evans2k25/cms

## Overview

Mon Journal is a PHP/MySQL journal CMS. Readers browse the homepage, search, and view articles or categories; administrators sign in to manage articles, categories, tags, and media. The excerpts show database access, session-based authentication, and media upload handling. The README provides only test credentials, so capability details beyond the sampled code are inferred from the repository tree; unsampled feature wiring is not expanded.

Main entry points: [`app/config/database.php`](https://github.com/evans2k25/cms/blob/main/app/config/database.php) (PDO connection), [`helpers/auth.php`](https://github.com/evans2k25/cms/blob/main/helpers/auth.php) (Session auth), [`admin/articles/create.php`](https://github.com/evans2k25/cms/blob/main/admin/articles/create.php) (Article management), [`public/index.php`](https://github.com/evans2k25/cms/blob/main/public/index.php) (Article home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reader["Public reading"]
  node_home["Article home<br/>[index.php]"]
  node_search["Article search<br/>[search.php]"]
  node_article["Article view<br/>[article.php]"]
  node_category["Category view<br/>[category.php]"]
end

subgraph group_admin["Administration"]
  node_login["Admin login<br/>[login.php]"]
  node_dashboard["Admin dashboard<br/>[dashboard.php]"]
  node_provision["Admin provisioning<br/>[create-admin.php]"]
  node_articles["Article management<br/>[create.php]"]
  node_preview["Article preview<br/>[preview.php]"]
  node_categories["Category management<br/>[index.php]"]
  node_tags["Tag management<br/>[index.php]"]
  node_media["Media management<br/>[upload.php]"]
end

subgraph group_runtime["Runtime and data"]
  node_auth["Session auth<br/>[auth.php]"]
  node_config["App config<br/>[config.php]"]
  node_database["PDO connection<br/>[database.php]"]
  node_schema[("CMS schema<br/>[journal_cms.sql]")]
end

node_visitor(("Reader"))

node_visitor -->|"browses"| node_home
node_visitor -->|"searches"| node_search
node_visitor -.->|"opens article"| node_article
node_visitor -.->|"opens category"| node_category
node_home -->|"links to"| node_search
node_home -->|"queries"| node_database
node_search -->|"queries"| node_database
node_article -->|"queries"| node_database
node_category -->|"queries"| node_database
node_login -->|"checks user"| node_database
node_login -->|"checks session"| node_auth
node_dashboard -->|"requires login"| node_auth
node_articles -->|"requires login"| node_auth
node_articles -->|"reads and writes"| node_database
node_articles -->|"links preview"| node_preview
node_preview -->|"requires login"| node_auth
node_preview -->|"loads article"| node_database
node_categories -->|"requires login"| node_auth
node_categories -->|"queries"| node_database
node_tags -->|"requires login"| node_auth
node_tags -->|"queries"| node_database
node_media -->|"requires login"| node_auth
node_media -->|"stores metadata"| node_database
node_provision -.->|"creates account"| node_database
node_database -.->|"uses schema"| node_schema
node_home -->|"loads settings"| node_config
node_search -->|"loads settings"| node_config
node_articles -->|"loads settings"| node_config
node_database -.->|"connects with settings"| node_config

click node_home "https://github.com/evans2k25/cms/blob/main/public/index.php"
click node_search "https://github.com/evans2k25/cms/blob/main/public/search.php"
click node_article "https://github.com/evans2k25/cms/blob/main/public/article.php"
click node_category "https://github.com/evans2k25/cms/blob/main/public/category.php"
click node_login "https://github.com/evans2k25/cms/blob/main/admin/login.php"
click node_auth "https://github.com/evans2k25/cms/blob/main/helpers/auth.php"
click node_dashboard "https://github.com/evans2k25/cms/blob/main/admin/dashboard.php"
click node_provision "https://github.com/evans2k25/cms/blob/main/admin/create-admin.php"
click node_articles "https://github.com/evans2k25/cms/blob/main/admin/articles/create.php"
click node_preview "https://github.com/evans2k25/cms/blob/main/admin/articles/preview.php"
click node_categories "https://github.com/evans2k25/cms/blob/main/admin/categories/index.php"
click node_tags "https://github.com/evans2k25/cms/blob/main/admin/tags/index.php"
click node_media "https://github.com/evans2k25/cms/blob/main/admin/media/upload.php"
click node_config "https://github.com/evans2k25/cms/blob/main/app/config/config.php"
click node_database "https://github.com/evans2k25/cms/blob/main/app/config/database.php"
click node_schema "https://github.com/evans2k25/cms/blob/main/database/journal_cms.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_home,node_search,node_article,node_category toneBlue
class node_login,node_dashboard,node_provision,node_articles,node_preview,node_categories,node_tags,node_media toneAmber
class node_auth,node_config,node_database,node_schema toneMint
class node_visitor toneIndigo
```

## Components

### Public reading

- [Article home](https://github.com/evans2k25/cms/blob/main/public/index.php): `public/index.php`
- [Article search](https://github.com/evans2k25/cms/blob/main/public/search.php): `public/search.php`
- [Article view](https://github.com/evans2k25/cms/blob/main/public/article.php): `public/article.php`
- [Category view](https://github.com/evans2k25/cms/blob/main/public/category.php): `public/category.php`

### Administration

- [Admin login](https://github.com/evans2k25/cms/blob/main/admin/login.php): `admin/login.php`
- [Admin dashboard](https://github.com/evans2k25/cms/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Admin provisioning](https://github.com/evans2k25/cms/blob/main/admin/create-admin.php): `admin/create-admin.php`
- [Article management](https://github.com/evans2k25/cms/blob/main/admin/articles/create.php): `admin/articles/create.php`
- [Article preview](https://github.com/evans2k25/cms/blob/main/admin/articles/preview.php): `admin/articles/preview.php`
- [Category management](https://github.com/evans2k25/cms/blob/main/admin/categories/index.php): `admin/categories/index.php`
- [Tag management](https://github.com/evans2k25/cms/blob/main/admin/tags/index.php): `admin/tags/index.php`
- [Media management](https://github.com/evans2k25/cms/blob/main/admin/media/upload.php): `admin/media/upload.php`

### Runtime and data

- [Session auth](https://github.com/evans2k25/cms/blob/main/helpers/auth.php): `helpers/auth.php`
- [App config](https://github.com/evans2k25/cms/blob/main/app/config/config.php): `app/config/config.php`
- [PDO connection](https://github.com/evans2k25/cms/blob/main/app/config/database.php): `app/config/database.php`
- [CMS schema](https://github.com/evans2k25/cms/blob/main/database/journal_cms.sql): `database/journal_cms.sql`

### Other components

- **Reader**

## Connections

- Reader → Article home: browses (evidence: `public/index.php`)
- Reader → Article search: searches
- Reader → Article view: opens article
- Reader → Category view: opens category
- Article home → Article search: links to (evidence: `public/index.php`)
- Article home → PDO connection: queries (evidence: `public/index.php`)
- Article search → PDO connection: queries (evidence: `public/search.php`)
- Article view → PDO connection: queries (evidence: `public/article.php`)
- Category view → PDO connection: queries (evidence: `public/category.php`)
- Admin login → PDO connection: checks user (evidence: `admin/login.php`)
- Admin login → Session auth: checks session (evidence: `admin/login.php`)
- Admin dashboard → Session auth: requires login (evidence: `admin/dashboard.php`)
- Article management → Session auth: requires login (evidence: `admin/articles/create.php`)
- Article management → PDO connection: reads and writes (evidence: `admin/articles/create.php`)
- Article management → Article preview: links preview (evidence: `admin/articles/preview.php`)
- Article preview → Session auth: requires login (evidence: `admin/articles/preview.php`)
- Article preview → PDO connection: loads article (evidence: `admin/articles/preview.php`)
- Category management → Session auth: requires login (evidence: `admin/categories/index.php`)
- Category management → PDO connection: queries (evidence: `admin/categories/index.php`)
- Tag management → Session auth: requires login (evidence: `admin/tags/index.php`)
- Tag management → PDO connection: queries (evidence: `admin/tags/index.php`)
- Media management → Session auth: requires login (evidence: `admin/media/upload.php`)
- Media management → PDO connection: stores metadata (evidence: `admin/media/upload.php`)
- Admin provisioning → PDO connection: creates account (evidence: `admin/create-admin.php`)
- PDO connection → CMS schema: uses schema
- Article home → App config: loads settings (evidence: `public/index.php`)
- Article search → App config: loads settings (evidence: `public/search.php`)
- Article management → App config: loads settings (evidence: `admin/articles/create.php`)
- PDO connection → App config: connects with settings
