Back to Iii

README

README.md

0.13.08.0 KB
Original Source

What is iii

You start building a backend and immediately need six different tools: an API framework, a task queue, a cron scheduler, pub/sub, a state store, and an observability pipeline. Each has its own config, its own deployment, its own failure modes. A simple "process this, then notify that" workflow touches three services before you write any business logic.

iii replaces all of that with a single engine and three primitives: Function, Trigger, and Worker.

A Function is anything that does work. A Trigger is what causes it to run - an HTTP request, a cron schedule, a queue message, a state change. A Worker connects your functions to the engine. You write the function, declare what triggers it, connect a worker, and the engine handles routing, retries, and observability.

One config file. One process. Everything discoverable. Think of it the way React gave frontend a single model for UI - iii gives your backend a single model for execution.

Three Concepts

ConceptWhat it does
FunctionA unit of work. It receives input and optionally returns output. It can exist anywhere: locally, in the cloud, on serverless, or as a third-party HTTP endpoint.
TriggerWhat causes a Function to run - explicitly from code, or automatically from an event source. Examples: HTTP route, cron schedule, queue topic, state change, stream event.
WorkerThe runtime that connects your functions and triggers to the engine. Workers register and deregister themselves without configuration. Once connected, their functions are available across the entire backend.

Quick Start

bash
curl -fsSL https://install.iii.dev/iii/main/install.sh | sh
iii-cli start --use-default-config

Your engine is running at ws://localhost:49134 with HTTP API at http://localhost:3111.

For a project-backed setup, create config.yaml in your working directory or pass iii-cli start --config /path/to/config.yaml.

Connect a worker

bash
npm install iii-sdk
javascript
import { registerWorker, Logger } from 'iii-sdk';

const iii = registerWorker('ws://localhost:49134');
const logger = new Logger();

iii.registerFunction({ id: 'math.add' }, async (input) => {
  return { sum: input.a + input.b };
});

iii.registerTrigger({
  type: 'http',
  function_id: 'math.add',
  config: { api_path: 'add', http_method: 'POST' },
});

const result = await iii.trigger({ function_id: 'math.add', payload: { a: 1, b: 2 } });
logger.info('result', result); // { sum: 3 }

Your function is now live at http://localhost:3111/add.

<details> <summary>Python</summary>
bash
pip install iii-sdk
python
from iii import register_worker, Logger

iii = register_worker("ws://localhost:49134")
logger = Logger()

def add(data):
    return {"sum": data["a"] + data["b"]}

iii.register_function({"id": "math.add"}, add)

iii.register_trigger({
    "type": "http",
    "function_id": "math.add",
    "config": {"api_path": "add", "http_method": "POST"}
})

result = iii.trigger({"function_id": "math.add", "payload": {"a": 1, "b": 2}})
logger.info("result", result)  # {"sum": 3}
</details> <details> <summary>Rust</summary>
rust
use iii_sdk::{register_worker, InitOptions, TriggerRequest, RegisterFunctionMessage, RegisterTriggerInput, Logger};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let iii = register_worker("ws://127.0.0.1:49134", InitOptions::default())?;
    let logger = Logger::new();

    iii.register_function(RegisterFunctionMessage { id: "math.add".into(), description: None, request_format: None, response_format: None, metadata: None, invocation: None }, |input| async move {
        let a = input.get("a").and_then(|v| v.as_i64()).unwrap_or(0);
        let b = input.get("b").and_then(|v| v.as_i64()).unwrap_or(0);
        Ok(json!({ "sum": a + b }))
    });

    iii.register_trigger(RegisterTriggerInput { trigger_type: "http".into(), function_id: "math.add".into(), config: json!({
        "api_path": "add",
        "http_method": "POST"
    }) })?;

    let result = iii.trigger(TriggerRequest::new("math.add", json!({ "a": 1, "b": 2 }))).await?;
    logger.info("result", &result); // {"sum":3}

    Ok(())
}
</details>

SDKs

LanguagePackageInstall
Node.jsiii-sdknpm install iii-sdk
Pythoniii-sdkpip install iii-sdk
Rustiii-sdkAdd to Cargo.toml

Console

The iii-console is a developer and operations dashboard for inspecting functions, triggers, traces, and real-time state.

bash
iii-cli console

Repository Structure

DirectoryWhat it isREADME
engine/iii Engine (Rust) - core runtime, modules, and protocolengine/README.md
sdk/SDKs for Node.js, Python, and Rustsdk/README.md
console/Developer dashboard (React + Rust)console/README.md
frameworks/Higher-level frameworks built on the SDKframeworks/motia/
website/iii websitewebsite/
docs/Documentation site (Mintlify/MDX)docs/README.md

See STRUCTURE.md for the full monorepo layout, dependency chain, and CI/CD details.

Examples

See the Quickstart guide for step-by-step tutorials.

Docs Development

The iii documentation lives in docs/, which is a Mintlify docs site driven by docs/docs.json.

bash
pnpm dev:docs

This runs npx mint dev inside docs/ and serves the docs locally, typically at http://localhost:3000.

Resources

License

The iii project uses a dual licensing model:

DirectoryLicense
engine/Elastic License 2.0
sdk/Apache License 2.0
cli/Apache License 2.0
console/Apache License 2.0
frameworks/Apache License 2.0
docs/Apache License 2.0
website/Apache License 2.0

The engine runtime is licensed under the Elastic License 2.0 (ELv2). All SDKs, frameworks, CLI, console, documentation, and the website are licensed under the Apache License 2.0.

See NOTICE.md for details.