Total.js CMS

repository·master·Indexed 42 days ago

https://github.com/totaljs/cms

A content management system built on the Total.js platform for rapid deployment and extensibility. Version 1.0.0 provides a Node.js-based CMS with built-in plugins for administration, dashboard metrics, file management with image optimization, layout templates, and navigation structures.

Tokens
6.4K
Snippets
25
Records
34
Agent score
54%

What's inside Total.js CMS

  1. Install and run Total.js CMS using Docker

    master

    You can deploy Total.js CMS using Docker by pulling the official image and running it with port mapping. This command maps the container's port 8000 to your host's port 8000.

    docker pull totalplatform/cms
    docker run -p 8000:8000 totalplatform/cms
  2. Install Total.js CMS locally

    master

    To run Total.js CMS on your local machine, ensure you have Node.js installed. Follow these steps:

    1. Download the CMS source code.
    2. Open your terminal and navigate to the CMS directory:
      cd cms
    3. Install dependencies:
      npm install
    4. Start the application using the npm script:
      npm run start

    Alternatively, you can run the application directly using the node executable. The port is optional and defaults to 8000 if not provided.

    npm install
    npm run start
  3. Configure the Posts plugin permissions and visibility

    master
    The Posts plugin defines its own permission identifier posts. Visibility of the plugin in the CMS interface is determined by a visibility function that grants access if the user is a Super Admin (user.sa), has the posts permission, or has the admin permission.
  4. Configure Pages plugin permissions and visibility

    master
    The Pages plugin defines its own permission identifier as pages. Visibility in the CMS interface is determined by a rule that allows access if the user is a Super Admin (user.sa), has the pages permission, or has the admin permission.
  5. Configure Settings plugin permissions and visibility

    master
    The Settings plugin defines its own permission requirement and visibility logic. It requires the settings permission or admin status. It is visible to users who are Super Admins (sa), have the settings permission, or have the admin permission.
  6. Navigation plugin permissions and visibility

    master

    Access to the Navigation plugin is controlled by permissions. The plugin defines a specific permission ID: navigation.

    The plugin is visible in the CMS interface if the user meets any of the following criteria:

    1. The user is a Super Admin (user.sa).
    2. The user has the navigation permission.
    3. The user has the admin permission.
  7. Run Total.js CMS with Docker Compose

    master

    You can deploy Total.js CMS using Docker Compose. The default configuration builds the image from the local directory and maps port 8000 on the host to port 8000 inside the container.

    services:
      web:
        build: .
        ports:
          - "8000:8000"
  8. Install the Dashboard plugin

    master
    The Dashboard plugin provides the main dashboard view and various metrics for the Total.js CMS. It is identified by the name @(Dashboard) and uses the icon ti ti-dashboard. During installation, it registers several API routes used to fetch dashboard metrics such as online users, referrers, browsers, pages, and general statistics.
  9. Install and configure the Redirects plugin

    master

    The Redirects plugin manages URL redirects and SEO routing. It can be integrated into a Total.js CMS instance via the install lifecycle method. The plugin exposes several API routes for managing redirect data, including reading, removing, listing, and saving redirects.

    Access to the plugin's management interface is controlled by permissions. A user can see the plugin if they have sa (Super Admin) status, the redirects permission, or the admin permission.

    exports.install = function() {
    	ROUTE('+API    ?    -redirects_read               --> Redirects/read');
    	ROUTE('+API    ?    -redirects_remove             --> Redirects/remove');
    	ROUTE('+API    ?    -redirects_list               --> Redirects/list');
    	ROUTE('+API    ?    +redirects_save               --> Redirects/save');
    };
  10. Install and configure the Navigation plugin

    master

    The Navigation plugin manages menu items and navigation structures within the CMS. It registers several API routes for managing navigation data.

    When installed, the plugin provides the following API endpoints:

    • GET /+API? -nav_list: Triggers Nav/list to retrieve the navigation list.
    • POST /+API? +nav_save: Triggers Nav/save to save navigation changes.
    • GET /+API? +nav_read: Triggers Nav/read to read specific navigation data.
    • POST /+API? +nav_remove: Triggers Nav/remove to delete navigation items.
    • GET /+API? -nav_editor: Triggers Nav/editor to access the navigation editor.
    // The plugin is typically installed via the CMS plugin manager
    // It registers the following routes automatically upon installation:
    ROUTE('+API    ?    -nav_list          --> Nav/list');
    ROUTE('+API    ?    +nav_save          --> Nav/save');
    ROUTE('+API    ?    +nav_read          --> Nav/read');
    ROUTE('+API    ?    +nav_remove        --> Nav/remove');
    ROUTE('+API    ?    -nav_editor        --> Nav/editor');
  11. Install the Variables plugin

    master

    The Variables plugin can be installed into the Total.js CMS environment. Upon installation, it registers specific API routes for reading and saving global variables used in templates and logic.

    Registered API routes:

    • +API ? -variables_read --> Variables/read: Used to read variables.
    • +API ? +variables_save --> Variables/save: Used to save variables.
    exports.install = function() {
    	ROUTE('+API    ?    -variables_read    --> Variables/read');
    	ROUTE('+API    ?    +variables_save    --> Variables/save');
    };
  12. Install and configure the Layouts plugin

    master

    The Layouts plugin manages page templates and layout structures within the Total.js CMS. It provides a set of API routes for listing, reading, cloning, importing, and saving layout HTML. During installation, the plugin registers several API endpoints using the +API prefix and specific query parameters to trigger layout management actions.

    // The plugin defines the following API routes during installation:
    ROUTE('+API    ?    -layouts_list               --> Layouts/list');
    ROUTE('+API    ?    +layouts_read               --> Layouts/read');
    ROUTE('+API    ?    +layouts_clone              --> Layouts/clone');
    ROUTE('+API    ?    +layouts_html               --> Layouts/HTML/read');
    ROUTE('+API    ?    +layouts_remove             --> Layouts/remove');
    ROUTE('+API    ?    +layouts_import             --> Layouts/import');
    ROUTE('+API    ?    +layouts_save_html  <5MB  --> Layouts/HTML/save');
    ROUTE('+API    ?    +layouts_save               --> Layouts/save');