Content Management System

Vertex 360 sites are equipped with a content management system "out of the box" with a corresponding REST API and viusally-based management dashboard for creating, updating and deleting records. The data is stored in a local database which closely follows the Mongo DB structures. The data is persistent and resolves to a backing layer separate from the host node which ensures integrity of the data across sessions.

The visual dashboard is ideal for making quick changes to persistent data without creating a custom admin dashboard within your application (although you can still do that) and for collaborating with non-developers who need manage the content such as clients, colleagues or even friends.

Admin Dashboard

The CMS admin dashboard is a visually based editing tool for managing all content in the CMS. The admin dashboard for Vertex sites is accessed by clicking the "Configuration" menu link on the sidebar of your site's admin console:



Here, you will see your site loaded into an editing console with a vertical menu bar on the left. Click the grey button labeled "CMS" to access the dashboard:



This loads the content management system editor where you can manually update the data for your site. The data types ("resources") are located in the select dropdown on the upper right corner. When selecting a resource from this list, the current records stored under that resource appear in the left-hand column.



To update or delete a record, select the entry from the left-hand sidebar menu. This will load the corresponding record into the editor where you can change its attribute values or delete it:

Database

Every Vertex site is supported by a local database which runs in memory (similar to Redis) and ultimately resolves to a persistent backing layer as a flat file. The database APIs are very similar to Mongo DB and the ORM mirrors Mongoose. Although the database is not literally a Mongo DB implementation, it is a good way to learn the Mongo APIs without having to configure a 3rd party managed service or set up your own Mongo server with all that entails.

Models

Within the Vertex project scaffold, the models are stored under the "models" folder. The schema is defined in the "props" object and each attribute is defined by an object containing a set of configuration options (type, default, trim, etc). The supported data types for the "types" setting are: String, Number, Object, Array, and Date.

Post Model

Controllers

Full CRUD operations for each model are supported in controller files under the "controllers" folder of each Vertex project. Although not required, these pre-configured controllers are a convenient tools for working with your CMS data immediately rather than spending time writing boilerplate for each defined model. The controllers come equipped the following methods:

  • get(params) - fetch an array of records based on query filters in the "params" object
  • getById(id) - fetch an individual record based on the "id" string
  • post(body) - create a new record using the attributes passed in the "body" argument
  • put(id, params) - update an existing record with "id" unique identifier and updated attributes in the "params" argument
  • delete(id) - delete an existing record with "id" unique identifier

Post Controller


Important: as stated above, these controllers are not required however, they are optimized for compatiblity with the Vertex CMS Admin Dashboard (see above). Replacing the controllers with a custom implementation should not preclude the project from running but may disable the CMS Admin Dashboard. You've been warned.

REST API

The controller CRUD operations are exposed via built-in REST API provided by the "vertexRoutes.js" file under the "routes" folder. This route exports a standard REST API in which the HTTP verbs match up with the method names in the controller class. For example, the following endpoint:

GET /api/post

queries the the Posts collection by passing the request to the controller function below:

Post Controller


Query filters can be passes in the url string which are then passed to the controller in the "params" argument:

// fetch all posts with 'news' value under category attribute:

GET /api/post?category=news

In compliance with standard REST design patterns, the following endpoints interact with the controllers as follows:

// fetch specific posts with id value '123:
GET /api/post/123

// create a new post:
POST /api/post

// update an existing post with id '123':
PUT /api/post/123

// remove an existing post with id '123':
DELETE /api/post/123

These endpoints come built-in with Vertex templates but as with all scaffolded code, you are free to remove them and design your own REST endpoints or use another architecture entirely such as GraphQL.

Important: the REST API is optimized for compatiblity with the Vertex CMS Admin Dashboard (see above). Replacing it with a custom implementation should not preclude your project from running but may disable the CMS Admin Dashboard. You've been warned.

Summary

The Vertex Content Management System provides a convenient liaison between easy-to-use visual data management and full coding control. Though not required, the CMS speeds up intial development tremendously and can also serve as a collaboration tool with non developers. As such, the CMS in conjunction with the Admin Dashboard serves as the foundation of the Vertex 360 platform in which non-developers can use Turbo sites for their own projects. If you are interested in submitting your project to the Vertex 360 platform, please contact dkwon@turbo360.co

Contact

If you have any questions, comments or feedback, feel free to contact us at matthew@turbo360.co