Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simplest-cms

null

readme

Note that Simplest-CMS is currently running in Preview. The version available has severe limitations that make it unsuitable for production workloads, including missing features, limited performance and stability issues. We will address all these limitations before issuing a stable release later this year.

Simplest CMS

It's a Content Management System for SPA (single-page application) websites.

  • No database
  • Simple authentication
  • You create your own structure/collections
  • License MIT

You will need to make sure your server meets the following requirements:

  • PHP >= 5.4.0
  • JSON PHP Extension

Get Started

Install or Download

npx github:simplest-cms/simplest-cms <your-directory>

or copy these files from the /dist directory.

Config

After install/copy, you need to edit the file "config.php".

Data

By standard the file is data.json

API

Types

  • <input checked="" disabled="" type="checkbox"> text
  • <input checked="" disabled="" type="checkbox"> textarea
  • <input checked="" disabled="" type="checkbox"> select
  • <input checked="" disabled="" type="checkbox"> checkbox
  • <input disabled="" type="checkbox"> radio
  • <input disabled="" type="checkbox"> number
  • <input disabled="" type="checkbox"> email
  • <input disabled="" type="checkbox"> range
  • <input disabled="" type="checkbox"> search
  • <input disabled="" type="checkbox"> time
  • <input checked="" disabled="" type="checkbox"> datetime
  • <input checked="" disabled="" type="checkbox"> date
  • <input disabled="" type="checkbox"> country
  • <input disabled="" type="checkbox"> editorhtml
  • <input disabled="" type="checkbox"> editormarkdown
  • <input disabled="" type="checkbox"> url
  • <input disabled="" type="checkbox"> image
  • <input disabled="" type="checkbox"> timestamp
  • <input disabled="" type="checkbox"> color
  • <input checked="" disabled="" type="checkbox"> one
  • <input checked="" disabled="" type="checkbox"> many
  • <input disabled="" type="checkbox"> slug

Options

  • <input disabled="" type="checkbox"> unique
  • <input checked="" disabled="" type="checkbox"> required
  • <input checked="" disabled="" type="checkbox"> not-required
  • <input checked="" disabled="" type="checkbox"> default
  • <input checked="" disabled="" type="checkbox"> label
  • <input checked="" disabled="" type="checkbox"> description

Fixed Data

If don't want the values should be a collection, add '@' before the name. Example:

(in config.php)

// ...

"schema" => [
  "@config" => [
    "title" => "text default(Inc Company)",
    "email" => "text default(myemail@domain.com)",
  ],
]

Example

In config.php

// ...

'schema' => [
  'tags'=> [
    'title'=> 'text required',
  ],
  'categories'=> [
    'title'=> 'text required',
  ],
  'posts'=> [
    'title'=> 'text required',
    'body'=> 'textarea',
    'type'=> 'select(article, project, experimental) multiple',
    'featured'=> 'checkbox default(1)',
    'published_at'=> 'date required',
    'category_id'=> 'one(categories, title)',
    'tag_ids'=> 'many(tags, title)',
  ],
  '@config'=> [
    'title'=> 'text default(Inc Company)',
    'email'=> 'text default(myemail@domain.com)',
  ],
]

To access the data via JavaScript

const getData = fetch(`./<cms-directory>/data.json`)
 .then(res => res.json())

getData().then(data) => {
  console.log('All data:', data)
}

changelog

1.6.0 (2019-11-19)

:rocket: New Feature

  • Optimize final bundle.js (1.33 MB to 630KB)

1.5.0 (2019-11-18)

:rocket: New Feature

  • New types: one and many

:house: Internal

  • improve the select compoent to accept multiple selects
  • add tests: one and many info
  • update example-dev data

1.4.0 (2019-11-18)

:rocket: New Feature

  • New types: date and datetime

:house: Internal

  • update screencast
  • update example
  • add tests: date and datetime info
  • decrease the menu width
  • display boolean value on the list page
  • add dependencies:
    • @data-io/date-fns 1.3.11
    • @material-ui/pickers 3.2.8
    • date-fns 2.7.0
  • update dependencies:
    • react and react-dom 16.12
    • formik 2.0.4
    • react-redux 7.1.3
  • update backend file to v1.2.1
    • fix remove debug message
    • fix logout and login redirection
    • fix config value

1.3.0 (2019-11-16)

:rocket: New Feature

  • New type: checkbox
  • Sytled the login form
  • Generate and verify hash password
  • Add a logout button

:house: Internal

  • add function: stringToBoolean
  • add tests: stringToBoolean, checkbox,
  • update material-ui dependency to v4.6.1
  • add docker-compose: php 5.5
  • update backend file to v1.2
    • add style to forms
    • add hash functionality
    • remove double quotes in the config file
    • small improvements
    • fix logout functionality
  • fix: when default value is a boolean value

1.2.0 (2019-11-02)

:rocket: New Feature

  • New types: textarea and select

:house: Internal

  • remove react-hooks-form
  • add formik
  • change the form and fields to use formik
  • separe the fields in a file
  • improve Info class
    • getComponentName
    • getComponentArgs
    • addError

1.1.0 (2019-10-29)

:rocket: New Feature

  • Now you can create schema that don't be necessary a collection, using the prefix '@'

:house: Internal

  • improve the menu
  • add valueEdit component
  • add new type: values_item_save
  • add new action: savevalue
  • improve structure
  • improve backend to get data.json

:memo: Documentation

  • improve the section 'api/schema'

1.0.0 (2019-10-27)

:rocket: New Feature

  • Funcionality: label, default, description were added

:house: Internal

  • able to use extract args in the schema
  • add class Info to help extract information of each field
  • use lodash dependency

:boom: Breaking Change

  • the 'collections' key in config file has changed to 'schema'

:memo: Documentation

  • add a screencast image
  • improve the section 'how to install'