IMPLEMENTATION DOCS / UNS FRAMEWORK

Try simulated machine data

Run the sample capture pipeline: simulated machines publish signals, a topic monitor caches them, and an API returns their latest values.

On this page 5 sections
PrerequisitesInstall fnkitRun the sample pipelineWhat's RunningNext Steps
This walkthrough is for the engineer trying fn-uns locally. The result is machine data in JSON. For history, dashboards, and metrics, continue to the core deployment guide after verifying the sample.

Prerequisites

RequirementPurposeInstall
DockerRuns all function containersdocker.com
fnkitScaffolds and deploys functionsfnkit docs
GitVersion control and GitOps deploymentgit-scm.com
MQTT brokerMessage transport for UNS dataMosquitto or any MQTT broker
curlTesting API endpointsPre-installed on macOS/Linux
jq (optional)Pretty-print JSON responsesbrew install jq

Install fnkit

# macOS / Linux
curl -sSL https://get.fnkit.dev | sh

# Verify installation
fnkit version

Run the sample pipeline

Start the simulator, topic monitor, and cache API. Set the broker address in the environment files before starting the containers:

# 1. Clone the project
git clone https://github.com/maxbaines/fn-uns.git
cd fn-uns

# 2. Create the shared network and start infrastructure
docker network create fnkit-network 2>/dev/null || true
fnkit cache start

# 3. Start the MQTT monitor (captures all UNS data)
cd uns-framework
cp .env.example .env
# Edit .env — set MQTT_BROKER to your broker
docker compose up -d
cd ..

# 4. Start the simulator (publishes machine data)
cd uns-sim
cp .env.example .env
# Edit .env — set MQTT_BROKER to your broker
npm install
docker compose up -d
cd ..

# 5. Start the cache reader API
cd uns-cache
cp .env.example .env
docker compose up -d
cd ..

# 6. Verify data is flowing
curl http://localhost:8080/uns-cache | jq

You should see JSON with topic data from 4 simulated CNC machines.

What's Running

After the quick start, you have:

ComponentRole
uns-simPublishing machine data to MQTT every 3s
uns-frameworkCapturing all topics to Valkey cache
uns-cacheHTTP API to read cached data
fnkit-cacheValkey (shared cache)

Next Steps

StepDescription
fnkit BasicsLearn the fnkit CLI commands
First DeploymentAdd the core processing functions and KPI API
ComponentsDeep dive into each function