Complete system overview showing how all components interact
flowchart TB
subgraph BROWSER["🌐 Browser"]
REQ["Request: yoursite.com/post/slug"]
end
subgraph ENTRY["📥 Entry Points"]
INDEX["index.php
Frontend Router"]
ADMIN_ENTRY["admin/*.php
Admin Panel"]
end
subgraph CORE["🔧 Core System"]
direction TB
BOOT["bootstrap.php
Initializes everything"]
subgraph CLASSES["Core Classes"]
direction LR
DB["Database
PDO Wrapper"]
SETTINGS["Settings
Site Config"]
AUTH["Auth
Login/Sessions"]
end
subgraph MODELS["Data Models"]
direction LR
POST["Post
Blog articles"]
CAT["Category
Taxonomies"]
AMZN["AmazonAffiliate
Product API"]
end
end
subgraph THEMES["🎨 Themes"]
SELECTOR{"Settings:
active_theme"}
T1["developer/
Dark Mode"]
T2["minimalist/
Light & Clean"]
T3["magazine/
Bold Colors"]
subgraph FILES["Template Files"]
H["header.php"]
F["footer.php"]
I["index.php"]
S["single.php"]
end
end
subgraph ADMIN["🔐 Admin Panel"]
direction TB
A_DASH["Dashboard"]
A_POSTS["Posts Manager"]
A_CATS["Categories"]
A_SETTINGS["Site Settings"]
A_AMAZON["Amazon Config"]
A_THEMES["Theme Selector"]
A_USERS["User Management"]
end
subgraph DATA["🗄️ MySQL"]
direction LR
DB_USERS[("users")]
DB_POSTS[("posts")]
DB_CATS[("categories")]
DB_SETTINGS[("settings")]
end
subgraph EXTERNAL["🌍 External"]
AMAZON_API["Amazon PA-API"]
end
REQ --> INDEX & ADMIN_ENTRY
INDEX --> BOOT
ADMIN_ENTRY --> BOOT
BOOT --> CLASSES
BOOT --> MODELS
DB --> DATA
POST --> DB
CAT --> DB
SETTINGS --> DB
AUTH --> DB
INDEX --> SELECTOR
SELECTOR --> T1 & T2 & T3
T1 & T2 & T3 --> FILES
FILES --> POST & CAT & SETTINGS & AMZN
A_SETTINGS --> SETTINGS
A_AMAZON --> AMZN
A_THEMES --> SETTINGS
A_POSTS --> POST
A_CATS --> CAT
A_USERS --> AUTH
AMZN --> AMAZON_API
classDef purple fill:#6366f1,stroke:#8b5cf6,color:white
classDef green fill:#10b981,stroke:#059669,color:white
classDef pink fill:#ec4899,stroke:#be185d,color:white
classDef orange fill:#f59e0b,stroke:#d97706,color:black
classDef blue fill:#3b82f6,stroke:#1d4ed8,color:white
classDef dark fill:#1e1e2e,stroke:#3f3f46,color:#e4e4e7
class INDEX,BOOT purple
class T1,T2,T3,H,F,I,S green
class A_DASH,A_POSTS,A_CATS,A_SETTINGS,A_THEMES,A_USERS pink
class AMZN,A_AMAZON,AMAZON_API orange
class DB,DB_USERS,DB_POSTS,DB_CATS,DB_SETTINGS blue
class POST,CAT,AUTH,SETTINGS dark
/post/my-article.htaccess routesindex.phpPost::getBySlug()single.php rendersThe engine that powers everything. Bootstrap initializes the database connection, loads settings, and sets up authentication.
bootstrap.php - Application entry pointDatabase.php - PDO wrapper with CRUD helpersSettings.php - Cached site optionsAuth.php - Sessions, CSRF, password hashingSelf-contained theme folders with templates. Switch themes instantly from the admin panel - only the frontend changes.
header.php - HTML head, navigation, CSSfooter.php - Footer, closing tagsindex.php - Blog listing templatesingle.php - Individual post with Amazon productsComplete content management system with a modern dark UI. Manages all site content and configuration.
Automatic affiliate product recommendations. Works with or without PA-API credentials.
MySQL with PDO prepared statements for security. All queries use parameter binding to prevent SQL injection.
users - Admin accounts with rolesposts - Blog content with SEO fieldscategories - Post taxonomiessettings - Key-value site optionsBusiness logic classes that interact with the database and provide clean APIs for templates.
Post.php - CRUD, search, slugs, viewsCategory.php - Taxonomy managementAmazonAffiliate.php - Product search, link generation