The Ultra-Fast, Serverless, Single-File CMS Built on Cloudflare Edge & D1 SQL
** مطالعه راهنما به زبان فارسی (Persian Documentation)** • 📢 کانال تلگرام (Telegram Channel)
CloudPress is a modern, lightweight, serverless Content Management System (CMS) and blogging platform engineered to run entirely on Cloudflare Workers with Cloudflare D1 SQL database.
Designed from the ground up to eliminate expensive traditional VPS hosting, database servers, and complicated maintenance, CloudPress delivers your content across 300+ edge data centers worldwide with sub-30ms TTFB (Time to First Byte).
The entire application runs from a single, self-contained worker file (worker.js) with zero server-side runtime npm dependencies.
- 🚀 Serverless & Edge-First: Runs directly on Cloudflare’s global network with ultra-low latency worldwide.
- 💾 Pure D1 SQL Storage: No external storage or AWS S3/Cloudflare R2 required. Images and assets are automatically compressed in the browser (WebP) and stored securely in SQLite tables.
- ✍️ Visual WYSIWYG Editor (Quill.js):
- Rich typography: Bold, Italic, Underline, Strikethrough, Code blocks, Blockquotes.
- Heading styles (H1, H2, H3) and custom color pickers.
- Bulleted and numbered lists with correct RTL/LTR indentations.
- Video embeds (YouTube / Vimeo) and image insertions directly from the media library.
- Source HTML view toggle for full developer freedom.
- Live draft auto-saving to
localStorage.
- 🌍 100% Bilingual (English & Persian):
- Global English (LTR layout, typography powered by Google Inter).
- Native Persian (RTL layout, typography powered by Vazirmatn).
- Bidirectional, real-time UI switching with dynamic translation engine.
- 🎨 Full Homepage Customization:
- Customizable Hero section (Badge, Title, Description, CTA Buttons, Hero Image).
- Customizable 3-column Features grid (Titles, Descriptions, Icons).
- Header navigation menu builder with drag-and-drop hierarchy.
- Custom CSS & Head/Footer script injections (Google Analytics, live chat widgets).
- 💬 Interactive Comments & Moderation:
- Public comment submission with Honeypot anti-spam protection.
- Toggle between auto-approval and manual admin moderation.
- 📈 Real Analytics Counter:
- Real database-driven article view counter (
views_countin D1 SQL). - Aggregated dashboard stats (Total Articles, Pages, Comments, Views).
- Real database-driven article view counter (
- 🔍 Built-in Edge SEO:
- Auto-generated XML Sitemap (
/sitemap.xml). - Search engine crawler directives (
/robots.txt). - Auto-generated RSS 2.0 Feed (
/rss.xmland/feed.xml). - OpenGraph & JSON-LD structured data on all posts and pages.
- Auto-generated XML Sitemap (
- 📦 One-Click Backup & Restore:
- Export complete site data (Posts, Pages, Categories, Settings, Comments) as a single portable JSON file.
- Instant one-click import restoration.
┌─────────────────────────────────────────────────────────────┐
│ Global Cloudflare Edge │
├───────────────────────────────┬─────────────────────────────┤
│ Public Web │ Admin SPA │
│ - Homepage & Hero Section │ - Dashboard & Analytics │
│ - Blog Archive & Real-time │ - Quill WYSIWYG Editor │
│ - Clean Slugs (/blog, /post) │ - Media Library (WebP) │
│ - Dynamic XML Sitemap & RSS │ - Menu Builder & Settings │
│ - Bilingual (LTR & RTL) │ - Backup Export / Import │
├───────────────────────────────┴─────────────────────────────┤
│ worker.js │
│ (Single Self-Contained Engine) │
├─────────────────────────────────────────────────────────────┤
│ Cloudflare D1 (Serverless SQL) │
│ [posts] [pages] [categories] [media] [settings] │
└─────────────────────────────────────────────────────────────┘
Choose the deployment method that fits you best:
- Option A: Cloudflare Web Dashboard (3 Minutes, No Terminal / No Code) ⚡
- Option B: Developer CLI via Wrangler (Local Dev & Automated CI/CD) 💻
You do not need Git, Node.js, or any command line tools installed. You can launch your entire CMS directly inside your web browser using the free Cloudflare dashboard:
- Log into your Cloudflare Dashboard.
- In the left navigation menu, go to Storage & Databases ➔ D1 SQL Database.
- Click Create ➔ Name your database
cloudpress_db➔ Click Create.
- In the left sidebar, click Compute (Workers & Pages) ➔ Click Create ➔ Create Worker.
- Give your worker a name (e.g.
my-blogorcloudpress) and click Deploy. - On the confirmation screen, click Edit code to open Cloudflare's in-browser editor.
- Delete all existing sample code.
- Copy the entire content of
worker.js, paste it into the editor, and click Deploy (top right).
- Go back to your Worker's main page in the dashboard and click the Settings tab.
- Under Bindings (or D1 Database Bindings), click Add ➔ Select D1 Database:
- Variable name:
DB(Must be uppercaseDB) - D1 database: Select
cloudpress_db - Click Save and deploy.
- Variable name:
- Under the same Settings tab, scroll to Runtime (or Compatibility Flags):
- Under Compatibility flags, add:
nodejs_compat - Click Save.
- Under Compatibility flags, add:
- Still under Worker Settings, click Variables and Secrets.
- Under Secrets, click Add:
- Type: Select
Secret(encrypted) - Variable name:
JWT_SECRET - Value: Enter a high-entropy secret string (e.g. generated via
openssl rand -base64 48)
- Type: Select
- Click Deploy.
(Note: CloudPress fails closed and will refuse to serve admin routes without
JWT_SECRETset, preventing unauthorized takeover).
- Public Site: Open
https://your-worker-name.<subdomain>.workers.dev - Admin Panel: Go to
https://your-worker-name.<subdomain>.workers.dev/admin - Initial Credentials:
- Username:
admin - Password:
admin123(The database schema and initial pages are created automatically on your first visit!)
⚠️ Mandatory Security Requirement: Upon first login, CloudPress requires changing the default administrator password in your Profile section. Changing the password instantly revokes all existing active sessions. - Username:
- Node.js (v18 or newer)
- A Cloudflare Account
git clone https://github.com/your-username/cloudpress.git
cd cloudpressnpm installLogin to your Cloudflare account via Wrangler:
npx wrangler loginCreate a new D1 database named cloudpress_db:
npx wrangler d1 create cloudpress_dbThe command will output your database ID:
database_name = "cloudpress_db"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Open wrangler.toml and paste your database_id:
[[d1_databases]]
binding = "DB"
database_name = "cloudpress_db"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"For local testing, create a .dev.vars file in the project root:
JWT_SECRET=your-secure-local-jwt-secret-key-at-least-32-charsnpm run devOpen http://localhost:8787 in your browser:
- Frontend:
http://localhost:8787/ - Admin Panel:
http://localhost:8787/admin - Initial Credentials:
admin/admin123(prompted to change immediately)
- Set your production JWT secret:
npx wrangler secret put JWT_SECRET- Deploy with one command directly to Cloudflare's global edge network:
npm run deployCloudPress includes an automated security and functional verification suite:
- Cryptographic hash strength (PBKDF2 100,000 iterations & legacy migration)
- Constant-time HMAC signature verification (
timingSafeEqual) - Session revocation on password changes (
token_version) - HTTP security response headers (
X-Frame-Options,nosniff,HSTS) - Safe backup import allowlist filtering (persistent XSS prevention)
- Comment payload limits & moderation defaults
- Brute-force rate limiting and fail-closed secret checks
To run the complete automated test suite:
npm testResult:
```text
================================================================================
🏁 TEST SUITE COMPLETED: 54 PASSED, 0 FAILED
================================================================================
- JWT Session Protection: HMAC SHA-256 tokens stored in
HttpOnly,SameSite=Lax,Securecookies. - Salted Password Hashing: Cryptographic PBKDF2/SHA-256 with unique per-user salts.
- Honeypot Anti-Spam: Invisible bot-detection fields on public comment forms.
- Admin Path Cloaking: Admin login buttons are completely omitted from public layouts.
- SQL Injection Defense: All database operations use prepared parameter bindings (
db.prepare().bind()).
Join our official Telegram channel for updates, announcements, and support:
- 🚀 Telegram Channel: @Qorvhex_Channel
This project is licensed under the MIT License - developed by Qorvhex. Free for personal and commercial use.