App Structure
Every IronFlock app is a Git-versioned folder containing your application code and an optional .ironflock configuration directory.
Directory Layout
my-app/
βββ Dockerfile # Required: defines the container image
βββ docker-compose.yml # Optional: multi-container setup
βββ main.py # Your application code (any language)
βββ requirements.txt # Dependencies
βββ .ironflock/
βββ board-template.yml # Dashboard layout
βββ data-template.yml # Database schema for telemetry
βββ env-template.yml # User-configurable parameters
βββ port-template.yml # Remote access port definitions
βββ ai-template.yml # AI agent definitionsThe Six Parts of an App
1. Edge Code
The core application logic. This code runs inside a Docker container on the device and handles communication with sensors, PLCs, cameras, or any connected hardware.
The edge code can be written in any programming language β Python, JavaScript, Go, Rust, C++, or anything else that runs in a Docker container.
2. Board (User Interface)
A real-time dashboard built with the no-code Board Editor. Boards display data from all devices running the app in a project and update automatically through the messaging system.
The board configuration is stored in board-template.yml and is auto-generated by the editor.
3. Data Storage
Each project has its own physical database (powered by TimescaleDB). When an app defines tables in data-template.yml, those tables are provisioned automatically when a user installs the app. Data is private per project β developers donβt have access to user data.
4. Messaging Realm
When installed, the app gets a private message realm connecting:
- All app instances on edge devices
- The project database
- The board UI
Communication uses WAMP (Web Application Messaging Protocol) through the IronFlock SDKs (ironflock-py for Python, ironflock-js for JavaScript).
5. Remote Access
Define ports and protocols in port-template.yml to enable secure tunneling to device services. Users can then enable/disable these tunnels per device. See Remote Access.
6. AI Agents
Expose domain-specific AI agents through ai-template.yml that extend the IronFlock AI assistant. See AI Features.
Persistent Storage on Devices
By default, data inside the container is lost on restart. Two directories persist across restarts:
| Path | Scope |
|---|---|
/data | Private to this app β other apps cannot access it |
/shared | Shared across all apps on the device |
If youβre using Docker Compose, configure persistent volumes in your docker-compose.yml instead.
Hardware Access
If your app interacts with local hardware (sensors, cameras, serial devices), those devices are mounted at /dev inside the container.