Getting Started
Prerequisites, installation, and deploying the full UNS stack.
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
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:
| 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 | Deploy all 9 components including KPI functions |
| Components | Deep dive into each function |