> ## 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.

# Best Practices & Patterns

> Overview and table of contents for best practices—topic design, reusable logic, alarms, integrations, production architecture, and notebooks.

## After Hello World, What's Next?

Once you've followed [Getting Started](/v2.0/quick-start/getting-started) and have Coreflux, VS Code, and your first Action running, the question becomes *how to grow*: naming topics, handling JSON, scaling Actions, wiring integrations, and shipping systems that stay maintainable. Experienced teams reuse the same patterns across factories, buildings, energy sites, and fleets—only the topics and payloads change.

<Tip>
  **Like learning chords before writing songs.** Your first Action proves the broker runs your logic; patterns teach you how dozens of Actions, Models, and Routes fit together without turning into spaghetti.
</Tip>

## How Are Best Practices & Patterns Organized

Chapters below live under **Best Practices and Usage Patterns** in the sidebar. Pick one based on what you're building — each page focus on a set of tips for a given topic. Start with **Naming conventions** and finish with **Anti-patterns** when reviewing code.

<CardGroup cols={2}>
  <Card title="Naming conventions" icon="tag" href="/v2.0/lot-language/usage-patterns/naming-conventions">
    PascalCase entities, snake\_case variables, and topic naming basics.
  </Card>

  <Card title="Designing your data layer (the foundation)" icon="sitemap" href="/v2.0/lot-language/usage-patterns/data-layer">
    Topic trees (UNS), scalar vs JSON payloads, Models, and inheritance — how data is shaped and addressed.
  </Card>

  <Card title="Working with JSON" icon="brackets-curly" href="/v2.0/lot-language/usage-patterns/working-with-json">
    GET JSON in Actions, nested payloads, and publishing structured output through Models.
  </Card>

  <Card title="Writing reusable logic (the building blocks)" icon="code" href="/v2.0/lot-language/usage-patterns/reusable-logic">
    Callable actions, wildcards, counting over time, and Python — techniques for the Action you are writing now; logic that scales and stays maintainable.
  </Card>

  <Card title="Alarms and monitoring" icon="bell" href="/v2.0/lot-language/usage-patterns/alarms-and-monitoring">
    Threshold crossings and device or route offline detection; optional email routes alongside alarms.
  </Card>

  <Card title="Connecting to the outside world (integrations)" icon="globe" href="/v2.0/lot-language/usage-patterns/integrations">
    REST server and client, live KPIs from a database, and ENV / Secrets — Routes that bridge to non-MQTT systems.
  </Card>

  <Card title="Production architecture" icon="industry" href="/v2.0/lot-language/usage-patterns/production-architecture">
    End-to-end device-to-database ingestion and edge–cloud bridges — synthesis patterns that build on everything before.
  </Card>

  <Card title="Project organization" icon="book" href="/v2.0/lot-language/usage-patterns/project-organization">
    Keeping notebooks clean and readable — single-file vs multi-file layouts and shared discipline at every stage.
  </Card>

  <Card title="Anti-patterns" icon="triangle-exclamation" href="/v2.0/lot-language/usage-patterns/anti-patterns">
    Common LoT mistakes and what to do instead.
  </Card>
</CardGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Introduction to LoT" icon="book" href="/v2.0/lot-language/introduction">
    Building blocks and how Actions, Models, Routes, and Rules fit together.
  </Card>

  <Card title="Model Inheritance" icon="diagram-project" href="/v2.0/lot-language/models/model-inheritance">
    Deep dive on `FROM` and base models.
  </Card>
</CardGroup>

New to the language? **[Introduction to LoT](/v2.0/lot-language/introduction)** links Actions, Models, Routes, and Rules from one page.
