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
| Subpath | What it provides |
|---|---|
lakutata | Application, 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/dtos | PaginationSearchDTO, PaginationResultDTO, paginator, FlexibleDTO, JSON Schema conversion |
lakutata/com/entrypoint | Entrypoint, 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/fastify | The HTTP adapters |
lakutata/adapter/commander | The CLI adapter |
lakutata/adapter/socket.io, lakutata/adapter/jsonrpc, lakutata/adapter/electron, lakutata/adapter/nwjs, lakutata/adapter/react-native | The service adapters |
lakutata/com/logger | The Logger component, preset as log (pino-compatible JSON lines) |
lakutata/orm, lakutata/decorator/orm | TypeORM and its decorators |
lakutata/com/database, lakutata/provider/database | The Database component and provider |
lakutata/com/cacher | The Cacher component |
lakutata/com/mutex | The Mutex component, @Synchronized |
lakutata/com/queue | The Queue component, @QueueAction, queueEntrypoint |
lakutata/com/i18n | The I18n component, the Translator, the language middleware |
lakutata/com/docker | The Docker component |
lakutata/com/containerd | The Containerd component |
lakutata/com/monitor | CPU, memory, event loop and HTTP monitors |
lakutata/security, lakutata/provider/passwordHash | Hashing, ciphers, signatures, the PasswordHash provider |
lakutata/utils | Helper 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
| Guide | Topic |
|---|---|
| Getting Started | Requirements, creating a project, adding Lakutata to an existing project, a first application |
| Concepts | The 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 Structure | Files, scripts and features of projects created from the templates, and custom templates |
| Application Design | Structuring an application: each part's class, where logic and state live, configuration, creation order, tests |
| Upgrading from Lakutata 2.x | Upgrading a project from Lakutata 2.x (the lakutata 2.x package) |
| Upgrading from Lakutata 1.x | Porting a project from Lakutata 1.x (@lakutata/core 1.x and the @lakutata-module/*, @lakutata-component/* packages) |
| Application | The application: its options, fluent API, lifecycle and mode, packed applications |
| Objects and Lifetimes | Components, providers and their container: lifetimes, scopes, creation and teardown, a container without an application |
| Dependency Injection | Dependency injection, object options, sharing features between applications |
| Modules | Modules: features with their own components and providers, how their objects are resolved, configuring them from the application |
| DTO and Validation | DTOs and schemas: validating options, inputs and results |
| Exceptions | Declaring exceptions, their messages, what clients receive, the framework's exceptions |
| Logging | The log component: writing lines, readable lines or JSON, destinations, another logger |
| Decorators | The decorators, by subpath |
| Time | The Time class |
| Helper Functions | The helper functions of lakutata/utils |
| Controllers and Actions | Controllers and actions: their addresses, input and results, prefixes, inheritance |
| Entrypoint | The entrypoint component: its options and adapters, starting and stopping, the list of actions |
| Middlewares and Access Control | Middlewares and access control for actions |
| HTTP | The HTTP adapters: routes, input, responses, errors, Express and Fastify features |
| Command Line | Command-line tools: commands, options, prompts, output and exit codes |
| Service Calls | Service actions over HTTP, Socket.IO, JSON-RPC 2.0, Electron and NW.js: patterns, responses, clients and their events |
| gRPC | Service actions over gRPC (@lakutata/grpc), and calling them from other applications and languages |
| NATS | The NATS component, service actions over NATS (@lakutata/nats), service proxies and their events |
| Scheduled Jobs | Scheduled jobs: intervals, cron expressions, jobs run by one instance |
| Queues | Message queues: producers, @QueueAction consumers, retries, dead letters, results |
| Databases | The Database component and provider, connection options, multiple databases |
| Database Drivers | Each database driver: what to install, its options, its limits |
| Embedded MongoDB | A MongoDB inside the application (@lakutata/mongo-embedded) that keeps its documents in a file |
| Entities, Queries and Transactions | Entities, queries, transactions and errors |
| Migrations | Writing, generating and running migrations |
| Cache | The Cacher component: wrap(), stores and their tiers, what they keep |
| Mutex | Locks shared between processes and instances |
| Internationalization (i18n) | Messages in several languages |
| Docker Integration | The Docker component |
| Containerd Integration | The Containerd component |
| Monitors | The CPU, memory, event loop and HTTP request monitors |
| Security | Hashing, ciphers, signatures, passwords |
| D-Bus | A D-Bus service and client (@lakutata/dbus): methods, objects, properties, signals |
| MCP | Model Context Protocol tools, resources and prompts (@lakutata/mcp), over stdio and HTTP |
| WebRTC | Peer-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 |
| FFI | The C functions of native libraries (@lakutata/ffi): declarations copied from headers, structs, callbacks, memory, packaging |
| Barcode | Barcodes and QR codes (@lakutata/barcode): generating them as PNG, SVG or pixels, sizes for print, EAN, UPC and GS1, reading them from images |
| Thermal Printers | Thermal 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 |
| LDAP | The 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 |
| Math | Mathematics (@lakutata/math): formulas and exact results, equations, decimals of any precision, matrices, statistics, numeric solutions, units |
| Netif | Network 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 |
| Serial | Serial 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 Engine | LDAP 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 Tool | The lakutata command: creating projects, migrations, translations, environment variables |
| Workspaces | Multi-package projects: running scripts, versioning packages, adding packages |
| Native Addons | Native addons in C++ or Rust: creating them, linking libraries, shipping them |
| Packaging | Bundles and executables, and what a packed application reads at run time |
| Installers | Each 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.