--- title: Introduction project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/introduction/ updated: 2026-11-19T07:46:13.427Z --- # Introduction > What Total.js Pluginable is, what comes with it and where to start. Total.js Pluginable is a starting template for an admin app. Each part of the admin is a plugin: a folder with its own menu item, screens, API actions and settings. You add the plugins your project needs, remove the ones it does not, and get a working admin around them. Pluginable runs on Total.js 5 and Node.js and keeps its settings in PostgreSQL. ![The Pluginable home screen with the Products, Profiles and Settings plugins](/files/JapUSa48s61f.webp) ## What comes with the template - **A sign-in page and one admin account.** The account is created on the first start. See [First sign-in](../first-sign-in/). - **An admin screen.** A side menu and a home screen with one tile per plugin. See [The admin screen](../admin-screen/). - **Settings.** The app name, the Total.js Message Service (TMS), a Total.js API token, Total.js OpenPlatform tokens and the settings of each plugin. See [Settings](../settings/). - **Two sample plugins.** **Products** and **Profiles** show how a plugin is built. They list sample IDs and have no real data. See [Sample plugins](../sample-plugins/). - **A bundle script.** It packs the app and each plugin into separate bundle files. See [Deploy with bundles](../bundles/). ## What to read next 1. [Install Pluginable](../install/) and [sign in](../first-sign-in/) for the first time. 2. [Change your credentials](../change-credentials/) straight away. 3. Learn the screen: [The admin screen](../admin-screen/). 4. Build your first plugin: [Add a plugin](../../recipes/add-plugin/). 5. Before you go live, read [Run in production](../production/). --- title: Install Pluginable project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/install/ updated: 2026-11-19T07:46:13.427Z --- # Install Pluginable > Get the code, connect it to PostgreSQL and start Pluginable. You need [Node.js](https://nodejs.org) with npm, Git, and a PostgreSQL server with an empty database for Pluginable. ## Install and start **1.** Get the code and open its folder: ```bash git clone https://github.com/totaljs/pluginable.git cd pluginable ``` **2.** Install the dependencies: ```bash npm install ``` **3.** Open the file `config` in the app folder and set `database` to the connection string of your PostgreSQL database. For example: ```text $api : /admin/ database : postgresql://user:password@localhost:5432/pluginable ``` Replace `user`, `password`, the host, the port and the database name with your own. See [Configuration file](../../reference/configuration/). **4.** Start Pluginable: ```bash npm start ``` **5.** Open `http://127.0.0.1:8000/admin/` in your browser. See [First sign-in](../first-sign-in/). On the first start, Pluginable creates the table `cl_config` in the database and fills it with the default settings. You do not need to run any SQL yourself. Pluginable keeps running until you stop it with Ctrl+C in the terminal. ## Use another port `npm start` uses port 8000. To use another port, start Pluginable with Node.js and pass the port: ```bash node index.js 8080 ``` ## Where your data is saved - The settings live in the table `cl_config` of your database. - The admin account lives in the file `databases/memorize_pref.json` in the app folder. Keep this file private. --- title: First sign-in project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/first-sign-in/ updated: 2026-11-19T07:46:13.427Z --- # First sign-in > Sign in with the account that Pluginable creates on its first start. On its first start, Pluginable creates one admin account with a random user name and password. ![The Pluginable sign-in form](/files/JapUSk4Hs60f.webp) ## Sign in **1.** Open `http://127.0.0.1:8000/admin/` (use your own address and port). **2.** Until the first sign-in, the page shows a **Default account** box with the user name and the password. Select **Fill in the form** to copy them into the form, or type them. **3.** Select **Sign in**. The home screen of the admin opens. After the first sign-in, the sign-in page stops showing the **Default account** box, and Pluginable deletes the plain-text copy of the password. ## Keep the account safe Anyone who opens the sign-in page before you sees the **Default account** box. So: - Sign in right after the first start, before the server is open to other people. - [Change your credentials](../change-credentials/) at once: choose your own name, user name and password. If you lose the password, see [Reset the credentials](../reset-credentials/). --- title: The admin screen project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/admin-screen/ updated: 2026-11-19T07:46:12.460Z --- # The admin screen > The parts of the admin screen: side menu, home tiles, breadcrumb, toolbar and account button. After you sign in, Pluginable shows its admin screen. Every plugin adds its own item to it. ![The admin screen with the side menu on the left and one tile per plugin](/files/JapUSa48s61f.webp) ## Side menu The menu on the left lists the plugins, in the order that each plugin sets. Select an item to open that plugin. The open plugin is highlighted. ## Home screen The home screen at `/admin/` shows one tile for each plugin in the menu. Select a tile to open the plugin. ## Breadcrumb and toolbar At the top, the breadcrumb shows where you are, for example **Home > Products**. Select **Home** to go back to the home screen. A plugin can put its own buttons on the right side of the top bar. For example, the **Products** sample shows **Create**, **Refresh** and **Options**. ## Account button The round button in the top right corner opens the account menu. It shows your name, **Change credentials** and **Logout**. See [Change your credentials](../change-credentials/) and [Sign out](../sign-out/). ## Addresses Each plugin has its own address under `/admin/`, so you can bookmark it or open it in a new tab. For example, **Settings** is at `/admin/settings/`. --- title: Sample plugins project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/sample-plugins/ updated: 2026-11-19T07:46:15.095Z --- # Sample plugins > What the Products and Profiles plugins show and how to use them as a model. Pluginable comes with two sample plugins, **Products** and **Profiles**. They have no real data: they are models that you copy when you build your own plugins. ![The Products sample plugin with a list of sample IDs and the Create, Refresh and Options buttons](/files/JapUT04Ys61f.webp) ## What they do - The list shows five random IDs that the server makes on each request. - Select an item to open its detail page. The detail page shows **Not implemented** and the ID. - **Create** shows the message **Not implemented**. - **Products** has **Refresh**, which loads new IDs, and **Options**, which stays disabled. - **Products** adds the setting **City** to [Settings](../plugin-settings/). ## Use them - To build your own plugin, copy one of them. See [Add a plugin](../../recipes/add-plugin/). - When your own plugins are ready, remove the samples. See [Remove a plugin](../../recipes/remove-plugin/). --- title: Change your credentials project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/change-credentials/ updated: 2026-11-19T07:46:13.120Z --- # Change your credentials > Change the name, user name and password of the admin account. Pluginable has one admin account. You can change its name, its user name and its password from the account menu. **1.** Select the round account button in the top right corner. ![The account menu with the name of the account, Change credentials and Logout](/files/JapUSf4Ds60f.webp) **2.** Select **Change credentials**. **3.** Fill in the form: - **Name**: the name shown in the account menu. - **Login**: the user name you type on the sign-in page. - **Password**: the new password. Keep this field empty if you do not want to change the password. ![The Change credentials dialog with the Name, Login and Password fields](/files/JapUSh4Es61f.webp) **4.** Select **SUBMIT**. The message **Credentials have been changed successfully** appears and you stay signed in. Pluginable writes the change to the file `databases/memorize_pref.json` about ten seconds later. Wait a moment before you stop the app. If you used the account on a shared computer, [sign out](../sign-out/) there. --- title: Sign out project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/sign-out/ updated: 2026-11-19T07:46:15.498Z --- # Sign out > End your session in the admin. A session lasts one month. To end it earlier, sign out. **1.** Select the round account button in the top right corner. **2.** Select **Logout**. The sign-in page opens. To come back, sign in with your user name and password. Sign out whenever you use the admin on a computer that other people use. --- title: Reset the credentials project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/reset-credentials/ updated: 2026-11-19T07:46:14.427Z --- # Reset the credentials > Create a new admin account when the password is lost. If you lose the password of the admin account, you can let Pluginable create a new account. You need access to the app folder on the server. **1.** Stop Pluginable. **2.** Delete the file `databases/memorize_pref.json` in the app folder: ```bash rm databases/memorize_pref.json ``` **3.** Start Pluginable again. **4.** Open the sign-in page. It shows a new **Default account** box with a new user name and password. Sign in with them, as in [First sign-in](../first-sign-in/). **5.** [Change your credentials](../change-credentials/) at once. Your settings and your plugins stay as they are: they are not stored in this file. --- title: Settings project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/settings/ updated: 2026-11-19T07:46:15.498Z --- # Settings > The Settings screen, its sections and how to save a change. **Settings** holds the settings of the whole app. Open it from the side menu, or go to `/admin/settings/`. ![The Settings screen with the Name field and the TMS and Total.js API sections](/files/JapUT44bs60f.webp) ## Sections - **Name**: the name of the app. It is the title of the browser tab and the heading of the sign-in page. - **TMS**: lets other apps talk to this one. See [Total.js Message Service](../tms/). - **Total.js API**: an access token for Total.js API services. See [Total.js API token](../totaljs-api/). - **Total.js OpenPlatform**: the tokens that connect the app to an OpenPlatform. See [Total.js OpenPlatform](../openplatform/). - One group for each plugin that has settings, for example **Products** with **City**. See [Plugin settings](../plugin-settings/). ## Change the name **1.** Type the new name in **Name**. The field cannot be empty. **2.** Select **SUBMIT** at the bottom of the screen. **SUBMIT** is disabled until you change something. **3.** The message **Settings have been saved successfully.** appears. The new name shows in the browser tab straight away. Every change on this screen is saved the same way, with **SUBMIT**. Pluginable stores the settings in the table `cl_config` of the database. --- title: Total.js Message Service project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/tms/ updated: 2026-11-19T07:46:16.024Z --- # Total.js Message Service > Turn on TMS so that other Total.js apps can connect to this one. The Total.js Message Service (TMS) lets other apps publish data to this app, subscribe to its events and call its procedures. TMS is off by default. ![The TMS section with Enable TMS checked, the URL address and the Security token field](/files/JapUTA4gs61f.webp) ## Turn on TMS **1.** Open **Settings**. **2.** In the **TMS** section, check **Enable TMS**. The screen shows the **URL address** of the service: your app address followed by `/$tms/`. **3.** Select **Generate** under **Security token** to create a random token, or type your own. **4.** Select **SUBMIT**. The service is available straight away at the **URL address**. Give the other app this address and the security token. A client that sends a wrong token is disconnected. ## Keep it safe - Always set a security token. Without one, anyone who reaches the address can connect. - Keep the token secret, as you would a password. To turn TMS off, uncheck **Enable TMS**, select **SUBMIT** and restart Pluginable. The service stops after the restart. --- title: Total.js API token project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/totaljs-api/ updated: 2026-11-19T07:46:16.024Z --- # Total.js API token > Store your Total.js API access token for the plugins that use Total.js API services. Total.js API offers services such as text and image generation with AI and sending SMS messages. Plugins that call these services use the access token that you store in **Settings**. **1.** Get an access token from the [Total.js Platform](https://platform.totaljs.com/?open=services). **2.** Open **Settings** and paste the token into **Access token** in the **Total.js API** section. **3.** Select **SUBMIT**. The field hides its content. Keep the token secret: anyone who has it can use the services on your account. The template itself does not call Total.js API. The token matters only when you add plugins that use these services. --- title: Total.js OpenPlatform project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/openplatform/ updated: 2026-11-19T07:46:14.100Z --- # Total.js OpenPlatform > Connect Pluginable to a Total.js OpenPlatform, and undo it. Pluginable can run as an app inside Total.js OpenPlatform. Then people sign in to OpenPlatform and open Pluginable from there, without the Pluginable sign-in page. ![The Total.js OpenPlatform section with the import link, the Request token and Response token fields and a warning](/files/JapUSq4Os61f.webp) ## Import the app into OpenPlatform **1.** Open **Settings** and find the **Total.js OpenPlatform** section. **2.** Copy the link that ends with `/openplatform.json`. It describes the app: its name, its icon, its address and one permission for each plugin. **3.** Paste the link into the importing form of your OpenPlatform and finish the registration there. OpenPlatform gives you two tokens. **4.** Back in **Settings**, enter them in **Request token** and **Response token**. **5.** Select **SUBMIT**. ## What changes As soon as both tokens are saved: - You are signed out, and the address `/admin/` answers **401: Unauthorized** to everybody who does not come from OpenPlatform. - The Pluginable sign-in page stops working. Check both tokens carefully before you select **SUBMIT**. ## Undo it If the tokens are wrong, or you want to go back to the Pluginable sign-in, clear them in the database and restart the app: **1.** Run this SQL in the Pluginable database: ```sql UPDATE cl_config SET value = '' WHERE id IN ('op_reqtoken', 'op_restoken'); ``` **2.** Restart Pluginable. The sign-in page at `/admin/` works again with your admin account. --- title: Plugin settings project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/plugin-settings/ updated: 2026-11-19T07:46:14.427Z --- # Plugin settings > Change the settings that plugins add to the Settings screen. A plugin can add its own settings to **Settings**. Each plugin gets a group with its name, for example **Products** with the setting **City**. ![Plugin settings: an Orders group with a number, a text and an on/off setting, and a Products group with City](/files/JapUSu4Rs60f.webp) ## Change a plugin setting **1.** Open **Settings** and scroll to the group of the plugin. **2.** Change the value. Numbers have up and down arrows, text has a text field, and on/off settings have a switch. **3.** Select **SUBMIT**. The plugin uses the new value straight away. ## Default values Until you save a value, the plugin uses the default value that its developer set in the plugin. The field on the Settings screen shows `0`, an empty field or the switch turned off instead of that default. Once you save a value, the field shows the saved value. To add settings to your own plugin, see [Add plugin settings](../../recipes/add-plugin-settings/). --- title: Run in production project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/production/ updated: 2026-11-19T07:46:14.427Z --- # Run in production > Start Pluginable in release mode and keep it safe on a server. `npm start` runs Pluginable in debug mode, which is meant for development. On a server, use release mode. ## Start in release mode Pass the port and `--release`: ```bash node index.js 8000 --release ``` The start banner shows `Mode : release`. ## Listen only on the local address By default, Pluginable listens on every network address of the server. If a reverse proxy runs on the same server, let Pluginable listen only on `127.0.0.1`. Add this line to the file `config`: ```text $ip : 127.0.0.1 ``` ## Keep it safe - Sign in right after the first start and [change your credentials](../change-credentials/). - Put a reverse proxy with HTTPS in front of Pluginable, so that passwords and sessions travel encrypted. - Allow only the people who need the admin to reach it, for example with a firewall or the access rules of your proxy. - Keep `databases/memorize_pref.json` and the file `config` private, and back them up together with the database. - If you use [TMS](../tms/), always set a security token. ## Apply changes to plugins Restart Pluginable after you add, change or remove a plugin, so that it loads the new files. --- title: Deploy with bundles project: Pluginable version: 0.0.1 section: guides language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/guides/bundles/ updated: 2026-11-19T07:46:12.460Z --- # Deploy with bundles > Pack the app and its plugins into bundle files and run them on another server. A bundle is one file that holds part of the app. The script `bundle.sh` makes one bundle for the app itself and one for each plugin. On the server, you choose which plugin bundles to install. ## Make the bundles In the app folder, run: ```bash node bundle.sh ``` The script writes the bundles to the folder `--bundles--`: - `app.bundle`: the app with the **Settings** plugin. - One file for each other plugin, for example `admin.bundle`, `products.bundle` and `profiles.bundle`. `admin.bundle` holds the sign-in page and the admin account. Always install it unless you use [OpenPlatform](../openplatform/): without it, the admin opens for anyone with no sign-in. ## Run the bundles on a server **1.** Create a folder for the app with a subfolder `bundles`. **2.** Copy into the app folder the files `index.js`, `package.json` and `config` from Pluginable. **3.** Copy `app.bundle`, `admin.bundle` and the plugin bundles you want into `bundles`. **4.** Set `database` in `config` to an empty PostgreSQL database. **5.** The bundles do not create the database table, so run the file `database.sql` from Pluginable once, for example with `psql`: ```bash psql postgresql://user:password@localhost:5432/pluginable -f database.sql ``` **6.** In the app folder, install the dependencies and start the app: ```bash npm install node index.js 8000 --release ``` On start, Pluginable unpacks the bundles into the folder `.src` and runs from there. The menu shows only the plugins whose bundles you installed. To update a plugin, make the bundles again, replace its file in `bundles` and restart the app. --- title: Configuration file project: Pluginable version: 0.0.1 section: reference language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/reference/configuration/ updated: 2026-11-19T07:46:16.797Z --- # Configuration file > The keys of the file config in the app folder. The file `config` in the app folder holds the settings that Pluginable needs before it can reach the database. Each line is a key, a colon and a value. Restart Pluginable after you change it. ```text $api : /admin/ database : postgresql://user:password@localhost:5432/pluginable ``` ## Keys | Key | Value | |---|---| | `database` | Connection string of the PostgreSQL database: `postgresql://user:password@host:port/database`. Required. | | `$api` | Address of the admin and its API. Keep `/admin/`. | | `$ip` | Network address to listen on. Use `127.0.0.1` behind a reverse proxy on the same server. By default Pluginable listens on every address. See [Run in production](../../guides/production/). | | `token` | Access token for scripts and other servers. Not set by default. See [Call the API with a token](../../recipes/api-token/). | ## Settings stored in the database The name of the app, TMS, the Total.js API token, the OpenPlatform tokens and the plugin settings are not in this file. You change them on the [Settings](../../guides/settings/) screen, and Pluginable keeps them in the table `cl_config`. Keep `config` private: it holds the database password. --- title: Plugin folder project: Pluginable version: 0.0.1 section: reference language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/reference/plugin-folder/ updated: 2026-11-19T07:46:16.797Z --- # Plugin folder > The files and folders of a plugin. Every folder in `plugins` is one plugin. Pluginable loads all of them on start. The sample **Products** plugin looks like this: ```text plugins/products/ ├── index.js ├── schemas/ │ └── products.js └── public/ ├── index.html └── detail.html ``` ## index.js Describes the plugin: its name, icon, position in the menu, routes, permissions and settings. Required. See [Plugin options](../plugin-options/). ## schemas The server actions of the plugin, one or more `.js` files with `NEWACTION(...)`. The `ROUTE` lines in `index.js` make them available to the screens. ## public The screens of the plugin: - `index.html`: the main screen, opened from the menu at `/admin//`. - Other `.html` files: extra screens listed in `exports.routes`, such as `detail.html`. See [Add a detail page](../../recipes/add-detail-page/). ## Built-in plugins | Folder | What it does | |---|---| | `admin` | Sign-in page, admin account and account menu. | | `settings` | The Settings screen. | | `products`, `profiles` | Samples. See [Sample plugins](../../guides/sample-plugins/). | --- title: Plugin options project: Pluginable version: 0.0.1 section: reference language: en license: MIT url: https://totaljs.es/docs/pluginable/0-0-1/reference/plugin-options/ updated: 2026-11-19T07:46:16.797Z --- # Plugin options > Every option that a plugin can set in its index.js. A plugin describes itself with `exports.