Skip to main content
This walkthrough builds a complete Uniac System with explanations at each step. For a faster pass without context, see the Quickstart.

1. Scaffold

uniac init
The wizard prompts for a name, kind, language, and entrypoint. Pick app for a deployable System. The result is two files: uniac.json (the manifest) and a starter Python file matching your entrypoint.

2. Write the System

A System is a deployable composition. It subclasses uniac.System and declares any dependencies as class-level annotations of type Node. Initialize them in __init__.
app.py
from uniac import System, load

class Greeter(System):
    def __init__(self, greeting: str = "hello"):
        self.greeting = greeting

service = load(Greeter)
load() reads UNIAC_INIT_* environment variables into __init__ keyword args, constructs the instance, and validates that every annotated Node is set. Wire up an HTTP handler — Uniac runs whatever your entrypoint command starts, so any framework works.
app.py
from fastapi import FastAPI

api = FastAPI()

@api.get("/hello")
def hello(name: str = "world"):
    return {"message": f"{service.greeting}, {name}!"}

3. Run it in the simulator

uniac dev
The simulator builds the container, starts it, and opens the dashboard pointed at your local stack. Send GET /hello?name=there from the dashboard’s request panel.

4. Add a dependency

Suppose you want a reusable logger. Make it a Service (kind=lib) in its own project:
logger/app.py
from uniac import Service

class Logger(Service):
    def info(self, msg: str) -> None:
        print(f"[info] {msg}")
uniac build in logger/ publishes it to your local store. Then in greeter/, list it under dependencies in uniac.json and run uniac install. Declare and use it:
app.py
from uniac import System, Node, load
from logger import Logger  # generated stub

class Greeter(System):
    logger: Logger

    def __init__(self, greeting: str = "hello"):
        self.greeting = greeting
        self.logger = Logger()
In deployed mode, self.logger.url points at the live logger service.

5. Deploy

uniac link      # bind to a remote project
uniac deploy
The CLI prints the deployed URL:
Deployed: https://ab12cd.svc.uniac.ai
The endpoint-id (ab12cd above) is stable across redeploys of the same service.

6. Inspect

Open the dashboard to see deployments, replicas, and instance state.

Where to go next

Concepts

Services, Systems, Nodes, projects, deployments.

The manifest

Every field in uniac.json.

CLI reference

Every command and flag.

SDK reference

Service, System, Node, load, and friends.