Mantra is a framework based on Node.js to develop scalable and progressive projects with highly decoupled components following lean methodology with fast and high evolution.

Mantra is the core for building platforms, startups applications, enterprise systems or, virtually, any other kind of projects.

Mantra has been designed to develop high performance applications to be deployed in any scenario.

A Mantra project follows some design and software architecture principles defined in Mantra Paradigm Development Principles. With them, technical debt is minimized and testeability of components are extremely high.

Also, by its nature, the assets of a Mantra project are very well organized with separation of concerns and the code for common tasks tends to be minimal.

Install Mantra

mantrad is the command line interface (cli) to manage Mantra applications. Install it with:

Clone current version and install globally with:

$ git clone -b v1.3.0
$ cd mantrad
$ sudo npm install . -g
$ sudo npm rebuild

Check current version with:

$ mantrad version

Mantra "Hello World"

Run your first Mantra project with Mantra Hello World sample step by step.

What it is?

Mantra is a Node.js framework for lean, scalable and high performance projects, based on small and highly decoupled components.

A Mantra application is based on multiple components that interact between them using a global interaction layer (Mantra API).

Each component exposes assets (APIs, posts and gets controllers, data models, views, blocks, middlewares, cron jobs, commands, prerequests, access conditions, etc.). Mantra is in charge of the decoupled interaction between all of them. Any component can define any other asset with new functionality.

The framework intends to define simple components with very specific functionality, following S.O.L.I.D. and Dependency Injection principles, with extremely simple data models, easy updates, multiapplications within the same project and extremely well organized projects.

Mantra depends on:

  • RedEntities as object mapper for data repositories, another project of Mantra.
  • Express as core web server.
  • Mustache template redering mecanism for views.

Mantra works and has been tested in Linux environments with Node.js 12.x, 13.x, 14.x, 15.x, 16.x, 17.x and 18.x.

Currently, MySql, MariaDB, PostgreSql, Sqlite and Aurora databases are supported. Future versions will support more data providers and rendering engines.

What kind of applications can be built with Mantra?

You can use Mantra for building many different kinds of applications:

  • Scalable and high performance web applications.
  • Multisite web applications (multiple sites using same set of components).
  • Command line interface applications.
  • Applications with no UI to run any kind of tasks.
  • Microservices applications.
  • Standalone applications with specific purposes.
  • A mix of all above in the same project.

In the same Mantra project can live together all applications needed to run it: main UI, operation UI, maintenance apps, task scheduler, etc.

Mantra application samples, components and projects

In adition to the documentation, the best way to learn how to write Mantra projects is reading samples.

You can find multiple samples at Mantra Demos repository or listed at Mantra site demos section.

Also, you can download for free many official components and projects ready to use from Mantra site.

Documentation and how-tos

Learn to build Mantra projects with this documentation and read how-to guides published continuosly at Manta site how-to section.

You can also read this documentation at Mantra site.