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)
}