8000 GitHub - teray234/Inkforge: Markdown Blog Engine using PHP and Laragon · GitHub
[go: up one dir, main page]

Skip to content
teray234Public
forked from d4vucat/Inkforge

About

Markdown Blog Engine using PHP and Laragon

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InkForge — Markdown Blog Engine

A production-grade PHP blog engine with AI-powered writing tools, full-text search, media management, and deep API integrations.


✨ Features

Core

  • 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.xml auto-generated
  • Sitemap — /sitemap.xml for SEO crawlers
  • Rate Limiting — Per-IP request throttling
  • CSRF Protection — All POST requests protected
  • Session Security — Fixation guard, remember-me tokens, account lockout

Content

  • 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

Auth & Users

  • 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

AI (Groq)

  • 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

Search (Algolia)

  • 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

Media

  • Unsplash — Search & insert royalty-free photos with attribution tracking
  • Pexels — Search photos and videos
  • GIPHY — Trending & search GIFs

Analytics

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

Comments

  • Hyvor Talk — Privacy-first, GDPR-compliant comments
  • SSO integration with user session
  • Comment count display

Newsletter

  • Double opt-in subscribe flow
  • Unsubscribe via token link
  • Subscriber management in admin

🚀 Installation (Laragon)

1. Clone & Setup

# Clone into Laragon's www directory
cd C:/laragon/www
git clone <repo> inkforge
cd inkforge

# Run setup wizard
php setup.php

2. Database

# 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.sql

3. Environment

cp .env.example .env
# Edit .env with your API keys

4. Laragon Virtual Host

Add 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

5. First Login

URL:      http://inkforge.test/admin
Email:    admin@inkforge.dev
Password: Admin@2024   ← Change immediately!

📁 Project Structure

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

🔌 API Integrations Setup

Unsplash

  1. Create app at https://unsplash.com/developers
  2. Copy Access Key & Secret Key to .env
  3. Each download must be tracked via trackDownload() (included)

Pexels

  1. Register at https://www.pexels.com/api/
  2. Copy API key to .env

Algolia

  1. Create account at https://algol 73E2 ia.com
  2. Create an index named inkforge_posts
  3. Add App ID, Admin API Key, Search-Only Key to .env
  4. Go to Admin → Settings → Click "Sync Algolia" to index existing posts

Gemini AI

  1. Get API key from https://makersuite.google.com/app/apikey
  2. Add to .env as GEMINI_API_KEY

GIPHY

  1. Create app at https://developers.giphy.com/
  2. Copy API key to .env

Google Analytics 4

  1. Create GA4 property
  2. Get Measurement ID (G-XXXXXXXXXX)
  3. Create Measurement Protocol API Secret in GA4 admin
  4. Both go into .env

Hyvor Talk

  1. Register at https://talk.hyvor.com
  2. Create a website, get Website ID
  3. Generate API key in dashboard
  4. Add both to .env

🔐 Security Notes

  • 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

📋 Requirements

  • PHP 8.1+
  • MySQL 5.7+ / MariaDB 10.4+
  • Apache with mod_rewrite (Laragon default)
  • Extensions: pdo_mysql, curl, mbstring, gd, fileinfo, openssl

📄 License

MIT License — See LICENSE file for details.


Built with ♥ by me

About

Markdown Blog Engine using PHP and Laragon

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0