Skip to content

maylancerdev/flat-cms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flat CMS

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.

Requirements

  • PHP 8.1 or higher
  • Composer

Installation

Follow these steps to set up the project on your local machine:

  1. Clone the repository

    git clone https://github.com/maylancerdev/flat-cms.git
    cd flat-cms
  2. Install Dependencies

    composer install
  3. Environment Setup Copy the example environment file:

    cp .env.example .env
  4. Build the Cache (The Stache) Run the console command to index your content:

    php bin/console stache:refresh
  5. 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.

Usage

Adding Content

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:refresh

Directory Structure

  • bin/: CLI tools.
  • content/: Your Markdown files.
  • public/: Web root (index.php, assets).
  • src/: Application source code.
  • storage/: Cache and logs.
  • views/: PHP templates.

Architecture

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

About

A high-performance, flat-file CMS engine built with PHP

Resources

Stars

Watchers

Forks

Packages

No packages published