<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Berat ARPA</title>
    <description>The latest articles on DEV Community by Berat ARPA (@beratarpa).</description>
    <link>https://dev.to/beratarpa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3783268%2Fb9bdc256-5c2f-4c02-a773-73d97a96557f.jpeg</url>
      <title>DEV Community: Berat ARPA</title>
      <link>https://dev.to/beratarpa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/beratarpa"/>
    <language>en</language>
    <item>
      <title>I Built a Lightweight Rule Engine for JS, C#, and Dart — Here's How It Works</title>
      <dc:creator>Berat ARPA</dc:creator>
      <pubDate>Sat, 21 Feb 2026 00:04:44 +0000</pubDate>
      <link>https://dev.to/beratarpa/i-built-a-lightweight-rule-engine-for-js-c-and-dart-heres-how-it-works-4a22</link>
      <guid>https://dev.to/beratarpa/i-built-a-lightweight-rule-engine-for-js-c-and-dart-heres-how-it-works-4a22</guid>
      <description>&lt;p&gt;The Problem&lt;br&gt;
I kept running into the same pattern across different projects: events happen, some conditions need to be checked, and based on those conditions, certain actions should execute. Authentication flows, game mechanics, IoT automation, e-commerce logic — they all follow this pattern.&lt;/p&gt;

&lt;p&gt;Most rule engines I found were either too heavy for what I needed or locked into a single language. So I built my own.&lt;/p&gt;

&lt;p&gt;What is ARE?&lt;br&gt;
ARE (Action Rule Event) is a lightweight, dependency-free rule engine. The concept is straightforward:&lt;/p&gt;

&lt;p&gt;Events — Things that happen (user logs in, temperature changes, order placed)&lt;br&gt;
Rules — Conditions to evaluate (if temperature &amp;gt; 30, if order total &amp;gt; 100)&lt;br&gt;
Actions — What to execute when conditions are met (send notification, apply discount)&lt;br&gt;
The pipeline: Event → Middleware → Condition Evaluation → Rule Matching → Action Execution&lt;/p&gt;

&lt;p&gt;Multi-Platform&lt;br&gt;
I wanted this to work wherever I work, so ARE is available on three platforms:&lt;/p&gt;

&lt;p&gt;JavaScript/TypeScript → npm&lt;br&gt;
C# / .NET → NuGet&lt;br&gt;
Dart / Flutter → pub.dev&lt;br&gt;
Same API design across all three. If you know one, you know them all.&lt;/p&gt;

&lt;p&gt;The Playground&lt;br&gt;
Documentation is fine, but I wanted people to actually feel how the engine works. So I built an interactive playground with three real-world scenarios:&lt;/p&gt;

&lt;p&gt;🎮 RPG Game — Combat rules, loot drops, zone effects, boss battles&lt;br&gt;
🏠 Smart Home — Sensor events, schedules, energy management, security&lt;br&gt;
🛒 E-Commerce — Order processing, inventory alerts, customer rewards&lt;/p&gt;

&lt;p&gt;Each scenario comes with pre-configured events, rules, and actions. You fire an event and watch the engine process it in real time.&lt;/p&gt;

&lt;p&gt;Features I'm proud of:&lt;br&gt;
Rule Flow Diagram — An animated pipeline showing each stage of processing&lt;/p&gt;

&lt;p&gt;Rule Debugger — Expand any rule to see a condition-by-condition breakdown: what field was checked, what operator was used, what was expected vs. actual, and whether it passed or failed&lt;/p&gt;

&lt;p&gt;Relationship Graph — A visual map showing how events connect to rules and rules connect to actions. Hover over any node and see its connections highlighted&lt;/p&gt;

&lt;p&gt;Interactive Tutorial — A guided tour for first-time visitors that walks through every panel&lt;/p&gt;

&lt;p&gt;Full CRUD — Add, edit, or delete events, rules, and actions on the fly. Create your own scenarios without writing code&lt;/p&gt;

&lt;p&gt;Code Sandbox — Write your own ARE logic from scratch with a Monaco editor&lt;/p&gt;

&lt;p&gt;🔗 Try it: are-playground.netlify.app&lt;/p&gt;

&lt;p&gt;Tech Stack&lt;br&gt;
React 19 + TypeScript&lt;br&gt;
Vite&lt;br&gt;
Tailwind CSS v4&lt;br&gt;
Zustand for state management&lt;br&gt;
Framer Motion for animations&lt;br&gt;
i18next (English + Turkish)&lt;br&gt;
What's Next&lt;br&gt;
I'm looking for feedback. If you try the playground, I'd love to know:&lt;/p&gt;

&lt;p&gt;Is the event → rule → action concept clear?&lt;br&gt;
What use cases would you apply this to?&lt;br&gt;
What's missing that would make this useful for your projects?&lt;br&gt;
GitHub: github.com/BeratARPA/ARE&lt;/p&gt;

&lt;p&gt;Thanks for reading. Happy to answer any questions.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>csharp</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
