Language and platform agnostic content management system. Front end development available at https://github.com/pigottlaura/ContentDeveloperCMS-AngularApp/
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.
archive/pure_javascript_implementation
conf
configuration/database
custom_modules
documentation/template
project_defaults/templates
public
routes
server-tests
views/emails
.gitignore
README.md
app.js
package.json

README.md

Content Developer CMS

Lanugage and platform agnostic content management system

Full Documentation available at https://contentdevelopercms.eu/documentation

How it works

alt text

  • You write the JSON that defines the structure for a project
  • HTML inputs are generated in the Content Management System, to allow users to add/update content, as per the structure you defined
  • The output of this content is a JSON object, that can be accessed through a HTTPS URL request
  • The content created through this Content Management System is not specifc to any platform. The HTML-like references when defining a projects structure (such as input types, and keywords such as maxlength etc) is purely so that you don't have to learn a whole new range of terminology
  • All input types are supported, such as "text", "number", "tel", "color", "date", "time" etc. (Note - not all input types are guaranteed to work across all browsers, so if in doubt, stick to the basics)
  • When you create a new project, a Google Drive folder is automatically created. This is where any image you upload to the project will be stored
  • Every time you make a change to the structure or content of a project, a commit is made to the projects local Git repository
  • You can roll back to a previous commit at any time
  • Every project has three default access levels: Administrator (can update structure and content), Content Editor (can update content) and View Only (can only view content)
  • Custom access levels can be created, each with a unique number (or int, as it is referred to in the API), to allow more restricted access to some users. By default, all custom access levels are granted Content Editor permissions
  • By defining a "no_access" property, with an array of access level ints, on any object in the projects structure, you can prevent a user with this access level from being able to edit this content. In fact, they wont even be able to see it when they log in to edit the project
  • Custom CSS can be added by administrators in the settings panel, to control the style of the content view for all access levels
  • Every input is contained within an <app-collection-item> container, which has classes automatically applied to it, depending on the items encapsulation path i.e. the input for {"contact_details": {"address":"LIT Clonmel"}} is contained within <app-collection-item class="contact_details address">
  • The Content Management System is built on top of a REST API, and so content can be dynamically added/updated/deleted through calls to the endpoints defined in the API Documentation
  • Project settings
    • Only Administators of a project (access level 1) will have access to all settings for a project i.e. to update allowed origins, delete the project etc
    • The only settings that Content Editors (access level 2) are able to access are the name of the project, add/remove/update collaborators on a project, and add/remove/update access levels for a project
    • All other access levels (level 3 onwards) have no access to project settings

Rules

  • All objects in a projects structure must contain either an items property or an attributes property { "books":{ "items":{} }, "username":{ "attributes":{} } }

  • All properties within an items object must have an items property or an attributes property { "books":{ "items":{ "title":{ "attributes":{ "type":"text" } }, "authors":{ "items":{ "first_name":{ "attributes":{ "type": "text" } } } } } } }

  • Any object that has an items property, must also include a type property, with a value of "object" or "array" { "books":{ "type":"array", "items":{ "title":{ "attributes":{ "type":"text" } } } } } }

  • An attributes property can be an empty object, but must be present if the item is to have an input { "username":{ "attributes":{} } }

  • All property names in the project structure should be lowercase and use underscores in place of spaces. These will be replaced in the CMS view i.e "my_books" will be displayed as "My Books" { "my_books":{ "type":"array", "items":{ "title":{ "attributes":{ "type":"text" } } } } } }

  • The only attributes allowed are "class", "id", "type", "required", "maxlength", "max", "min", "alt" and "options" (for use with "select" input types) { "username":{ "attributes":{ "class": "myusernameinput red", "type": "text", "maxlength": 15 } }, "category":{ "attributes":{ "required": "required", "options": [ "fiction", "non-fiction", "other" ] } } }

  • The only properties allowed on a structure object are "attributes", "items", "input_type", "type", "no_access" (where no_access defines an array of access levels that are not allowed to edit certain levels of content) { "username":{ "attributes":{}, "no_access": [ 5, 6, 8] } }

Defaults

  • Any item that does not have an attributes property will not have a HTML input associated with it
  • Any item that has an attributes property, but does not have a input_type property, will default to a HTML input
  • Any item that has an attributes property which does not contain a type property, will default to type "text"
  • Any item that does not have a no_access property will be editable by all collaborators (except for access level 3, which have View Only access)
  • By default, all custom access levels are granted Content Editor permissions
  • By default, all origins are allowed read access, while no origins are allowed update access

API Access

  • To use the API, you must first source your public_auth_token from the settings panel of the relevant project
  • This token will be unique to your relationship with that project, and so cannot be reused across projects (or collaborators)
  • To limit the "read" access of a project, enter a comma seperated list of origins in the read_origins option on the settings page
  • To limit the "update" access of a project, enter a comma seperated list of origins in the update_origins option on the settings page
  • By default, all origins are allowed read access, while no origins are allowed update access
  • Once you have your public_auth_token and have given the origin the appropriate access, you're ready to start making requests to the API
  • Now you just need to figure out which endpoint you want to make the request to, by looking at the API Documentation to see what properties/parameters it requires
  • When creating your HTTPS request, in whatever language or platform you choose, make sure to add the public_auth_token as a header on the request before sending it
  • That's it! You're all set up and ready to make requests to the API
  • If at any time you feel that your public_auth_token has become compromised, or you just want to revoke access for all existing connections using it, you can regenerate a new token at any time in the settings panel of the project (Note - this cannot be undone)

© Laura Pigott 2017


The background image used in the app was sourced from "https://pixabay.com/en/computer-smartphone-online-digital-1231889/" and is "Free for commercial use, No attribution required" under CC0 Public Domain