# amanprojects-ops/php-news-website architecture

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

- Interactive diagram: https://gitdiagram.com/amanprojects-ops/php-news-website
- Repository: https://github.com/amanprojects-ops/php-news-website

## Overview

ConnectBihar is a PHP/MySQL news publishing CMS. Readers enter through the public portal, browse or search published stories, and open an article; administrators authenticate, manage stories, categories, staff, and site settings, with role-based access described in the README. The public router resolves clean URLs to category, author, search, or article views. The graph also captures visitor tracking, installation, and configurable email. Public routing and selected handlers are supported by sampled source; other major capabilities and their paths are based on the README and file tree, so uncertain internal wiring is omitted.

Main entry points: [`config.php`](https://github.com/amanprojects-ops/php-news-website/blob/main/config.php) (MySQL Database), [`router.php`](https://github.com/amanprojects-ops/php-news-website/blob/main/router.php) (URL Router), [`database/functions.php`](https://github.com/amanprojects-ops/php-news-website/blob/main/database/functions.php) (Shared Functions), [`index.php`](https://github.com/amanprojects-ops/php-news-website/blob/main/index.php) (News Feed)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Portal"]
  node_router["URL Router<br/>[router.php]"]
  node_home["News Feed<br/>[index.php]"]
  node_category["Category View<br/>[category.php]"]
  node_author["Author View<br/>[author.php]"]
  node_search["Article Search<br/>[search.php]"]
  node_article["Article Detail<br/>[single.php]"]
  node_contact["Contact Page<br/>[contactus.php]"]
end

subgraph group_editorial["Editorial Admin"]
  node_login["Admin Login<br/>[index.php]"]
  node_dashboard["Admin Dashboard<br/>[dashboard.php]"]
  node_post_admin["Article Management<br/>[app.php]"]
  node_category_admin["Category Management<br/>[app.php]"]
  node_user_admin["Staff Management<br/>[app.php]"]
  node_website_admin["Website Settings<br/>[manage-website.php]"]
end

subgraph group_platform["Platform Services"]
  node_visitors["Visitor Tracking"]
  node_helpers["Shared Functions<br/>[functions.php]"]
  node_database[("MySQL Database<br/>[config.php]")]
  node_mailer["SMTP Mailer<br/>[Mailer.php]"]
end

subgraph group_setup["Initial Setup"]
  node_installer["Setup Wizard<br/>[index.php]"]
end

node_readers(("Readers"))
node_admin(("Administrators"))
node_smtp{{"SMTP Server"}}
node_operator(("Site Operator"))

node_readers -->|"requests URL"| node_router
node_router -->|"includes category"| node_category
node_router -->|"includes author"| node_author
node_router -->|"includes search"| node_search
node_router -->|"includes article"| node_article
node_readers -->|"opens portal"| node_home
node_readers -->|"opens contact"| node_contact
node_home -->|"queries stories"| node_database
node_category -->|"queries stories"| node_database
node_author -->|"queries stories"| node_database
node_search -->|"searches stories"| node_database
node_router -->|"resolves slugs"| node_database
node_article -->|"loads article"| node_database
node_home -->|"formats links"| node_helpers
node_category -->|"formats links"| node_helpers
node_author -->|"formats links"| node_helpers
node_search -->|"formats links"| node_helpers
node_admin -->|"signs in"| node_login
node_login -->|"checks credentials"| node_database
node_login -->|"redirects after login"| node_dashboard
node_admin -->|"manages portal"| node_dashboard
node_dashboard -.->|"reads metrics"| node_database
node_post_admin -->|"writes articles"| node_database
node_category_admin -.->|"writes categories"| node_database
node_user_admin -.->|"writes users"| node_database
node_website_admin -.->|"updates settings"| node_database
node_visitors -.->|"records visits"| node_database
node_operator -->|"runs setup"| node_installer
node_installer -->|"configures database"| node_database
node_mailer -.->|"sends email"| node_smtp

click node_router "https://github.com/amanprojects-ops/php-news-website/blob/main/router.php"
click node_home "https://github.com/amanprojects-ops/php-news-website/blob/main/index.php"
click node_category "https://github.com/amanprojects-ops/php-news-website/blob/main/category.php"
click node_author "https://github.com/amanprojects-ops/php-news-website/blob/main/author.php"
click node_search "https://github.com/amanprojects-ops/php-news-website/blob/main/search.php"
click node_article "https://github.com/amanprojects-ops/php-news-website/blob/main/single.php"
click node_contact "https://github.com/amanprojects-ops/php-news-website/blob/main/contactus.php"
click node_login "https://github.com/amanprojects-ops/php-news-website/blob/main/admin/index.php"
click node_dashboard "https://github.com/amanprojects-ops/php-news-website/blob/main/admin/dashboard.php"
click node_post_admin "https://github.com/amanprojects-ops/php-news-website/blob/main/admin/app/app.php"
click node_category_admin "https://github.com/amanprojects-ops/php-news-website/blob/main/admin/app/app.php"
click node_user_admin "https://github.com/amanprojects-ops/php-news-website/blob/main/admin/app/app.php"
click node_website_admin "https://github.com/amanprojects-ops/php-news-website/blob/main/admin/manage-website.php"
click node_visitors "https://github.com/amanprojects-ops/php-news-website/blob/main/visitoer-counter.php"
click node_helpers "https://github.com/amanprojects-ops/php-news-website/blob/main/database/functions.php"
click node_database "https://github.com/amanprojects-ops/php-news-website/blob/main/config.php"
click node_mailer "https://github.com/amanprojects-ops/php-news-website/blob/main/database/Mailer.php"
click node_installer "https://github.com/amanprojects-ops/php-news-website/blob/main/install/index.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_router,node_home,node_category,node_author,node_search,node_article,node_contact toneBlue
class node_login,node_dashboard,node_post_admin,node_category_admin,node_user_admin,node_website_admin toneAmber
class node_visitors,node_helpers,node_database,node_mailer,node_smtp toneMint
class node_installer toneRose
class node_readers,node_admin,node_operator toneIndigo
```

## Components

### Public Portal

- [URL Router](https://github.com/amanprojects-ops/php-news-website/blob/main/router.php): `router.php`
- [News Feed](https://github.com/amanprojects-ops/php-news-website/blob/main/index.php): `index.php`
- [Category View](https://github.com/amanprojects-ops/php-news-website/blob/main/category.php): `category.php`
- [Author View](https://github.com/amanprojects-ops/php-news-website/blob/main/author.php): `author.php`
- [Article Search](https://github.com/amanprojects-ops/php-news-website/blob/main/search.php): `search.php`
- [Article Detail](https://github.com/amanprojects-ops/php-news-website/blob/main/single.php): `single.php`
- [Contact Page](https://github.com/amanprojects-ops/php-news-website/blob/main/contactus.php): `contactus.php`

### Editorial Admin

- [Admin Login](https://github.com/amanprojects-ops/php-news-website/blob/main/admin/index.php): `admin/index.php`
- [Admin Dashboard](https://github.com/amanprojects-ops/php-news-website/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Article Management](https://github.com/amanprojects-ops/php-news-website/blob/main/admin/app/app.php): `admin/app/app.php`
- [Category Management](https://github.com/amanprojects-ops/php-news-website/blob/main/admin/app/app.php): `admin/app/app.php`
- [Staff Management](https://github.com/amanprojects-ops/php-news-website/blob/main/admin/app/app.php): `admin/app/app.php`
- [Website Settings](https://github.com/amanprojects-ops/php-news-website/blob/main/admin/manage-website.php): `admin/manage-website.php`

### Platform Services

- [Visitor Tracking](https://github.com/amanprojects-ops/php-news-website/blob/main/visitoer-counter.php): `visitoer-counter.php`
- [Shared Functions](https://github.com/amanprojects-ops/php-news-website/blob/main/database/functions.php): `database/functions.php`
- [MySQL Database](https://github.com/amanprojects-ops/php-news-website/blob/main/config.php): `config.php`
- [SMTP Mailer](https://github.com/amanprojects-ops/php-news-website/blob/main/database/Mailer.php): `database/Mailer.php`

### Initial Setup

- [Setup Wizard](https://github.com/amanprojects-ops/php-news-website/blob/main/install/index.php): `install/index.php`

### Other components

- **Readers**
- **Administrators**
- **SMTP Server**
- **Site Operator**

## Connections

- Readers → URL Router: requests URL
- URL Router → Category View: includes category
- URL Router → Author View: includes author
- URL Router → Article Search: includes search
- URL Router → Article Detail: includes article
- Readers → News Feed: opens portal
- Readers → Contact Page: opens contact
- News Feed → MySQL Database: queries stories
- Category View → MySQL Database: queries stories
- Author View → MySQL Database: queries stories
- Article Search → MySQL Database: searches stories
- URL Router → MySQL Database: resolves slugs
- Article Detail → MySQL Database: loads article
- News Feed → Shared Functions: formats links
- Category View → Shared Functions: formats links
- Author View → Shared Functions: formats links
- Article Search → Shared Functions: formats links
- Administrators → Admin Login: signs in
- Admin Login → MySQL Database: checks credentials
- Admin Login → Admin Dashboard: redirects after login
- Administrators → Admin Dashboard: manages portal
- Admin Dashboard → MySQL Database: reads metrics
- Article Management → MySQL Database: writes articles
- Category Management → MySQL Database: writes categories
- Staff Management → MySQL Database: writes users
- Website Settings → MySQL Database: updates settings
- Visitor Tracking → MySQL Database: records visits
- Site Operator → Setup Wizard: runs setup
- Setup Wizard → MySQL Database: configures database
- SMTP Mailer → SMTP Server: sends email
