---
title: Introduction
project: Total.js V5
version: 0.0.20
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/total-js-v5/0-0-20/guides/introduction/
updated: 2026-11-19T20:13:56.297Z
---

# Introduction

> What Total.js framework v5 is, what the total5 package includes and the main concepts of a Total.js application.

Total.js framework v5 is a framework for the Node.js platform, written in pure JavaScript. The package README compares it with PHP's Laravel, Python's Django and ASP.NET MVC, and says it can be used for a web, desktop, service or IoT application.

It is published on npm as `total5`, under the MIT license, by Peter Širka. The source code lives in the `totaljs/framework5` repository on GitHub.

```bash
$ npm install total5@beta
```

## One package, no dependencies

The `total5` package does not declare any npm dependency. Everything the framework needs is inside the package: the HTTP server, the router, the view engine, the database layers, the mailer, the image processing, the workers and the Flow engine. You load it once with `require('total5')` and the framework registers its API as globals (`ROUTE()`, `NEWACTION()`, `NOSQL()`, `CONF`, `F` and many more), so application files can use them without any `require()`.

```js
require('total5');

ROUTE('GET /', function($) {
	$.plain('Hello world');
});

F.http({ port: 8000 });
```

The package also installs two command-line tools, `total5` and `flow5`. They are described in [Command line](../command-line/).

## What the package includes

The package is a set of modules. Each module covers one area of a typical application:
| Area | Modules | Main API |
|------|---------|----------|
| HTTP server and routing | `http.js`, `routing.js`, `controller.js` | `ROUTE()`, the controller `$` |
| Actions and schemas | `builders.js`, `jsonschema.js` | `NEWACTION()`, `ACTION()`, `NEWSCHEMA()` |
| Views and templates | `viewengine.js`, `tangular.js`, `templates.js`, `markdown.js` | `$.view()`, `TEMPLATE()` |
| WebSocket | `websocket.js` | `ROUTE('SOCKET ...')`, `WEBSOCKETCLIENT()` |
| NoSQL embedded database | `nosql.js`, `nosql-*.js` | `NOSQL()` |
| Query builder for SQL databases | `querybuilder.js` | `DATA`, `DB()`, `NEWDB()` |
| File storage | `filestorage.js` | `FILESTORAGE()` |
| Outgoing HTTP requests | `utils.js`, `builders.js` | `REQUEST()`, `RESTBuilder`, `AJAX()` |
| Mail | `mail.js` | `MAIL()`, `HTMLMAIL()`, `Mail` |
| Scheduling | `cron.js` | `CRON()` |
| Images | `images.js` | `Image` |
| Plugins and components | `index.js`, `components.js` | `plugins/` directory, `NEWCOMPONENT()` |
| Flow engine | `flow.js`, `flowstream.js`, `flow-flowstream.js` | FlowStream, `flow5` |
| Total.js Message Service | `tms.js` | `NEWPUBLISH()`, `NEWSUBSCRIBE()`, `PUBLISH()`, `SUBSCRIBE()` |
| API services | `api.js` | `API()`, `NEWAPI()` |
| Workers and threads | `workers.js`, `cluster.js` | `NEWTHREAD()`, `NEWTHREADPOOL()` |
| Python scripts | `pypeline.js` | `PYPELINE()` |
| Utilities | `utils.js`, `htmlparser.js`, `minificators.js`, `macros.js` | `U`, `NEWMACRO()` |
| AI models | `aimodel.js` | `NEWAIMODEL()`, `AIMODEL()`, `AIPARSER()` |
| Proxy | `proxy.js` | `PROXYSERVER()`, `PROXYCLIENT()` |
| Other modules | `ldap.js`, `cms.js`, `uibuilder.js`, `openclient.js`, `bundles.js`, `edit.js` | `LDAP()`, `OPENCLIENT()`, bundles, remote editing |
| Start and watcher | `debug.js`, `release.js` | `Total.run()` (`F.run()`) |

## Main concepts

### Application directory

A Total.js application is a directory with a start script and a set of known subdirectories (`controllers`, `actions`, `schemas`, `plugins`, `public`, `views` and others). The framework loads them automatically when it starts. See [Installation and first app](../installation/) and [Application structure](../application-structure/).

### Routes and the controller

A route maps an HTTP method and a URL to a handler. The handler receives the controller `$`, which holds the request and has the methods for the response (`$.plain()`, `$.json()`, `$.html()`, `$.view()`, `$.file()` and others).

```js
exports.install = function() {
	ROUTE('GET /', function($) {
		$.plain('Hello world');
	});
};
```

See [Routing](../routing/) and [Controller](../controller/). Static files, middleware and authorization are in [Middleware](../middleware/), [Static files](../static-files/) and [Authorization](../authorization/).

### Actions

Actions are the business logic of the application. An action has a name, an optional input schema and a handler. Routes can call actions directly with the `-->` operator, so the same logic is reachable from HTTP, from other actions and from code.

```js
NEWACTION('hello', {
	name: 'Say hello',
	action: function($) {
		$.success('Hello from an action');
	}
});

ROUTE('GET /api/hello/ --> hello');
```

See [Actions](../actions/) and [JSON schemas](../json-schemas/).

### Views

The view engine renders HTML templates from the `views` directory with models, layouts and helpers. See [Views](../views/) and [Localization](../localization/).

### Configuration

The `config` file in the application root holds key/value settings, read into the global `CONF` object. See [Configuration](../configuration/).

### Data

The framework includes an embedded NoSQL database stored in the `databases` directory (`NOSQL()`), a query builder for SQL databases (`DATA`, `DB()`, `NEWDB()`) and a file storage (`FILESTORAGE()`). See [NoSQL](../nosql/), [QueryBuilder](../querybuilder/) and [File storage](../file-storage/).

### Plugins and components

A plugin is a self-contained part of an application in `plugins/<name>/`, with its own controllers, actions, schemas and definitions. Components (`NEWCOMPONENT()`) compile reusable HTML components. See [Plugins and components](../plugins-and-components/).

### FlowStream

FlowStream is the Total.js visual programming engine: data flows between connected components in a flow schema. The `flow5` binary runs flow schemas directly. See [FlowStream](../flowstream/).

### TMS and APIs

The Total.js Message Service (TMS) publishes and subscribes messages between Total.js applications over WebSocket, and `API()` calls remote API services. See [Message Service (TMS)](../message-service-and-apis/) and [APIs](../apis/).

### AI models

The `aimodel.js` module registers AI model handlers with `NEWAIMODEL()` and builds requests for them with `AIMODEL()`: system and user messages, tools, streaming and callbacks. `AIPARSER()` parses AI responses. See [AI models](../ai-models/).

### Everything else

WebSocket, outgoing HTTP requests, mail, scheduling and events, workers and threads, images and utilities each have their own guide: [WebSockets](../websockets/), [HTTP requests](../http-requests/), [Mail](../mail/), [Scheduling and events](../scheduling-and-events/), [Workers and threads](../workers-and-threads/), [Images](../images/), [Utilities](../utilities/), [Prototypes](../prototypes/), [Proxy](../proxy/), [LDAP](../ldap/), [Markdown](../markdown/), [HTML and XML parser](../html-parser/), [Macros](../macros/), [Tangular](../tangular/), [Minification](../minification/) and [CMS compiler](../cms/).

## Where to go next

1. [Installation and first app](../installation/): install the package, write the start script and the first route.
2. [Application structure](../application-structure/): the full list of directories and files.
3. [Routing](../routing/) and [Actions](../actions/): the two parts every application uses.
