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
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
| Requirement | Purpose | Install |
|---|---|---|
| Docker | Runs all function containers | docker.com |
| fnkit | Scaffolds and deploys functions | fnkit docs |
| Git | Version control and GitOps deployment | git-scm.com |
| MQTT broker | Message transport for UNS data | Mosquitto or any MQTT broker |
| curl | Testing API endpoints | Pre-installed on macOS/Linux |
| jq (optional) | Pretty-print JSON responses | brew 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:
| Component | Role |
|---|---|
| uns-sim | Publishing machine data to MQTT every 3s |
| uns-framework | Capturing all topics to Valkey cache |
| uns-cache | HTTP API to read cached data |
| fnkit-cache | Valkey (shared cache) |
Next Steps
| Step | Description |
|---|---|
| fnkit Basics | Learn the fnkit CLI commands |
| First Deployment | Add the core processing functions and KPI API |
| Components | Deep dive into each function |