https://github.com/emadasefi/emaflatcms
EmaFlat CMS is a lightweight Node.js-based Content Management System built with Express.js and Nunjucks. It allows users to create, edit, delete, and like blog posts stored as Markdown files, with support for file uploads and dynamic site settings via a JSON configuration.
https://github.com/emadasefi/emaflatcms
blog cms expressjs flatcms markdown nodejs
Last synced: about 2 months ago
JSON representation
EmaFlat CMS is a lightweight Node.js-based Content Management System built with Express.js and Nunjucks. It allows users to create, edit, delete, and like blog posts stored as Markdown files, with support for file uploads and dynamic site settings via a JSON configuration.
- Host: GitHub
- URL: https://github.com/emadasefi/emaflatcms
- Owner: emadasefi
- License: mit
- Created: 2025-06-27T21:43:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-27T22:21:03.000Z (about 1 year ago)
- Last Synced: 2025-06-27T23:26:27.699Z (about 1 year ago)
- Topics: blog, cms, expressjs, flatcms, markdown, nodejs
- Language: JavaScript
- Homepage:
- Size: 1.33 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
EmaFlat CMS: A Lightweight Node.js Content Management System
====================================
EmaFlat CMS is a lightweight Node.js-based Content Management System built with Express.js and Nunjucks. It allows users to create, edit, delete, and like blog posts stored as Markdown files, with support for file uploads and dynamic site settings via a JSON configuration. Features include live reloading with Chokidar, Markdown-to-HTML conversion with Showdown, and a simple interface for managing content. Ideal for developers seeking a minimal, customizable CMS for blogging.
📌 EmaFlat CMS is a minimalist, open-source Content Management System (CMS) built with Node.js and Express.js, designed for managing blog posts and site settings with ease. It leverages Nunjucks for templating, Markdown for post content, and a JSON-based configuration file for dynamic site settings. The CMS is ideal for developers seeking a simple, customizable platform for blogging or small-scale content management, with features like file uploads, post liking, and live reloading for development.
## 🌟 Features
-
Blog Post Management:
- Create, edit, delete, and view blog posts stored as Markdown files.
- Support for file uploads (e.g., images) associated with posts.
- Like functionality for posts, stored in post metadata.
-
Settings Management:
- Dynamic configuration of site title, description, navigation links, footer, and text direction via setting.json.
- Form-based settings updates with automatic server restart.
-
Templating:
- Uses Nunjucks for rendering dynamic HTML templates.
- Templates for homepage, blog listing, post view, post creation/editing, settings, and about page.
-
File Watching:
- Live reloading of changed files (views, routes, public, setting.json) using Chokidar for development.
-
Markdown Support:
- Converts Markdown post content to HTML using Showdown.
- Stores post metadata (e.g., title, date, likes) using Gray-Matter.
-
Static File Serving:
- Serves static assets from the public directory and uploaded files from db/uploads.
-
Error Handling:
- Basic error handling middleware for server errors.
-
Responsive Design:
- Supports text direction (ltr or rtl) via settings.
## ⚙️ Settings File (setting.json):
-
Purpose: Stores configuration data for the CMS, such as the site title, description, navigation links, footer text, and text direction. -
Structure:- cms-title: The title of the CMS (e.g., "EmaFlat").
- cms-desc: A long description for the CMS.
- header: An object mapping routes to navigation labels (e.g., "/": "Home").
- footer: Footer text (e.g., "© 2025 Emad Asefi").
- direction: Text direction (e.g., ltr for left-to-right).
## 🔗 Packages Used
The application relies on the following Node.js packages, as seen in the code:
-
express: Web framework for building the server and handling routes. -
nunjucks: Templating engine for rendering dynamic HTML. -
chokidar: File watcher for live reloading during development. -
fs (Node.js built-in): File system operations for reading/writing posts and settings. -
path (Node.js built-in): Path manipulation for file and directory handling. -
multer: Middleware for handling file uploads. -
showdown: Converts Markdown to HTML for blog post rendering. -
gray-matter: Parses front-matter in Markdown files to extract metadata. -
child_process (Node.js built-in): Used for executing the npm restart command in setting.js.
## 💡 How to Use and Start the Application :
```shell
npm install express nunjucks chokidar multer showdown gray-matter
nodemon app.js
```
## 🖼️ ScreenShots :
## — Feedback ❤️—
Your feedback helps shape the future of EmaFlat CMS, and we appreciate every contribution from the community!
Please leave a comment if you have any comments, suggestions or problems.