Skip to content

Lakutata Overview ​

Lakutata is an IoC application framework for Node.js and TypeScript. It provides web services, CLI tools, desktop (Electron, NW.js) applications and embedded devices with one programming model: an application is a tree of objects (components, providers, controllers) that a container creates. DTOs validate their options and inputs, and transports expose the controllers: HTTP (Express, Fastify), CLI (Commander), service RPC (HTTP, Socket.IO, JSON-RPC 2.0, gRPC, NATS, Electron IPC, NW.js, React Native), schedules and message queues. One controller method can serve all of them at the same time.

The lakutata package re-exports the @lakutata/* packages under its subpaths (see the table below) and presets two components in every application: log (the Logger, which writes pino-compatible JSON lines) and entrypoint (the Entrypoint, which serves the controllers).

Where to start ​

Getting Started describes how to create a first project from a template and presents a first application. Concepts explains the framework's model, and Application Design describes how to structure an application on it. Project Structure describes a project's files, and the guides below cover each part of the framework. The examples build complete applications from the templates: a REST API, a command-line tool, a web application and a desktop application, calls between services, background jobs, an MCP server and a service on a device.

The subpaths ​

SubpathWhat it provides
lakutataApplication, Module, Component, Provider, BaseObject, Container, DTO, Exception, Time, isPackaged, resourcesPath, validation messages
lakutata/decorator/di@Inject, @Configurable, @Autoload, @Singleton, @Scoped, @Transient, @Lifetime
lakutata/decorator/dto@Expect, @Accept, @Return, @IndexSignature
lakutata/decorator/asst@Before, @After
lakutata/dtosPaginationSearchDTO, PaginationResultDTO, paginator, FlexibleDTO, JSON Schema conversion
lakutata/com/entrypointEntrypoint, buildEntrypoints, Controller, contexts, Result, access control, middlewares, httpServiceEntrypoint, scheduleEntrypoint
lakutata/decorator/ctrl@HTTPAction, @GET…@OPTIONS, @CLIAction, @ServiceAction, @Schedule, @Prefix, @UseMiddlewares
lakutata/adapter/express, lakutata/adapter/fastifyThe HTTP adapters
lakutata/adapter/commanderThe CLI adapter
lakutata/adapter/socket.io, lakutata/adapter/jsonrpc, lakutata/adapter/electron, lakutata/adapter/nwjs, lakutata/adapter/react-nativeThe service adapters
lakutata/com/loggerThe Logger component, preset as log (pino-compatible JSON lines)
lakutata/orm, lakutata/decorator/ormTypeORM and its decorators
lakutata/com/database, lakutata/provider/databaseThe Database component and provider
lakutata/com/cacherThe Cacher component
lakutata/com/mutexThe Mutex component, @Synchronized
lakutata/com/queueThe Queue component, @QueueAction, queueEntrypoint
lakutata/com/i18nThe I18n component, the Translator, the language middleware
lakutata/com/dockerThe Docker component
lakutata/com/containerdThe Containerd component
lakutata/com/monitorCPU, memory, event loop and HTTP monitors
lakutata/security, lakutata/provider/passwordHashHashing, ciphers, signatures, the PasswordHash provider
lakutata/utilsHelper functions

The following packages are not part of lakutata: @lakutata/cli (the lakutata command for creating projects, running migrations and packing applications, see Command-Line Tool), @lakutata/grpc (a gRPC client, server and service adapter), @lakutata/nats (a NATS component and service adapter), @lakutata/dbus (D-Bus), @lakutata/mcp (the Model Context Protocol), @lakutata/webrtc (WebRTC signaling, a TURN server, a media server, peer connections), @lakutata/ffi (the C functions of native libraries), @lakutata/math (symbolic and numeric mathematics, as functions that need no Lakutata application), @lakutata/barcode (barcodes and QR codes, generated and read in a native addon), @lakutata/netif (servers and UDP sockets listening on a network interface regardless of its addresses, the machine's interfaces and their changes), @lakutata/mongo-embedded (the embedded MongoDB that mongo-embedded databases use, in a native addon), @lakutata/thermal and @lakutata/thermal-printer (thermal printers, with receipts and labels written in HTML, and a manager component), @lakutata/serial (serial ports and Bluetooth devices), and @lakutata/ldap with @lakutata/ldap-engine (signing users in against an LDAP directory, and the application's own LDAP directory server).

The guides ​

GuideTopic
Getting StartedRequirements, creating a project, adding Lakutata to an existing project, a first application
ConceptsThe framework's model: an application as a tree of objects, the base classes and the reasons for their design, lifetimes, options, actions and transports, terminology
Project StructureFiles, scripts and features of projects created from the templates, and custom templates
Application DesignStructuring an application: each part's class, where logic and state live, configuration, creation order, tests
Upgrading from Lakutata 2.xUpgrading a project from Lakutata 2.x (the lakutata 2.x package)
Upgrading from Lakutata 1.xPorting a project from Lakutata 1.x (@lakutata/core 1.x and the @lakutata-module/*, @lakutata-component/* packages)
ApplicationThe application: its options, fluent API, lifecycle and mode, packed applications
Objects and LifetimesComponents, providers and their container: lifetimes, scopes, creation and teardown, a container without an application
Dependency InjectionDependency injection, object options, sharing features between applications
ModulesModules: features with their own components and providers, how their objects are resolved, configuring them from the application
DTO and ValidationDTOs and schemas: validating options, inputs and results
ExceptionsDeclaring exceptions, their messages, what clients receive, the framework's exceptions
LoggingThe log component: writing lines, readable lines or JSON, destinations, another logger
DecoratorsThe decorators, by subpath
TimeThe Time class
Helper FunctionsThe helper functions of lakutata/utils
Controllers and ActionsControllers and actions: their addresses, input and results, prefixes, inheritance
EntrypointThe entrypoint component: its options and adapters, starting and stopping, the list of actions
Middlewares and Access ControlMiddlewares and access control for actions
HTTPThe HTTP adapters: routes, input, responses, errors, Express and Fastify features
Command LineCommand-line tools: commands, options, prompts, output and exit codes
Service CallsService actions over HTTP, Socket.IO, JSON-RPC 2.0, Electron and NW.js: patterns, responses, clients and their events
gRPCService actions over gRPC (@lakutata/grpc), and calling them from other applications and languages
NATSThe NATS component, service actions over NATS (@lakutata/nats), service proxies and their events
Scheduled JobsScheduled jobs: intervals, cron expressions, jobs run by one instance
QueuesMessage queues: producers, @QueueAction consumers, retries, dead letters, results
DatabasesThe Database component and provider, connection options, multiple databases
Database DriversEach database driver: what to install, its options, its limits
Embedded MongoDBA MongoDB inside the application (@lakutata/mongo-embedded) that keeps its documents in a file
Entities, Queries and TransactionsEntities, queries, transactions and errors
MigrationsWriting, generating and running migrations
CacheThe Cacher component: wrap(), stores and their tiers, what they keep
MutexLocks shared between processes and instances
Internationalization (i18n)Messages in several languages
Docker IntegrationThe Docker component
Containerd IntegrationThe Containerd component
MonitorsThe CPU, memory, event loop and HTTP request monitors
SecurityHashing, ciphers, signatures, passwords
D-BusA D-Bus service and client (@lakutata/dbus): methods, objects, properties, signals
MCPModel Context Protocol tools, resources and prompts (@lakutata/mcp), over stdio and HTTP
WebRTCPeer-to-peer connections and a media server (@lakutata/webrtc): signaling, the TURN server, browsers and applications, an application's actions called through data channels, WHIP and WHEP
FFIThe C functions of native libraries (@lakutata/ffi): declarations copied from headers, structs, callbacks, memory, packaging
BarcodeBarcodes and QR codes (@lakutata/barcode): generating them as PNG, SVG or pixels, sizes for print, EAN, UPC and GS1, reading them from images
Thermal PrintersThermal printers (@lakutata/thermal, @lakutata/thermal-printer, @lakutata/serial): receipts, labels and wristbands written in HTML, choosing and saving printers, cutting, connections, serial ports and Bluetooth
LDAPThe LDAP components (@lakutata/ldap): signing users in against a directory from a controller, reading and writing it, serving a directory from the application's database, its schema, access and password policy, custom plugins, connecting SSSD, Keycloak and Gitea
MathMathematics (@lakutata/math): formulas and exact results, equations, decimals of any precision, matrices, statistics, numeric solutions, units
NetifNetwork interfaces (@lakutata/netif): a server listening on an interface regardless of its addresses, connections through other interfaces refused, the interfaces and their changes, UDP on one interface
SerialSerial ports (@lakutata/serial): a port as a stream, its line and modem lines, finding a port by its USB adapter's IDs, unplugged devices, classic Bluetooth devices
LDAP EngineLDAP without an application (@lakutata/ldap-engine): the client and its pool, signing users in, Active Directory, filters, DNs, schemas, LDIF, a server with custom backends, plugins, the protocol
Command-Line ToolThe lakutata command: creating projects, migrations, translations, environment variables
WorkspacesMulti-package projects: running scripts, versioning packages, adding packages
Native AddonsNative addons in C++ or Rust: creating them, linking libraries, shipping them
PackagingBundles and executables, and what a packed application reads at run time
InstallersEach platform's installers, services, installer scripts, signing

Each @lakutata/* package has its own README, and every subpath's type declarations document each export with an example.

Released under the MIT License.