# sivavinay07/blog_system architecture

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

- Interactive diagram: https://gitdiagram.com/sivavinay07/blog_system
- Repository: https://github.com/sivavinay07/blog_system

## Overview

This is a PHP blog application for publishing and browsing categorized posts, with accounts, comments requiring moderation, and administrative controls. The main visitor flow lists and filters posts, opens a post, and displays approved comments; signed-in users can submit posts or comments, while administrators manage posts, categories, and comment approval. The graph reflects calls visible in excerpts and file references in the source index; some endpoints and configuration internals were not sampled, so their behavior and connections are not expanded.

Main entry points: [`classes/Post.php`](https://github.com/sivavinay07/blog_system/blob/main/classes/Post.php) (Post operations), [`classes/Category.php`](https://github.com/sivavinay07/blog_system/blob/main/classes/Category.php) (Category operations), [`index.php`](https://github.com/sivavinay07/blog_system/blob/main/index.php) (Browse posts), [`includes/header.php`](https://github.com/sivavinay07/blog_system/blob/main/includes/header.php) (Shared header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_publishing["Post publishing"]
  node_home["Browse posts<br/>[index.php]"]
  node_post_detail["View post<br/>[view_post.php]"]
  node_author_dashboard["Author dashboard<br/>[dashboard.php]"]
  node_create_post["Create post<br/>[create_post.php]"]
  node_edit_post["Edit post<br/>[edit_post.php]"]
  node_admin_dashboard["Admin dashboard"]
  node_post_service["Post operations<br/>[Post.php]"]
  node_category_admin["Add category<br/>[add_category.php]"]
  node_category_service["Category operations<br/>[Category.php]"]
end

subgraph group_community["Community features"]
  node_comments["Post comments<br/>[Comment.php]"]
  node_comment_moderation["Approve comments"]
end

subgraph group_identity["Accounts and access"]
  node_register["Register account<br/>[register.php]"]
  node_login["Sign in<br/>[login.php]"]
  node_logout["Sign out<br/>[logout.php]"]
  node_user_service["User operations<br/>[User.php]"]
end

subgraph group_runtime["Shared runtime and data"]
  node_shared_header["Shared header<br/>[header.php]"]
  node_shared_footer["Shared footer<br/>[footer.php]"]
  node_configuration["Database configuration<br/>[config.php]"]
  node_database[("Application database")]
end

node_visitor(("Visitor"))
node_author(("Signed-in user"))
node_administrator(("Administrator"))

node_visitor -->|"browses"| node_home
node_home -->|"fetches posts"| node_post_service
node_home -->|"fetches categories"| node_category_service
node_visitor -->|"opens post"| node_post_detail
node_post_detail -->|"loads post"| node_post_service
node_post_detail -->|"loads comments"| node_comments
node_author -->|"submits post"| node_create_post
node_create_post -->|"loads categories"| node_category_service
node_create_post -->|"creates post"| node_post_service
node_author -->|"submits comment"| node_post_detail
node_post_detail -->|"creates comment"| node_comments
node_administrator -->|"manages content"| node_admin_dashboard
node_admin_dashboard -->|"loads recent posts"| node_post_service
node_administrator -->|"edits post"| node_edit_post
node_edit_post -->|"loads and updates"| node_post_service
node_edit_post -->|"loads categories"| node_category_service
node_administrator -->|"adds category"| node_category_admin
node_category_admin -->|"adds category"| node_category_service
node_administrator -->|"reviews comments"| node_comment_moderation
node_comment_moderation -->|"lists and approves"| node_comments
node_visitor -->|"registers"| node_register
node_visitor -->|"signs in"| node_login
node_register -->|"creates account"| node_user_service
node_login -->|"authenticates"| node_user_service
node_author -->|"signs out"| node_logout
node_logout -->|"ends session"| node_user_service
node_home -->|"includes"| node_shared_header
node_home -->|"includes"| node_shared_footer
node_shared_header -->|"initializes"| node_user_service
node_shared_header -->|"initializes"| node_post_service
node_shared_header -->|"initializes"| node_comments
node_shared_header -->|"initializes"| node_category_service
node_post_service -->|"queries"| node_database
node_category_service -->|"queries"| node_database
node_comments -->|"queries"| node_database
node_user_service -->|"queries"| node_database

click node_home "https://github.com/sivavinay07/blog_system/blob/main/index.php"
click node_post_detail "https://github.com/sivavinay07/blog_system/blob/main/view_post.php"
click node_author_dashboard "https://github.com/sivavinay07/blog_system/blob/main/dashboard.php"
click node_create_post "https://github.com/sivavinay07/blog_system/blob/main/create_post.php"
click node_edit_post "https://github.com/sivavinay07/blog_system/blob/main/edit_post.php"
click node_admin_dashboard "https://github.com/sivavinay07/blog_system/blob/main/admin_dashboard.php"
click node_post_service "https://github.com/sivavinay07/blog_system/blob/main/classes/Post.php"
click node_category_admin "https://github.com/sivavinay07/blog_system/blob/main/add_category.php"
click node_category_service "https://github.com/sivavinay07/blog_system/blob/main/classes/Category.php"
click node_comments "https://github.com/sivavinay07/blog_system/blob/main/classes/Comment.php"
click node_comment_moderation "https://github.com/sivavinay07/blog_system/blob/main/approve_comments.php"
click node_register "https://github.com/sivavinay07/blog_system/blob/main/register.php"
click node_login "https://github.com/sivavinay07/blog_system/blob/main/login.php"
click node_logout "https://github.com/sivavinay07/blog_system/blob/main/logout.php"
click node_user_service "https://github.com/sivavinay07/blog_system/blob/main/classes/User.php"
click node_shared_header "https://github.com/sivavinay07/blog_system/blob/main/includes/header.php"
click node_shared_footer "https://github.com/sivavinay07/blog_system/blob/main/includes/footer.php"
click node_configuration "https://github.com/sivavinay07/blog_system/blob/main/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_home,node_post_detail,node_author_dashboard,node_create_post,node_edit_post,node_admin_dashboard,node_post_service,node_category_admin,node_category_service,node_author toneBlue
class node_comments,node_comment_moderation toneAmber
class node_register,node_login,node_logout,node_user_service toneMint
class node_shared_header,node_shared_footer,node_configuration,node_database toneRose
class node_visitor,node_administrator toneIndigo
```

## Components

### Post publishing

- [Browse posts](https://github.com/sivavinay07/blog_system/blob/main/index.php): `index.php`
- [View post](https://github.com/sivavinay07/blog_system/blob/main/view_post.php): `view_post.php`
- [Author dashboard](https://github.com/sivavinay07/blog_system/blob/main/dashboard.php): `dashboard.php`
- [Create post](https://github.com/sivavinay07/blog_system/blob/main/create_post.php): `create_post.php`
- [Edit post](https://github.com/sivavinay07/blog_system/blob/main/edit_post.php): `edit_post.php`
- [Admin dashboard](https://github.com/sivavinay07/blog_system/blob/main/admin_dashboard.php): `admin_dashboard.php`
- [Post operations](https://github.com/sivavinay07/blog_system/blob/main/classes/Post.php): `classes/Post.php`
- [Add category](https://github.com/sivavinay07/blog_system/blob/main/add_category.php): `add_category.php`
- [Category operations](https://github.com/sivavinay07/blog_system/blob/main/classes/Category.php): `classes/Category.php`

### Community features

- [Post comments](https://github.com/sivavinay07/blog_system/blob/main/classes/Comment.php): `classes/Comment.php`
- [Approve comments](https://github.com/sivavinay07/blog_system/blob/main/approve_comments.php): `approve_comments.php`

### Accounts and access

- [Register account](https://github.com/sivavinay07/blog_system/blob/main/register.php): `register.php`
- [Sign in](https://github.com/sivavinay07/blog_system/blob/main/login.php): `login.php`
- [Sign out](https://github.com/sivavinay07/blog_system/blob/main/logout.php): `logout.php`
- [User operations](https://github.com/sivavinay07/blog_system/blob/main/classes/User.php): `classes/User.php`

### Shared runtime and data

- [Shared header](https://github.com/sivavinay07/blog_system/blob/main/includes/header.php): `includes/header.php`
- [Shared footer](https://github.com/sivavinay07/blog_system/blob/main/includes/footer.php): `includes/footer.php`
- [Database configuration](https://github.com/sivavinay07/blog_system/blob/main/config.php): `config.php`
- **Application database**

### Other components

- **Visitor**
- **Signed-in user**
- **Administrator**

## Connections

- Visitor → Browse posts: browses (evidence: `index.php`)
- Browse posts → Post operations: fetches posts (evidence: `index.php`)
- Browse posts → Category operations: fetches categories (evidence: `index.php`)
- Visitor → View post: opens post
- View post → Post operations: loads post (evidence: `view_post.php`)
- View post → Post comments: loads comments (evidence: `view_post.php`)
- Signed-in user → Create post: submits post (evidence: `create_post.php`)
- Create post → Category operations: loads categories (evidence: `create_post.php`)
- Create post → Post operations: creates post (evidence: `create_post.php`)
- Signed-in user → View post: submits comment (evidence: `view_post.php`)
- View post → Post comments: creates comment (evidence: `view_post.php`)
- Administrator → Admin dashboard: manages content (evidence: `admin_dashboard.php`)
- Admin dashboard → Post operations: loads recent posts (evidence: `admin_dashboard.php`)
- Administrator → Edit post: edits post (evidence: `edit_post.php`)
- Edit post → Post operations: loads and updates (evidence: `edit_post.php`)
- Edit post → Category operations: loads categories (evidence: `edit_post.php`)
- Administrator → Add category: adds category (evidence: `add_category.php`)
- Add category → Category operations: adds category (evidence: `add_category.php`)
- Administrator → Approve comments: reviews comments (evidence: `approve_comments.php`)
- Approve comments → Post comments: lists and approves (evidence: `approve_comments.php`)
- Visitor → Register account: registers (evidence: `register.php`)
- Visitor → Sign in: signs in (evidence: `login.php`)
- Register account → User operations: creates account (evidence: `register.php`)
- Sign in → User operations: authenticates (evidence: `login.php`)
- Signed-in user → Sign out: signs out (evidence: `logout.php`)
- Sign out → User operations: ends session (evidence: `logout.php`)
- Browse posts → Shared header: includes (evidence: `index.php`)
- Browse posts → Shared footer: includes (evidence: `index.php`)
- Shared header → User operations: initializes (evidence: `includes/header.php`)
- Shared header → Post operations: initializes (evidence: `includes/header.php`)
- Shared header → Post comments: initializes (evidence: `includes/header.php`)
- Shared header → Category operations: initializes (evidence: `includes/header.php`)
- Post operations → Application database: queries (evidence: `classes/Post.php`)
- Category operations → Application database: queries (evidence: `classes/Category.php`)
- Post comments → Application database: queries (evidence: `classes/Comment.php`)
- User operations → Application database: queries (evidence: `classes/User.php`)
