# lemoniannecode/blog architecture

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

- Interactive diagram: https://gitdiagram.com/lemoniannecode/blog
- Repository: https://github.com/lemoniannecode/blog

## Overview

This is a PHP/MySQL blog application with account registration and login, an authenticated post feed with image uploads and owner-controlled editing, and a separate administrator workflow for listing, deleting, and updating accounts. The main request handlers perform database operations directly through the shared connection include. The excerpts show those calls and the image-file operations; the SQL files are listed in the tree but were not sampled, so schema details are not inferred.

Main entry points: [`index.php`](https://github.com/lemoniannecode/blog/blob/main/index.php) (Login), [`Admin/index.php`](https://github.com/lemoniannecode/blog/blob/main/Admin/index.php) (Account listing), [`includes/db_conn.php`](https://github.com/lemoniannecode/blog/blob/main/includes/db_conn.php) (MySQL connection), [`registration.php`](https://github.com/lemoniannecode/blog/blob/main/registration.php) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and access"]
  node_login["Login<br/>[index.php]"]
  node_registration["Registration<br/>[registration.php]"]
  node_login_error["Login error<br/>[error.php]"]
end

subgraph group_blog["Blog publishing"]
  node_feed["Post feed and actions<br/>[index.php]"]
  node_image_files["Uploaded images"]
end

subgraph group_admin["Account administration"]
  node_admin_panel["Account listing<br/>[index.php]"]
  node_delete_account["Delete account<br/>[del.php]"]
  node_update_account["Update account<br/>[upd.php]"]
end

subgraph group_persistence["Persistence"]
  node_connection["MySQL connection<br/>[db_conn.php]"]
  node_mysql[("Blogsite database")]
end

node_visitor(("Visitor"))

node_visitor -->|"submits credentials"| node_login
node_visitor -->|"submits details"| node_registration
node_login -->|"offers signup"| node_registration
node_registration -->|"links back"| node_login
node_login -->|"includes"| node_connection
node_login -->|"checks credentials"| node_mysql
node_login -->|"redirects on success"| node_feed
node_login -->|"redirects on failure"| node_login_error
node_registration -->|"includes"| node_connection
node_registration -->|"creates account"| node_mysql
node_feed -->|"includes"| node_connection
node_feed -->|"reads and changes posts"| node_mysql
node_feed -->|"saves and removes images"| node_image_files
node_visitor -->|"views and submits posts"| node_feed
node_visitor -->|"uses admin panel"| node_admin_panel
node_admin_panel -->|"includes"| node_connection
node_admin_panel -->|"lists accounts"| node_mysql
node_admin_panel -->|"links to deletion"| node_delete_account
node_admin_panel -->|"links to editing"| node_update_account
node_delete_account -->|"includes"| node_connection
node_delete_account -->|"deletes and lists accounts"| node_mysql
node_update_account -->|"includes"| node_connection
node_update_account -->|"reads and updates account"| node_mysql
node_delete_account -->|"offers return"| node_admin_panel
node_update_account -->|"offers return"| node_admin_panel
node_connection -->|"opens connection"| node_mysql

click node_login "https://github.com/lemoniannecode/blog/blob/main/index.php"
click node_registration "https://github.com/lemoniannecode/blog/blob/main/registration.php"
click node_login_error "https://github.com/lemoniannecode/blog/blob/main/error.php"
click node_feed "https://github.com/lemoniannecode/blog/blob/main/mainpage/index.php"
click node_image_files "https://github.com/lemoniannecode/blog/tree/main/imgstorage"
click node_admin_panel "https://github.com/lemoniannecode/blog/blob/main/Admin/index.php"
click node_delete_account "https://github.com/lemoniannecode/blog/blob/main/Admin/del.php"
click node_update_account "https://github.com/lemoniannecode/blog/blob/main/Admin/upd.php"
click node_connection "https://github.com/lemoniannecode/blog/blob/main/includes/db_conn.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_login,node_registration,node_login_error toneBlue
class node_feed,node_image_files toneAmber
class node_admin_panel,node_delete_account,node_update_account toneMint
class node_connection,node_mysql toneRose
class node_visitor toneIndigo
```

## Components

### Accounts and access

- [Login](https://github.com/lemoniannecode/blog/blob/main/index.php): `index.php`
- [Registration](https://github.com/lemoniannecode/blog/blob/main/registration.php): `registration.php`
- [Login error](https://github.com/lemoniannecode/blog/blob/main/error.php): `error.php`

### Blog publishing

- [Post feed and actions](https://github.com/lemoniannecode/blog/blob/main/mainpage/index.php): `mainpage/index.php`
- [Uploaded images](https://github.com/lemoniannecode/blog/tree/main/imgstorage): `imgstorage`

### Account administration

- [Account listing](https://github.com/lemoniannecode/blog/blob/main/Admin/index.php): `Admin/index.php`
- [Delete account](https://github.com/lemoniannecode/blog/blob/main/Admin/del.php): `Admin/del.php`
- [Update account](https://github.com/lemoniannecode/blog/blob/main/Admin/upd.php): `Admin/upd.php`

### Persistence

- [MySQL connection](https://github.com/lemoniannecode/blog/blob/main/includes/db_conn.php): `includes/db_conn.php`
- **Blogsite database**

### Other components

- **Visitor**

## Connections

- Visitor → Login: submits credentials (evidence: `index.php`)
- Visitor → Registration: submits details (evidence: `registration.php`)
- Login → Registration: offers signup (evidence: `index.php`)
- Registration → Login: links back (evidence: `registration.php`)
- Login → MySQL connection: includes (evidence: `index.php`)
- Login → Blogsite database: checks credentials (evidence: `index.php`)
- Login → Post feed and actions: redirects on success (evidence: `index.php`)
- Login → Login error: redirects on failure (evidence: `index.php`)
- Registration → MySQL connection: includes (evidence: `registration.php`)
- Registration → Blogsite database: creates account (evidence: `registration.php`)
- Post feed and actions → MySQL connection: includes (evidence: `mainpage/index.php`)
- Post feed and actions → Blogsite database: reads and changes posts (evidence: `mainpage/index.php`)
- Post feed and actions → Uploaded images: saves and removes images (evidence: `mainpage/index.php`)
- Visitor → Post feed and actions: views and submits posts (evidence: `mainpage/index.php`)
- Visitor → Account listing: uses admin panel (evidence: `Admin/index.php`)
- Account listing → MySQL connection: includes (evidence: `Admin/index.php`)
- Account listing → Blogsite database: lists accounts (evidence: `Admin/index.php`)
- Account listing → Delete account: links to deletion (evidence: `Admin/index.php`)
- Account listing → Update account: links to editing (evidence: `Admin/index.php`)
- Delete account → MySQL connection: includes (evidence: `Admin/del.php`)
- Delete account → Blogsite database: deletes and lists accounts (evidence: `Admin/del.php`)
- Update account → MySQL connection: includes (evidence: `Admin/upd.php`)
- Update account → Blogsite database: reads and updates account (evidence: `Admin/upd.php`)
- Delete account → Account listing: offers return (evidence: `Admin/del.php`)
- Update account → Account listing: offers return (evidence: `Admin/upd.php`)
- MySQL connection → Blogsite database: opens connection (evidence: `includes/db_conn.php`)
