Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Blogify – Personal Blogging System

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.

PHP MySQL SQLite JavaScript HTML5 CSS3 Vercel License


🌟 Key Features

πŸ” 1. Authentication & Role-Based Access Control (RBAC)

  • Granular Roles: Admin, Author, Editor, and User.
  • 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).

πŸ“„ 2. Content & Media Management

  • 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.

πŸ’¬ 3. Community Engagement

  • Discussion System: Interactive comment threads on blog articles.
  • Admin Moderation: Edit and delete comment controls for system administrators.

⚑ 4. Smart Dual-Engine Database Architecture

  • 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.

πŸ› οΈ Technology Stack & Skills

Layer Skill / Technology Description
Backend Core PHP Modular MVC Front Controller, Session Auth, OOP Database Helpers
Database MySQL SQLite MySQL Relational Engine with PDO SQLite Fallback Adapter
Frontend Logic JavaScript ES6 Fetch API for async authentication & UI interactions
Styling & UI CSS3 Custom CSS Design System, Glassmorphic overlays, Responsive Grid
Markup & SEO HTML5 Semantic HTML5 structure with accessible forms & dynamic meta titles
Deployment Apache Vercel XAMPP/WAMP web server or Vercel Serverless Functions (vercel-php)

πŸ“‚ Project Architecture

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

πŸ”‘ Pre-Seeded Demo Accounts

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

⚑ Quick Start & Setup Guide

πŸ’» Local Server Setup (XAMPP / WAMP / MAMP)

  1. Clone Repository:

    git clone https://github.com/usmanrasheeddev/Blogify-Personal-Blogging-System.git
  2. Move to Web Root: Place project inside your local web server root directory (e.g. C:/xampp/htdocs/Blogify-Personal-Blogging-System).

  3. Database Import:

    • Open phpMyAdmin (http://localhost/phpmyadmin).
    • Create a new database named simple_blog.
    • Import database.sql into the database.
  4. Run Application: Navigate to http://localhost/Blogify-Personal-Blogging-System in your browser.


☁️ Cloud Deployment (Vercel Serverless)

This codebase includes native vercel.json configuration and automatically falls back to an embedded SQLite database in serverless environments.

  1. Deploy directly using the Vercel CLI:
    vercel --prod
  2. Alternatively, connect this repository to your Vercel Dashboard for instant continuous deployment.

πŸ›‘οΈ Security Best Practices

  • 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() and password_verify().

πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.

Built with ❀️ by Usman Rasheed

About

Blogify is a simple web-based platform that allows users to create, publish, and manage personal blog posts easily. It is designed for beginners and academic use with a clean and user-friendly interface.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages