System as Code Experience
The System as Code Experience in Coreflux provides a revolutionary approach to IoT orchestration by combining documentation and implementation in a single, executable document using LOT Notebooks.
What is System as Code?
System as Code is a paradigm that allows you to create complete, self-documenting IoT systems using LOT Notebooks (.lotnb
files). These notebooks combine:
- Documentation: Markdown cells explain your system architecture and logic
- Code: Executable LOT code cells define models, rules, actions, and routes
- Visualization: Real-time data charts and diagrams
-
Documentation and Code in One
Combines markdown documentation with executable LOT code, creating self-documenting IoT systems.
-
End-to-End Solutions
Define complete IoT orchestrations with models, rules, actions, and routes all in one place.
-
Shareable and Reusable
Create templates for common use cases that can be shared across teams and organizations.
Key Features
- Interactive Development: Write, execute, and see results in real-time
- Documentation First: Explain your system before implementing it
- Automatic Deployment: Execute cells to deploy components to your broker
- Visualization: Built-in charting for time-series data
- Seamless Integration: Direct connection to your Coreflux MQTT broker
- Version Control: Notebook files can be stored in Git repositories
When to Choose System as Code
The System as Code Experience is ideal for:
- System Architects: Designing complete IoT solutions
- Solution Developers: Building end-to-end IoT applications
- Documentation Teams: Creating comprehensive guides with working examples
- Collaborative Teams: Sharing knowledge and implementation in one document
Use Cases
Coreflux LOT Notebooks excel at creating complete, deployable IoT solutions for specific business needs:
Asset Management Notification Center
Create a notebook that: - Defines models to transform asset data - Sets up rules for access control - Creates actions to trigger alerts based on asset conditions - Implements email routes for notifications - Provides complete documentation of the notification system
Manufacturing Process Data Pipeline
Develop a notebook that: - Models sensor data from manufacturing equipment - Creates rules to secure sensitive production data - Defines actions to respond to production anomalies - Sets up routes to connect multiple factories - Documents the entire pipeline from sensors to analytics
Getting Started
To begin using the System as Code Experience:
- Install Coreflux MQTT Broker:
- Follow the MQTT Broker installation guide to set up your Coreflux MQTT Broker
-
Ensure your broker is running and accessible
-
Explore Ready-to-Use Notebook Examples:
- Temperature Monitoring System: A complete example of monitoring and alerting based on temperature readings
- Browse additional LOT Notebook Samples to find examples relevant to your use case
-
Download examples to use as templates for your own projects
-
Set Up Your Environment to Run the Examples:
- Install Visual Studio Code: Download and install VS Code
-
Install LOT Notebooks Extension:
- Open VS Code Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
- Search for and install the LOT Notebooks extension
-
Connect to Your Coreflux Broker:
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Type "LOT Notebook: Change Credentials" and select it
- Enter your broker details:
- URL (e.g., mqtt://localhost:1883)
- Username (default is "root")
- Password
-
The extension will test the connection and notify you if it's successful
-
Open and Run the Example Notebooks:
- Open the downloaded notebook files (.lotnb) in VS Code
- Execute the code cells to deploy the components to your Coreflux broker
-
Observe the system in action using an MQTT client like MQTT Explorer
-
Create Your Own Notebook:
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Type "LOT Notebook: Create New Notebook" and select it
- Add markdown cells to document your system
- Add code cells with LOT definitions (models, rules, actions)
- Execute cells to deploy your system components to your Coreflux broker
Next Steps
- LOT Language Documentation: Learn the Language of Things
- LOT Notebooks Overview: Complete documentation for the VS Code extension
- LOT Notebook Samples: More example notebooks for common use cases