Lakutata provides web services, command-line 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 object options and action input; and transports expose the controllers over HTTP (Express, Fastify), the
command line (Commander), service calls (HTTP, Socket.IO, JSON-RPC 2.0, gRPC, NATS, Electron IPC, NW.js, React Native),
MCP, D-Bus, schedules and message queues. One controller method can serve several of them at the same time.
Quick start
npx @lakutata/cli create --name my-app
cd my-app
npm run dev
# in another terminal
curl 'http://localhost:8080/example?name=you' # {"message":"Hello, you!"}
Lakutata requires Node.js 18.10 or later (>=18.10.0). The lakutata create templates provide a web service, a
command-line tool, an HTTP API with a React, Vue, Next.js or Nuxt interface, or an Electron or NW.js desktop
application. An application written manually looks like this:
import {Application, DTO} from 'lakutata'
import {buildEntrypoints, Controller} from 'lakutata/com/entrypoint'
import {GET, ServiceAction} from 'lakutata/decorator/ctrl'
import {Expect} from 'lakutata/decorator/dto'
import {expressHTTPEntrypoint} from 'lakutata/adapter/express'
class GreetDTO extends DTO {
@Expect(DTO.String().optional().default('world'))
public name: string
}
class GreetController extends Controller {
//GET /greet?name=you, and the service action {cmd: 'greet', name: 'you'}
@GET('/greet', GreetDTO)
@ServiceAction({cmd: 'greet'}, GreetDTO)
public async greet(input: GreetDTO): Promise<{ message: string }> {
return {message: `Hello, ${input.name}!`}
}
}
Application.run(() => ({
id: 'com.example.greeter',
name: 'Greeter',
components: {
entrypoint: buildEntrypoints({
controllers: [GreetController],
http: expressHTTPEntrypoint({port: 8080})
})
},
bootstrap: ['entrypoint']
}))
Packages
lakutata is the framework: it re-exports most of the packages below under its subpaths (lakutata/com/database,
lakutata/adapter/express…), so an application usually installs it alone, plus the drivers and adapters it uses.
| Package | What it provides | In lakutata |
|---|
lakutata | The framework, with the log and entrypoint components preset | |
@lakutata/core | Applications, objects, dependency injection, DTO validation | yes |
@lakutata/entrypoint | Controllers and their transports: HTTP, command line, service calls, schedules | yes |
@lakutata/logger | The logger (JSON lines compatible with pino) | yes |
@lakutata/utils | Time and helper functions | yes |
@lakutata/orm | Databases on TypeORM, an embedded MongoDB, migrations | yes |
@lakutata/cache | A cache over memory, files, Redis, Memcache, MongoDB, SQLite, PostgreSQL or MySQL | yes |
@lakutata/mutex | Locks shared between processes and instances | yes |
@lakutata/queue | Message queues over memory, Redis, NATS, RabbitMQ or Kafka | yes |
@lakutata/i18n | Messages in several languages (ICU MessageFormat) | yes |
@lakutata/security | Password hashing, signatures, encryption | yes |
@lakutata/monitor | CPU, memory, event loop and HTTP request monitors | yes |
@lakutata/docker | Docker images, containers and networks | yes |
@lakutata/containerd | containerd without Docker, for embedded Linux devices | yes |
@lakutata/nats | NATS messaging and service calls over NATS | no |
@lakutata/grpc | A gRPC client and server, and service calls over gRPC | no |
@lakutata/dbus | D-Bus services and clients | no |
@lakutata/mcp | Model Context Protocol tools, resources and prompts | no |
@lakutata/webrtc | WebRTC in TypeScript: signaling, a TURN server, a media server (SFU), WHIP and WHEP, peer connections, service actions called through data channels, a browser client | no |