ランタイムに縛られないTypeScriptフレームワーク

Loutreは型推論を活かしたAPIとDevToolsで、シンプルな開発体験を提供します。

npm create loutre@latest my-app
Loutre Dev
http-crudOpen
Graph9 nodes · 9 edges

MULTI-RUNTIME

好みのランタイムで、 いつものフレームワークを。

Node.js、Bun、Cloudflare Workers、AWS Lambda、Electronに対応。ランタイムが変わっても、開発スタイルはそのまま。

Node.js
Bun
app.ts
const application = defineApplication({
  modules: [UsersModule(), HealthModule()],
})

export default application
Loutre
Cloudflare Workers
AWS Lambda
Electron

アプリ構造を、ひと目で。

Loutre DevToolsなら、Moduleや依存関係、実行の流れをGraphで確認できます。

コードだけ

src/
  users/
    user.controller.ts
    user.service.ts
    user.repository.ts
  tasks/

どこから呼ばれる?

何に依存してる?

どこへつながる?

Loutre DevTools

executionUsersController

handles: create

entrypointPOST /users
middlewarevalidate.body
handlerUsersController.create

injects

providerUsersService

requires

runtime capabilityhttp.server

一目でわかる。

TYPE INFERENCE

型安全を、 シンプルに。

Contractに型を書くだけで、RequestもResponseも型がそのまま伝わります。

declare / as / is を使う必要もありません。

Contract

const AppContract = http.contract({
  greet: {
    method: 'GET',
    path: '/{name}',
    request: {
      params: {
        name: z.string(),
      },
    },
    responses: {
      ok: {
        status: 200,
        body: z.object({
          message: z.string(),
        }),
      },
    },
  },
})

Implementation

const AppController = http.implementation({
  contract: AppContract,
  factory: () => ({
    greet(ctx) {
      // stringとして推論される
      const name = ctx.input.params.name

      return ctx.response.ok({
        body: {
          message: `Hello, ${name}!`,
        },
      })
    },
  }),
})

FOR AI AGENTS

開発者とAgentで、同じGraphを見る。

Application GraphをAgentにも渡せば、開発者とAgentで構造や依存関係を共有できます。

Application Graph
executionUsersController
handles
entrypointPOST /users
flows to
handlerUsersController.create
injects
providerUsersService
agent

Agent context

route
POST /users
handler
UsersController.create
depends on
UsersService
source
integrations/http-crud/src/index.ts:54

ARCHITECTURE

アプリ全体を、 ひとつのモデルに。

Module、Provider、Execution、Runtime CapabilityをひとつのApplication Modelにまとめ、Runtime、CLI、DevTools、OpenAPIで共有します。

ApplicationModel / Graph
ModuleOwnership / Visibility
Provider & DIDependencies
ExecutionHTTP / Tasks / MessagePort
Runtime Capabilityhttp.server / queue

One model. Whole picture.

Hello Loutre!

セットアップ不要。StackBlitzで開いて、今すぐ試せます。