A production-grade PHP blog engine with AI-powered writing tools, full-text search, media management, and deep API integrations.
- Markdown Editor — CodeMirror 6 with full toolbar, live preview, syntax highlighting
- Revision History — Track every edit, restore any version
- Scheduled Publishing — Set publish dates in advance
- Featured Posts — Pin top content to the homepage hero
- Reading Time — Auto-calculated (238 WPM)
- Dark Mode — System-aware with manual toggle, persisted
- RSS Feed —
/rss.xmlauto-generated - Sitemap —
/sitemap.xmlfor SEO crawlers - Rate Limiting — Per-IP request throttling
- CSRF Protection — All POST requests protected
- Session Security — Fixation guard, remember-me tokens, account lockout
- Rich Markdown — Tables, footnotes, task lists, highlight, superscript, autolinks, code blocks with copy button
- Categories & Tags — Hierarchical categories, tag clouds, color-coded
- Media Library — Upload, thumbnail generation (WebP), reuse across posts
- GIF Support — GIPHY integration for in-editor GIF insertion
- Cover Images — Upload, URL, Unsplash, or Pexels
- Multi-role —
subscriber,author,editor,admin,super_admin - Remember Me — 30-day persistent tokens
- Password Reset — Email token flow
- Email Verification — Optional on registration
- Account Lockout — After 5 failed login attempts
- User Profiles — Avatar, bio, social links
- OAuth Ready — Table structure prepared for provider accounts
- Improve writing style and grammar
- Generate SEO meta (title, description, focus keyword)
- Auto-suggest tags from content
- Generate post outlines from a topic
- Translate posts to 6 languages
- Generate social media captions (Twitter, LinkedIn, Instagram)
- AI chat assistant on every post
- Grammar & style checker
- Full-text search with highlighting
- Faceted filtering by tag, category, author
- Custom ranking by views and recency
- Auto-sync on publish/update
- Bulk re-index from admin settings
- Falls back to MySQL FULLTEXT if Algolia not configured
- Unsplash — Search & insert royalty-free photos with attribution tracking
- Pexels — Search photos and videos
- GIPHY — Trending & search GIFs
- Google Analytics 4 — Measurement Protocol server-side events
- Page views, custom dimensions (author, category, slug)
- Search tracking, share tracking
- Admin dashboard with Chart.js visualizations
- Internal view counter (unique per IP per day)
- Hyvor Talk — Privacy-first, GDPR-compliant comments
- SSO integration with user session
- Comment count display
- Double opt-in subscribe flow
- Unsubscribe via token link
- Subscriber management in admin
# Clone into Laragon's www directory
cd C:/laragon/www
git clone <repo> inkforge
cd inkforge
# Run setup wizard
php setup.php# Create database in HeidiSQL or MySQL CLI
mysql -u root -e "CREATE DATABASE inkforge_blog CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
# Run migrations
mysql -u root inkforge_blog < migrations/schema.sqlcp .env.example .env
# Edit .env with your API keysAdd to Laragon's Apache config or let Laragon auto-detect:
ServerName inkforge.test
DocumentRoot "C:/laragon/www/inkforge"
Set in .env:
APP_URL=http://inkforge.test
URL: http://inkforge.test/admin
Email: admin@inkforge.dev
Password: Admin@2024 ← Change immediately!
inkforge/
├── .htaccess # Apache rewrite + security headers
├── .env.example # Environment template
├── setup.php # Install wizard (delete after setup)
├── admin.php # Admin panel entry point
│
├── config/
│ └── config.php # Centralized config, autoloader, error handling
│
├── core/
│ ├── Database.php # PDO singleton, query builder, pagination
│ ├── Http.php # Router, Request, Response, Auth, Flash
│ └── Models.php # PostModel, Markdown renderer, MediaManager, Newsletter
│
├── api/
│ └── Integrations.php # Unsplash, Pexels, Algolia, Gemini, GIPHY, GA4, Hyvor
│
├── middleware/
│ └── Middleware.php # CSRF, Auth, Guest, AdminOnly, RateLimit, AuditLog
│
├── migrations/
│ └── schema.sql # Full database schema + seed data
│
└── public/
├── index.php # Frontend entry point + all controllers
├── admin.php # Admin panel
├── 404.php / 500.php # Error pages
├── uploads/ # User-uploaded media
└── views/
├── layout.php # Master template
├── home.php # Homepage
├── post.php # Single post
├── archive.php # Blog/category/tag/author list
├── search.php # Search results
├── dashboard.php # User dashboard
├── profile.php # Profile editor
├── bookmarks.php # Saved posts
└── auth/
├── login.php
├── register.php
├── forgot.php
└── reset.php
- Create app at https://unsplash.com/developers
- Copy Access Key & Secret Key to
.env - Each download must be tracked via
trackDownload()(included)
- Register at https://www.pexels.com/api/
- Copy API key to
.env
- Create account at https://algol 73E2 ia.com
- Create an index named
inkforge_posts - Add App ID, Admin API Key, Search-Only Key to
.env - Go to Admin → Settings → Click "Sync Algolia" to index existing posts
- Get API key from https://makersuite.google.com/app/apikey
- Add to
.envasGEMINI_API_KEY
- Create app at https://developers.giphy.com/
- Copy API key to
.env
- Create GA4 property
- Get Measurement ID (G-XXXXXXXXXX)
- Create Measurement Protocol API Secret in GA4 admin
- Both go into
.env
- Register at https://talk.hyvor.com
- Create a website, get Website ID
- Generate API key in dashboard
- Add both to
.env
- All POST routes protected by CSRF tokens
- Passwords hashed with bcrypt (cost 12)
- Rate limiting on API endpoints (60 req/min)
- Session fixation protection on login
- Account lockout after 5 failed attempts (15 min)
- Audit log for all admin actions
- Sensitive dirs blocked in
.htaccess - SQL injection prevented via prepared statements only
- XSS prevented via
htmlspecialchars()on all output - Security headers set via
.htaccess
- PHP 8.1+
- MySQL 5.7+ / MariaDB 10.4+
- Apache with
mod_rewrite(Laragon default) - Extensions:
pdo_mysql,curl,mbstring,gd,fileinfo,openssl
MIT License — See LICENSE file for details.
Built with ♥ by me