đ TidyFactor Go â Turnkey Agile Business Platform & Lightweight CMS¶
The AI-Native Website Operating System & Agile CMS with Single-File SQLite 3 (WAL Mode) & JSON-First Storage
TidyFactor Go (tidyfactor-go) is a turnkey website operating system and modern lightweight CMS designed for high-performance business websites, digital agencies, and independent creators. Engineered for 100% data sovereignty, zero ongoing subscription fees, and native human-agent collaboration, it combines a blazing-fast React 19 + Tailwind CSS v4 frontend with an ultra-lightweight PHP Flight + SQLite 3 WAL backend.
đī¸ 1. Master Platform Architecture¶
TidyFactor Go Master Platform Architecture
â
ââââââââââââââââââââââââââââââââââŧâââââââââââââââââââââââââââââââââ
â â â
đ¨ Modern Frontend ⥠Headless REST API đž Embedded Data Layer
âĸ React 19 + TypeScript âĸ PHP Flight Micro-Kernel âĸ SQLite 3 (WAL Mode)
âĸ Tailwind CSS v4 Engine âĸ 15 RESTful Endpoints âĸ JSON-First Document Store
âĸ Radix UI Accessible Primitives âĸ Bcrypt Auth (Cost 12) âĸ Self-Healing Migrations
âĸ Native Arabic RTL / English âĸ Rate Limiting & Anti-Bot âĸ Single-File Portability
âĸ Gemini AI Content Assistant âĸ SVG XSS DOM Sanitizer âĸ Point-in-Time Snapshots
â â â
ââââââââââââââââââââââââââââââââââŧâââââââââââââââââââââââââââââââââ
â
Zero-Build Production Deployment
(cPanel / Apache / LiteSpeed / Nginx / Cloud VPS)
đ 2. Core Value Propositions & Architectural Principles¶
1. 100% Data Sovereignty & Single-File Portability¶
- The entire database lives in a single, portable
.sqlitefile instorage/database/. - No external database servers (MySQL/PostgreSQL) consuming 500MB+ RAM on shared hosts.
- Moving or backing up your website is as simple as copying a single file.
2. Automated Zero-Friction Setup Wizard (/install)¶
- Deploying to production takes under 2 minutes without writing a single line of SQL.
- Automated system check verifies PHP version, SQLite extension, and directory permissions.
- Provisions database tables, creates the master administrator account, and self-locks the installer.
3. Native Bilingual Architecture (Arabic RTL & English LTR)¶
- Built-in directional styling via CSS Logical Properties (
margin-inline,padding-block). - Independent Arabic and English content fields across all pages, services, and articles.
- Instant client-side language switching without page reloads or broken layouts.
4. Zero Framework Bloat & 0ms Database Daemon Overhead¶
- PHP Flight router executes in under 5ms per request with less than 2MB RAM footprint.
- Runs effortlessly on the cheapest $2/month cPanel shared hosting or minimal 512MB VPS.
đī¸ 3. Embedded Database Schema & SQLite WAL Internals¶
TidyFactor Go leverages SQLite 3 configured in Write-Ahead Logging (WAL) Mode, allowing concurrent readers while writes occur without table locks.
Engine PRAGMA Settings:¶
PRAGMA journal_mode = WAL; -- Enables non-blocking concurrent reads and writes
PRAGMA synchronous = NORMAL; -- Balances absolute data safety with extreme throughput
PRAGMA foreign_keys = ON; -- Enforces strict relational integrity
PRAGMA busy_timeout = 5000; -- 5-second automatic wait before SQLITE_BUSY error
PRAGMA cache_size = -64000; -- Allocates 64MB dedicated in-memory page cache
Core Relational & JSON Schema:¶
-- 1. Pages Table (JSON Document Store)
CREATE TABLE IF NOT EXISTS pages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug TEXT NOT NULL UNIQUE,
title_ar TEXT NOT NULL,
title_en TEXT NOT NULL,
content_json TEXT NOT NULL DEFAULT '{}', -- Dynamic sections, blocks & metadata
is_published INTEGER NOT NULL DEFAULT 1,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- 2. Publications & Blog Posts
CREATE TABLE IF NOT EXISTS publications (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug TEXT NOT NULL UNIQUE,
category TEXT NOT NULL DEFAULT 'general',
title_ar TEXT NOT NULL,
title_en TEXT NOT NULL,
summary_ar TEXT,
summary_en TEXT,
body_markdown_ar TEXT NOT NULL,
body_markdown_en TEXT NOT NULL,
featured_image TEXT,
author_id INTEGER REFERENCES users(id),
is_published INTEGER NOT NULL DEFAULT 1,
published_at DATETIME DEFAULT CURRENT_TIMESTAMP,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- 3. Administrative Users
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT NOT NULL UNIQUE,
email TEXT NOT NULL UNIQUE,
password_hash TEXT NOT NULL, -- Bcrypt (Cost 12)
role TEXT NOT NULL DEFAULT 'admin', -- 'superadmin', 'admin', 'editor'
last_login DATETIME,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- 4. Media & Asset Manifest
CREATE TABLE IF NOT EXISTS media (
id INTEGER PRIMARY KEY AUTOINCREMENT,
filename TEXT NOT NULL,
original_name TEXT NOT NULL,
mime_type TEXT NOT NULL,
file_size INTEGER NOT NULL,
width INTEGER,
height INTEGER,
uploaded_by INTEGER REFERENCES users(id),
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- 5. System Settings & Environment Variables
CREATE TABLE IF NOT EXISTS settings (
key TEXT PRIMARY KEY,
value TEXT NOT NULL,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
⥠4. REST API Reference (15 Endpoints)¶
All endpoints accept and return application/json; charset=UTF-8. Protected endpoints require standard session cookie or Authorization: Bearer <token>.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/auth/login |
Authenticate administrator with rate-limiting protection | â Public |
POST |
/api/auth/logout |
Invalidate active session and destroy authentication cookie | â Admin |
GET |
/api/auth/check |
Return current authenticated user payload and permissions | â Admin |
GET |
/api/site |
Retrieve global site configuration, navigation menus & brand DNA | â Public |
POST |
/api/site |
Update global site JSON document and flush runtime cache | â Admin |
GET |
/api/pages |
List all dynamic content pages with localized titles & slugs | â Public |
GET |
/api/pages/:slug |
Fetch complete page content JSON by URL slug | â Public |
POST |
/api/pages |
Create a new content page with initial section blocks | â Admin |
PUT |
/api/pages/:id |
Surgically update page title, sections, or publish status | â Admin |
DELETE |
/api/pages/:id |
Delete a content page and archive associated assets | â Admin |
GET |
/api/publications |
Paginated list of blog articles with tag and category filtering | â Public |
POST |
/api/publications |
Publish a new bilingual Markdown blog post | â Admin |
POST |
/api/media/upload |
Upload asset (PNG, JPG, SVG, WebP) with SVG XSS sanitizer | â Admin |
GET |
/api/backup/export |
Download complete point-in-time .zip snapshot (DB + media) |
â Admin |
POST |
/api/backup/import |
Atomic restore from a previously exported backup payload | â Admin |
đ 5. Security Protocols & Hardening Standards¶
1. Bcrypt Password Security & Brute-Force Lockdown¶
- Admin passwords hashed using
password_hash()withPASSWORD_BCRYPT(cost factor: 12). - In-memory rate limiting locks out IP addresses after 5 consecutive failed login attempts (15-minute cooldown period).
2. SVG XML DOM Sanitization (XSS Immunity)¶
- Embedded SVG uploads are parsed through PHP's
DOMDocumentparser. - Strips dangerous elements (
<script>,<foreignObject>,<iframe data=...>) and all event handler attributes (onload,onerror,onclick,onmouseover).
3. Server-Level Anti-Bot & Scraper Shield¶
TidyFactor Go includes a locked .htaccess ruleset blocking abusive AI crawlers and scrapers:
# TidyFactor Anti-Bot & Scraper Shield
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (Bytespider|ClaudeBot|ImagesiftBot|GPTBot|DataForSeoBot) [NC]
RewriteRule .* - [F,L]
4. HTTP Security Headers¶
All responses automatically include protective HTTP headers:
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
đ 6. Installation & Deployment Guide¶
System Requirements:¶
- PHP:
8.2or8.3+ - PHP Extensions:
pdo_sqlite,sqlite3,json,mbstring,fileinfo - Web Server: Apache (with
mod_rewrite), LiteSpeed, or Nginx - RAM: Minimum 64MB (Recommended: 128MB+)
Step-by-Step Installation:¶
# 1. Clone or extract TidyFactor Go into your web root (e.g. public_html)
git clone https://github.com/TidyFactor/TidyFactor-Go.git public_html
cd public_html
# 2. Install dependencies
composer install --no-dev --optimize-autoloader
# 3. Ensure permissions on writable directories
chmod -R 755 storage/ uploads/
4. Launch Web Installation Wizard:¶
Open your browser and navigate to:
1. System Health Check: Verifies PHP modules, directory permissions, and write access. 2. Database Provisioning: Initializes SQLite tables and PRAGMA settings. 3. Admin Account Setup: Enter your username, email, and master password. 4. Finalization: The installer automatically locks itself and redirects you to the/admin dashboard.
đĻ 7. Backup & Point-in-Time Disaster Recovery¶
One-Click Web Backup:¶
- Navigate to
/admin/backupsin your dashboard. - Click Generate Full Backup Snapshot.
- A timestamped
.zipcontainingstorage/database/database.sqlite,storage/site.json, anduploads/will be generated for download.
CLI Snapshot Command:¶
# Point-in-time CLI backup snapshot
php tools/backup.php --output=/path/to/backups/tidyfactor-go-$(date +%F).zip
đ§ 8. Troubleshooting & Diagnostics¶
| Symptom | Probable Cause | Exact Solution |
|---|---|---|
SQLITE_BUSY: database is locked |
Concurrent write deadlock without WAL | Verify PRAGMA journal_mode = WAL; is enabled in config/database.php. |
404 Not Found on API routes |
Apache mod_rewrite is disabled |
Enable mod_rewrite in Apache and ensure .htaccess has RewriteEngine On. |
File Upload Failed (413 Payload Too Large) |
PHP upload_max_filesize limit |
Update upload_max_filesize = 32M and post_max_size = 32M in php.ini. |
Permissions Denied on storage/ |
Web server user does not own folder | Run chown -R www-data:www-data storage/ uploads/ (or chmod 755). |
đ Official Links & Resources¶
- Product Page: https://tidyfactor.com/products/tidyfactor-go
- Live Interactive Demo: https://tidyfactor.com/go/
- Documentation Portal: https://tidyfactor.com/documentation
- GitHub Repository: https://github.com/TidyFactor/TidyFactor-Go