Modern PHP blog type platform for publishing AI engineering content. The app ships with a public-facing guides index, a single-article reader, and a password-protected admin CMS for creating, editing, publishing, and deleting posts.
- Public guides homepage with featured cards
- Markdown-powered article pages with syntax highlighting
- Admin dashboard with post stats and CRUD controls
- Draft and published post states
- Featured image upload support
- CSRF protection for admin actions
- Auto-generated unique slugs and reading-time estimates
- PHP 8+
- MySQL / MariaDB
- Tailwind CSS via CDN
- EasyMDE for Markdown editing
- Parsedown for Markdown rendering
- Lucide icons
- Highlight.js for code blocks
index.php Public guides homepage
post.php Single post view
setup.php One-time database bootstrap
config.php Environment and database configuration
functions.php Shared helpers and CRUD logic
admin/ Admin dashboard, auth, and post management
public/logo.png Site favicon / logo
- Grid-based guide listing
- Category, author, and reading-time metadata
- Article navigation to previous / next posts
- Markdown content rendering with safe mode enabled
- Code block highlighting
- Secure login session handling
- Dashboard with total, published, and draft counts
- Create / edit / delete posts
- Publish or save as draft
- Featured image upload and replacement
- Inline Markdown editor with preview, autosave, and image upload
Update config.php or create a .env file in the project root with your database settings:
DB_HOST=localhost
DB_NAME=guide
DB_USER=root
DB_PASS=root
SITE_NAME=Your Site Name
SITE_URL=http://localhost:8000
SESSION_NAME=your_site_name_admin_sessionSITE_URL should match the URL where the project is hosted.
Open setup.php in your browser once after configuring the database.
It will:
- create the
poststable - create the
adminstable - insert a default admin account
- add sample guide posts
Default admin credentials created by setup:
- Username:
admin - Password:
admin123
Change these immediately after logging in.
Important: delete setup.php from the server after setup is complete.
- Public site:
index.php - Admin login:
admin/login.php - Dashboard:
admin/dashboard.php
If you are running the project locally with PHP's built-in server:
php -S localhost:8000Then open:
http://localhost:8000/for the sitehttp://localhost:8000/setup.phpfor first-time setup
Uploaded images are stored in uploads/ and served from /uploads/.
Supported formats:
- JPG
- PNG
- GIF
- WebP
Max upload size: 5 MB
- Log in to the admin panel
- Create a new post
- Write content in Markdown
- Add metadata such as category, excerpt, author, and featured image
- Save as draft or publish immediately
The app automatically generates:
- a unique slug from the title
- a reading-time estimate based on content length
- Markdown is rendered through Parsedown with safe mode enabled.
- CSRF tokens are enforced for create, edit, and delete actions.
- Featured images are deleted from disk when posts are removed or replaced.
- Posts with
draftstatus do not appear on the public site.