Over the past few days, I built a blog engine from scratch β no WordPress, no plugins, no heavy CMS bloat. Just clean PHP, MySQL, and full control over everything from how posts are rendered to how they're stored and displayed. Hereβs a quick breakdown of how I structured it and why.
π Folder Structure
Everything lives under my /var/www/html/test
directory. Here's a simplified breakdown:
/test
βββ assets/ # CSS, JS, shared images
βββ blog/
β βββ admin/ # Password-protected post form + upload handler
β βββ images/ # Blog post images (organized by post-XXXX folders)
β βββ index.php # Blog homepage
β βββ post.php # Individual post view
βββ includes/ # Header, footer, DB connection (secured)
βββ pages/ # Main site pages (about, services, etc.)
βββ index.php # Site landing page
π§ Database Design
All content is stored in a simple dfg_blog
MySQL database with the following key tables:
- posts β id, title, summary, content, published_at
- comments (for future use)
- tags and post_tags (for filtering, also planned)
Every blog post gets a unique ID, which is also used to generate its image storage path, like:
/blog/images/posts/post-0001/
π οΈ Admin Panel
I built a lightweight admin panel with:
- Password protection
- A form to create new posts
- Support for image uploads (stored in the correct folder automatically)
The post ID is determined dynamically based on the last post, so everything stays sequential without duplicates.
β Why I Chose This Path
I wanted complete ownership of my content and layout. This setup lets me:
- Edit everything locally or via my admin form
- Keep my codebase clean and version-controlled
- Add features gradually without relying on plugins or third-party services
Itβs also a great exercise in practical web development and backend structure.
π§ͺ Whatβs Next
- Markdown-style formatting in the editor
- Tag-based navigation
- Optional comments and reactions
- More Merlin, obviously πΎ
π¬ Final Thoughts
If youβve ever wanted to build your own blog engine β not just a theme β this approach is a great way to get your hands dirty and understand how things work under the hood. And yeah... itβs way more fun when your dog helps write posts. π
πΎ Merlinβs Corner

"Hey there, humans. Merlin here β I watched this whole thing get built from scratch, and lemme tell you, it smelled like hard work and PHP. No WordPress? No problem. Just clean code, sharp instincts, and plenty of water breaks. Iβm proud of how this blog came together... and the folder structure is tighter than my leash on squirrel patrol. πβπ¦Ί Now fetch yourself some inspiration and try building something too!"