A modern, lightweight, and full-featured PHP & MySQL / SQLite blogging platform featuring Role-Based Access Control (RBAC), category search filtering, comment management, interactive user dashboards, and serverless Vercel cloud deployment.
- Granular Roles:
Admin,Author,Editor, andUser. - Password Security: Native
password_hash()BCRYPT encryption with auto-migration from legacy plain-text entries upon login. - Admin Dashboard: System-wide content moderation, total statistics overview, and author account management (add/remove authors).
- Article Publishing: Create, view, edit, and delete rich blog posts.
- Media Uploads: Support for cover image attachments and user profile avatar uploads.
- Search & Category Filters: Real-time keyword search bar combined with category dropdown filtering.
- Pagination: Built-in server-side pagination for optimal performance.
- Discussion System: Interactive comment threads on blog articles.
- Admin Moderation: Edit and delete comment controls for system administrators.
- Automatic Fallback Engine: Works out-of-the-box with MySQL for traditional web hosts (XAMPP/WAMP) and auto-switches to SQLite (PDO) when deployed on serverless environments like Vercel.
- Prepared Statements: 100% SQL injection proof data access layer.
Blogify-Personal-Blogging-System/
βββ π actions/ # Controller Action Handlers (Form & API Processing)
β βββ auth_actions.php # Login, Register, & Logout handlers
β βββ comment_actions.php # Comment creation, editing, & deletion handlers
β βββ post_actions.php # Article CRUD handlers
β βββ profile_actions.php # Profile bio, avatar, & author management handlers
βββ π api/ # Vercel Serverless Function Wrappers
β βββ add_post.php
β βββ index.php
βββ π config/ # System Configuration & Database Layer
β βββ auth.php # Session authorization & role helper functions
β βββ db.php # Dual Connection Manager (MySQL & SQLite fallback)
βββ π includes/ # Common Components & Helper Modules
β βββ components.php # Reusable UI cards, search bar, & pagination
β βββ footer.php # HTML Footer & script initializers
β βββ functions.php # Data access layer & repository functions
β βββ header.php # HTML Head, Google Fonts, & Navigation Bar
βββ π uploads/ # Media Upload Storage
β βββ profiles/ # User avatar images
β βββ .gitkeep
βββ π views/ # Modular Page View Templates
β βββ add_post.php # Article publishing form view
β βββ edit_post.php # Article editor view
β βββ home.php # Main article feed & category search
β βββ login.php # User sign-in view
β βββ profile.php # User dashboard & admin control panel
β βββ register.php # Account creation view
β βββ view_post.php # Single post discussion & comment view
βββ π database.sql # Clean DDL Database Schema & Seed Data
βββ π index.php # Front Controller & Main App Router
βββ π README.md # Professional Showcase Documentation
βββ π script.js # Client-side Interactive JavaScript
βββ π style.css # Modern CSS Design System & Theme Styles
βββ π vercel.json # Vercel Serverless Configuration
The project includes ready-to-use sample accounts in database.sql for instant testing:
| Role | Username / Email | Password | Permissions & Capabilities |
|---|---|---|---|
| π Admin | Admin / admin@example.com |
1234 |
System-wide statistics, author management, global post & comment moderation |
| βοΈ Editor | Editor / editor@example.com |
1234 |
Edit and manage all published articles & comments |
| π Author | Author / author@example.com |
1234 |
Write, edit, and publish personal articles & upload cover images |
| π€ User | User / user@example.com |
1234 |
Read articles, filter categories, and participate in discussion comments |
-
Clone Repository:
git clone https://github.com/usmanrasheeddev/Blogify-Personal-Blogging-System.git
-
Move to Web Root: Place project inside your local web server root directory (e.g.
C:/xampp/htdocs/Blogify-Personal-Blogging-System). -
Database Import:
- Open phpMyAdmin (
http://localhost/phpmyadmin). - Create a new database named
simple_blog. - Import
database.sqlinto the database.
- Open phpMyAdmin (
-
Run Application: Navigate to
http://localhost/Blogify-Personal-Blogging-Systemin your browser.
This codebase includes native vercel.json configuration and automatically falls back to an embedded SQLite database in serverless environments.
- Deploy directly using the Vercel CLI:
vercel --prod
- Alternatively, connect this repository to your Vercel Dashboard for instant continuous deployment.
- SQL Injection Prevention: Prepared statements (
my_db_prepare()) are enforced across all database queries. - XSS Sanitization: All user-submitted text fields are escaped using
htmlspecialchars(..., ENT_QUOTES, 'UTF-8'). - Password Security: Uses BCRYPT hashing via PHP
password_hash()andpassword_verify().
Distributed under the MIT License. See LICENSE for more information.