Getting Started

Prerequisites, installation, and deploying the full UNS stack.

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

Quick Start (5 minutes)

Get the full stack running immediately:

# 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 DeploymentDeploy all 9 components including KPI functions
ComponentsDeep dive into each function