> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Tutorials

> Hands-on LoT Notebook tutorials covering Actions, Models, Routes, and Python integration.

## Learn by Building

The best way to master LoT is through hands-on practice. These tutorials are interactive notebooks you can download and run in VS Code—each one builds your skills progressively.

<Tip>
  **Start with Basics, then branch out.** Complete the Basics tutorials first to understand LoT fundamentals, then explore the topics most relevant to your projects.
</Tip>

***

## Learning Path

Follow this recommended progression from beginner to advanced:

```mermaid theme={null}
flowchart LR
    subgraph Beginner
        A[Timed Actions] --> B[Topic Actions]
    end
    subgraph Intermediate
        B --> C[Conditional Logic]
        C --> D[Basic Models]
        D --> E[Action Models]
        E --> F[Model Inheritance]
    end
    subgraph Advanced
        F --> G[Routes]
        G --> H[Python]
        H --> I[Architecture]
    end
```

***

## Basics

Start here to learn the fundamentals of LoT Actions and event-driven programming.

<CardGroup cols={2}>
  <Card title="Timed Actions" icon="clock" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/01-basics/timed-actions.lotnb">
    Create actions that run on schedules—heartbeats, counters, and periodic tasks. Learn `ON EVERY` triggers and state persistence.
  </Card>

  <Card title="Topic Actions" icon="message" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/01-basics/topic-actions.lotnb">
    React to MQTT messages in real-time. Master `ON TOPIC` triggers, wildcards, and payload processing.
  </Card>
</CardGroup>

### What You'll Learn

| Tutorial          | Key Concepts                                                         |
| ----------------- | -------------------------------------------------------------------- |
| **Timed Actions** | `ON EVERY` syntax, time units, `PUBLISH TOPIC`, timestamps, counters |
| **Topic Actions** | `ON TOPIC` triggers, wildcards (`+`, `#`), `PAYLOAD`, topic parsing  |

***

## Logic

Build intelligent automation with conditional logic and decision-making.

<CardGroup cols={1}>
  <Card title="Conditional Logic" icon="code-branch" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/02-logic/conditional-logic.lotnb">
    Implement IF/ELSE statements, comparisons, and boolean logic. Build threshold monitors, state machines, and quality control systems.
  </Card>
</CardGroup>

### What You'll Learn

| Tutorial              | Key Concepts                                                                            |
| --------------------- | --------------------------------------------------------------------------------------- |
| **Conditional Logic** | `IF/ELSE` statements, comparison operators, `AND/OR/NOT`, text matching with `CONTAINS` |

***

## Models

Structure and transform your data with LoT Models.

<CardGroup cols={2}>
  <Card title="Basic Models" icon="cube" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/03-models/basic-models.lotnb">
    Define data schemas with typed fields. Create structured sensor readings, equipment status reports, and alarm messages.
  </Card>

  <Card title="Action Models" icon="bolt" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/03-models/action-models.lotnb">
    Publish models dynamically from Actions. Combine event-driven logic with structured data output.
  </Card>

  <Card title="Model Inheritance" icon="sitemap" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/03-models/model-inheritance.lotnb">
    Extend base models to create specialized variants. Build hierarchies for sensors, equipment, and production data.
  </Card>
</CardGroup>

### What You'll Learn

| Tutorial              | Key Concepts                                                                     |
| --------------------- | -------------------------------------------------------------------------------- |
| **Basic Models**      | `DEFINE MODEL`, field types (STRING, INT, DOUBLE, BOOL), triggers, topic sources |
| **Action Models**     | `PUBLISH MODEL`, dynamic field values, combining Actions with Models             |
| **Model Inheritance** | `EXTENDS`, base models, field overrides, model hierarchies                       |

***

## Routes

Connect your LoT system to external databases and other MQTT brokers.

<CardGroup cols={2}>
  <Card title="MQTT Bridge" icon="bridge" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/04-routes/mqtt-bridge.lotnb">
    Connect multiple MQTT brokers. Forward messages, sync data between systems, and build distributed architectures.
  </Card>

  <Card title="Database Routes" icon="database" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/04-routes/database-routes.lotnb">
    Store MQTT data in SQL databases. Configure connections, map topics to tables, and query historical data.
  </Card>
</CardGroup>

### What You'll Learn

| Tutorial            | Key Concepts                                                                |
| ------------------- | --------------------------------------------------------------------------- |
| **MQTT Bridge**     | `TYPE MQTT_BRIDGE`, source/destination config, mappings, bidirectional sync |
| **Database Routes** | `TYPE DATABASE`, connection strings, table mappings, data persistence       |

***

## Python Integration

Extend LoT with Python for complex calculations, data processing, and advanced logic.

<CardGroup cols={2}>
  <Card title="Simple Python" icon="python" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/05-python/simple-python.lotnb">
    Get started with Python in LoT. Learn the script format, parameter passing, and return value handling.
  </Card>

  <Card title="Advanced Python" icon="wand-magic-sparkles" href="https://github.com/CorefluxCommunity/Language-Of-Things-Training/blob/main/05-python/advanced-python.lotnb">
    Build sophisticated data pipelines. Use external libraries, handle JSON, and implement validation logic.
  </Card>
</CardGroup>

### What You'll Learn

| Tutorial            | Key Concepts                                                                 |
| ------------------- | ---------------------------------------------------------------------------- |
| **Simple Python**   | `CALL PYTHON` syntax, script format, parameters, return values               |
| **Advanced Python** | JSON processing, external libraries, error handling, complex transformations |

***

## Advanced Topics

Master architectural patterns and optimization techniques for production systems.

<CardGroup cols={1}>
  <Card title="Mapping vs Events" icon="diagram-project" href="https://github.com/CorefluxCommunity/LOT-Tutorials/blob/main/06-advanced/mapping-vs-events.lotnb">
    Understand route architecture patterns. Choose between mappings and events for optimal performance. Design scalable integration systems.
  </Card>
</CardGroup>

### What You'll Learn

| Tutorial              | Key Concepts                                                                |
| --------------------- | --------------------------------------------------------------------------- |
| **Mapping vs Events** | Performance trade-offs, fan-out patterns, aggregation, hybrid architectures |

***

## Quick Reference

Need to review a specific concept? Here's where to find it:

| Concept             | Tutorial                               |
| ------------------- | -------------------------------------- |
| Time-based triggers | [Timed Actions](#basics)               |
| Message triggers    | [Topic Actions](#basics)               |
| IF/ELSE logic       | [Conditional Logic](#logic)            |
| Data schemas        | [Basic Models](#models)                |
| Dynamic publishing  | [Action Models](#models)               |
| Schema inheritance  | [Model Inheritance](#models)           |
| Broker bridging     | [MQTT Bridge](#routes)                 |
| Data storage        | [Database Routes](#routes)             |
| Python scripting    | [Simple Python](#python-integration)   |
| Advanced processing | [Advanced Python](#python-integration) |
| Route optimization  | [Mapping vs Events](#advanced-topics)  |

***

## Download Tutorials

All tutorials are available in the Coreflux Community GitHub repository:

<Card title="LoT Tutorials Repository" icon="github" href="https://github.com/CorefluxCommunity/LOT-Tutorials">
  Download complete tutorial notebooks with documentation, examples, and exercises.
</Card>

### Getting the Tutorials

<Steps>
  <Step title="Clone or Download">
    Clone the repository or download as ZIP from GitHub.
  </Step>

  <Step title="Open in VS Code">
    Open any `.lotnb` file—VS Code automatically uses the LoT Notebooks extension.
  </Step>

  <Step title="Connect Your Broker">
    Configure your broker credentials, then start running cells.
  </Step>
</Steps>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Usage Guide" icon="gears" href="/lot-notebooks/usage">
    Master cell execution, broker commands, and troubleshooting.
  </Card>

  <Card title="LoT Language Reference" icon="book" href="/lot-language/introduction">
    Explore the complete LoT syntax reference and advanced features.
  </Card>
</CardGroup>
