How thanhtrixx/rule-engine works
Main Components
a) Core Rule Engine Components:
• Rule Engine Core
• Rule Configuration Service
• Rule Execution Pipeline
• Database Layer
b) External Interfaces:
• REST API Interface (RuleConfigController)
• Configuration Loading System
• Database Integration
┌─ API Layer ─────────────────┐
• RuleConfigController │
• Configuration Endpoints │
• Rule Management API │
• ┘
┌─ Rule Configuration Service ─┐ ┌─ Rule Engine Core ──────┐
• Rule Loading │ │ - Condition Evaluation │
• Configuration Management │◄───►│ - Action Execution │
• Validation │ │ - Rule Set Processing │
• ┘ └────────────────────────┘
┌─ Rule Models ──────┐ ┌─ Conditions ────┐ ┌─ Actions ────────┐
• RuleDefinition │ │ EqualsCondition │ │ EarnPointByRate │
• RuleSetDefinition │ │ OperatorCond. │ │ (Other Actions) │
• ┘ └───────────────┘ └────────────────┘
┌─ Database Layer ────────────┐
• DbRuleConfigService │
• RuleConfigRepositories │
• ┘
Key Relationships to Highlight
• Data flow from API → Service → Engine
• Bidirectional communication between Engine and Models
• Database interactions
• Configuration loading paths
Technical Details
• Kotlin/Spring Boot framework indication
• Database connection (shown in compose.yaml)
• Configuration loading from YAML/JSON
• Test infrastructure integration
The configuration-driven nature of the system
This system design should help developers understand both the static structure and runtime behavior of the Rule Engine, making it easier to maintain and extend the system.