MCPSERV.CLUB
FlatPress

FlatPress

Self-Hosted

Lightweight PHP blog engine without a database

Active(95)
200stars
1views
Updated 1 day ago

Overview

Discover what makes FlatPress powerful

FlatPress is a **file‑based blogging engine** written entirely in PHP, designed to run on any LAMP stack without a relational database. The core engine reads posts from the filesystem, parses Markdown or HTML, and renders them through a templating layer powered by **Smarty**. This architecture keeps the runtime footprint minimal, making it ideal for low‑resource servers or embedded devices where installing a database server would be overkill.

Language

Templating

Storage

Plugin System

Overview

FlatPress is a file‑based blogging engine written entirely in PHP, designed to run on any LAMP stack without a relational database. The core engine reads posts from the filesystem, parses Markdown or HTML, and renders them through a templating layer powered by Smarty. This architecture keeps the runtime footprint minimal, making it ideal for low‑resource servers or embedded devices where installing a database server would be overkill.

Technical Stack & Architecture

  • Language: PHP 7.4+ (strict typing enabled). The codebase follows PSR‑12 coding standards, which simplifies static analysis and integration with modern IDEs.
  • Templating: Smarty 4.x is used for theme rendering, allowing developers to separate presentation from logic cleanly.
  • Storage: All content—including posts, pages, comments, and configuration—is stored as plain text files (.html, .md, or config.php). This eliminates the need for migrations, schema upgrades, or database credentials.
  • Plugin System: Hooks and filters are exposed through a lightweight event dispatcher, enabling plugins to intercept rendering, modify data structures, or add new endpoints. The plugin API is documented in the Wiki and supports widget registration for sidebar areas.

Core Capabilities

  • REST‑like API: While not a full REST service, FlatPress exposes JSON endpoints for fetching posts and comments. Plugins can extend this to provide full CRUD operations.
  • Comment Management: Built‑in comment handling includes CAPTCHA, Akismet integration, and spam filtering via a simple keyword list.
  • Multi‑Language Support: The core ships with over 20 language packs, and developers can add new locales by following guidelines in the wiki.
  • Version Control Friendly: Since all content lives in files, it can be versioned with Git or any VCS, allowing for collaborative editing and rollback.

Deployment & Infrastructure

FlatPress can be dropped into any directory served by Apache, Nginx, or even PHP‑built‑in server. It requires only a writable data folder for configuration and caching. For production, a read‑only filesystem (e.g., mounted from an NFS share) can be used for the static content, with a separate writable volume for uploads and logs. Containerization is straightforward: a minimal Docker image based on php:fpm-alpine plus an Nginx reverse proxy is the most common pattern, and official images are available on Docker Hub.

Integration & Extensibility

  • Plugin API: Developers can create plugins that hook into events such as onPostRender, onCommentSubmit, or onAdminPage. The API is well‑documented and encourages object‑oriented design.
  • Widget System: Plugins can register widgets that appear in predefined sidebars, enabling dynamic content like recent posts, tag clouds, or external feeds.
  • Webhooks: A simple webhook endpoint accepts POST requests to trigger actions like clearing caches or notifying external services after a post is published.
  • Theme Customization: Themes are pure Smarty templates with optional CSS/JS bundles. Advanced themes can extend the base layout and override partials, making it easy to create brand‑specific designs.

Developer Experience

The documentation is split into a wiki (tutorials, API reference) and an issue tracker for bugs. Community support is active on the forum, with contributors maintaining a comprehensive changelog and security policy. Configuration is done via a config.php file, which can be templated for deployment automation. Unit tests are written with PHPUnit and run in CI pipelines (GitHub Actions) to catch regressions early.

Use Cases

  • Personal Blogs: Quick setup for hobbyists who want a lightweight, database‑free solution.
  • Documentation Sites: The file‑based approach works well for static documentation that needs occasional updates.
  • IoT Dashboards: Embedded devices can run FlatPress to expose sensor data as posts without installing a DB.
  • Micro‑services: As a lightweight CMS component inside larger PHP applications, FlatPress can provide content management without pulling in heavyweight frameworks.

Advantages Over Alternatives

  • Zero Database Dependency: Removes the operational overhead of managing a DBMS, reducing attack surface and simplifying backups.
  • High Performance: File reads are cache‑friendly; no SQL parsing overhead.
  • Open Source & GPLv2: Full freedom to modify and redistribute, encouraging community contributions.
  • Extensibility with Minimal Footprint: The plugin and widget systems allow adding features without bloating the core.
  • Cross‑Platform: Works on Windows, macOS, Linux, and even embedded ARM platforms as long as PHP is available.

FlatPress offers a compelling blend of simplicity, performance, and extensibility for developers who need a lightweight, file‑based blogging engine that can be embedded or deployed anywhere PHP runs.

Open SourceReady to get started?

Join the community and start self-hosting FlatPress today