A lightweight CMS that loads and stores its data from/to a JSON file
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app Fixed typescript errors: upgraded to recent package versions, when ne… Oct 16, 2018
assets New Export button, to download a zip of the data and schema JSON files Oct 10, 2017
build Fixed typescript errors: upgraded to recent package versions, when ne… Oct 16, 2018
default
test Fixed typescript errors: upgraded to recent package versions, when ne… Oct 16, 2018
.babelrc cms module code cleanup Sep 3, 2017
.eslintignore Implemented the CMS UI in React Oct 31, 2016
.eslintrc Implemented the CMS UI in React Oct 31, 2016
.gitignore
.jsbeautifyrc Implemented the CMS UI in React Oct 31, 2016
.jscsrc Implemented the CMS UI in React Oct 31, 2016
.npmignore Update .npmignore Oct 16, 2018
.travis.yml
LICENSE
README.md Readme Oct 23, 2017
index.js Save action does not work (#6) Nov 19, 2017
package-lock.json Fixed vulnerability issues Oct 16, 2018
package.json
preprocessor.js Convert old models markdown type to html Oct 10, 2017
server.js
tsconfig.json Convert old models markdown type to html Oct 10, 2017
webpack.config.js Made the main rendering a function, for use as a dependency in other … Oct 21, 2017
webpack.production.config.js Made the main rendering a function, for use as a dependency in other … Oct 21, 2017
with-webpack.js Upgrade module dependencies Aug 20, 2017

README.md

cms-json

A lightweight CMS loading and saving its data from/to a json file

Build Dependencies NPM Downloads MIT Node.js version

cms-json: A lightweight CMS loading and saving its data from/to a json file

Install

npm install -g cms-json

Playground

You can give cms-json a shot in the playground. It runs the CMS with a default JSON and Schema files. The Save functionality is disabled, but you can export your work via the 'Export' button.

Quick Start

cms-json

Then open your browser at:

http://localhost:3000

Why do I need this?

In a small IT company, the question of how and by whom your website can be updated is a recurrent one.

I have explored many solutions, from pure HTML sites controlled by the dev team, using fancy web frameworks, to sites generated by the marketing/product team using pure wysiwyg tools like Adobe Muse, not to mention heavy stuff like Wordpress or Drupal.

I finally came up with that very simple feature set:

  • The Content part of my site is stored as a JSON file
  • It can be edited by tech or non tech people via a very simple UI
  • It is embedded in the web site / web app by developers, and exploited with the technology they like
  • It can be stored in Git, so that in case of conflicts, it can be solved as with any other source files
  • Last but not least, it can be run as an npm module. No Apache, no nginx, no PHP, no database, just simplicity of use.

Although tons of CMS products exist on the market, I didn't find any one fulfilling the constraints above.

Usage

Usage: cms-json {OPTIONS}

Standard Options:

    --schema, -s   JSON schema file.
                   Default is data/schema.json.

    --data, -d     JSON data file.
                   Default is data/data.json.

    --port, -p     Server port.
                   Default is 3000.

What's new

v0.1.1

  • The 'model' files are now standard JSON Schema Draft 6 files. See http://json-schema.org/.
  • Added a 'Developer' mode, to add/edit/delete nodes and fields. This mode is activated by default. Switching to 'Author' mode disables all schema editing features.
  • On a side note, I migrated the entire code base to Typescript.

v0.1.3

  • Show JSON data and schema on the right and sync with editor
  • Improved author view (removed useless dev stuff)

API

run([options]) ⇒ *

Run an Express server embedding a simple UI for editing the content of the given dataFile.

Kind: global function
Returns: * - The express app

Param Type Description
[options] Object
[options.dataFile] Object A JSON file with the content. This parameter is mandatory. The content authored from the web site will be saved with that path name. The structure of this JSON file must match the model. See an example here: https://github.com/amelki/cms-json/blob/master/default/data.json
[options.modelFile] Object A JSON schema file representing the model to support/ease authoring via the UI. This parameter is mandatory. See an example here: https://github.com/amelki/cms-json/blob/master/default/schema.json
[options.port] Object The server port. 3000 by default