
I Built a Lightweight Rule Engine for JS, C#, and Dart — Here's How It Works
The Problem 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. Most rule engines I found were either too heavy for what I needed or locked into a single language. So I built my own. What is ARE? ARE (Action Rule Event) is a lightweight, dependency-free rule engine. The concept is straightforward: Events — Things that happen (user logs in, temperature changes, order placed) Rules — Conditions to evaluate (if temperature > 30, if order total > 100) Actions — What to execute when conditions are met (send notification, apply discount) The pipeline: Event → Middleware → Condition Evaluation → Rule Matching → Action Execution Multi-Platform I wanted this to work wherever I work, so ARE is available on three platforms: JavaScript/TypeScript → npm C# / .NET → NuGet Da
Continue reading on Dev.to Webdev
Opens in a new tab


