Skip to content

It is an API-first CMS focused on the simplicity of development.

License

Notifications You must be signed in to change notification settings

simplesty/simplest-cms

Repository files navigation

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

  • text
  • textarea
  • select
  • checkbox
  • radio
  • number
  • email
  • range
  • search
  • time
  • datetime
  • date
  • country
  • editorhtml
  • editormarkdown
  • url
  • image
  • timestamp
  • color
  • one
  • many
  • slug

Options

  • unique
  • required
  • not-required
  • default
  • label
  • 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)
}

About

It is an API-first CMS focused on the simplicity of development.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published