A high-performance, flat-file CMS engine built with PHP. It uses the file system as a database and a "Stache" (static cache) for sub-millisecond response times.
- PHP 8.1 or higher
- Composer
Follow these steps to set up the project on your local machine:
-
Clone the repository
git clone https://github.com/maylancerdev/flat-cms.git cd flat-cms -
Install Dependencies
composer install
-
Environment Setup Copy the example environment file:
cp .env.example .env
-
Build the Cache (The Stache) Run the console command to index your content:
php bin/console stache:refresh
-
Serve the Application You can use the built-in PHP server or Laravel Herd:
php -S localhost:8000 -t public
Then visit
http://localhost:8000.
Create Markdown files in the content/ directory. Each file must have a YAML Front Matter header:
---
title: My New Post
author: Me
date: 2023-12-01
description: A short summary.
---
# Hello World
This is my post content.After adding or modifying content, you must rebuild the cache:
php bin/console stache:refreshbin/: CLI tools.content/: Your Markdown files.public/: Web root (index.php, assets).src/: Application source code.storage/: Cache and logs.views/: PHP templates.
- No Database: Files are the source of truth.
- The Stache: A PHP array cache that acts as an in-memory database.
- Design Systems: Decoupled architecture (Router, Controllers, Services).