Skip to content

The Rule Engine Application is a React web application designed to allow users to build, manage, and evaluate complex business rules. It provides a visual interface for creating rule conditions and evaluating them against data inputs. This project leverages a backend powered by Node.js, Express, and MongoDB to manage rules and their evaluation.

License

Notifications You must be signed in to change notification settings

Hit4man47/Rule-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rule Engine Application

Table of Contents

Overview

The Rule Engine Application is a React-based web application designed to allow users to build, manage, and evaluate complex business rules. It provides a visual interface for creating rule conditions and evaluating them against data inputs. This project leverages a backend powered by Node.js, Express, and MongoDB to manage rules and their evaluation.

Features

  • Rule Building: Create new business rules with a visual interface.
  • Rule Management: Edit, update, and combine existing rules.
  • Rule Evaluation: Test rules against input data.
  • Docker Support: The application supports containerization using Docker for easy deployment.

File Structure

├── client/
│   ├── components/
│   │   ├── RuleBuilder.jsx        # Component for building rules
│   │   ├── RuleEvaluator.jsx      # Component for evaluating rules
│   │   └── RuleManager.jsx        # Component for managing rules
│   └── RuleEngineApp.jsx          # Main application component
├── server/
│   ├── api.js                     # API client for frontend
│   ├── server.js                  # Server setup and initialization
│   ├── seedAttributes.js          # Seed file for database attributes
│   ├── evaluator.js               # Logic for evaluating rules
│   ├── parser.js                  # Logic for parsing rules
│   └── ruleController.js          # Controller for handling rule-related requests
├── Dockerfile                      # Dockerfile for building the application
└── README.md                       # This README file

Installation

Prerequisites

Steps

  1. Clone the repository:

    git clone https://github.com/your-username/rule-engine-app.git
    cd rule-engine-app
  2. Install dependencies:

    npm install
  3. Setup MongoDB:

    • Ensure MongoDB is running locally on mongodb://localhost:27017/rule-engine.

** If there is a Need to chnage the Attributes Seed the database**:

```bash
node server/seedAttributes.js
```
  1. Start the server:

    npm start
  2. Run the client (if using a separate React frontend):

    cd client
    npm start

Usage

Docker Commands

To build and run the application using Docker:

  1. Pull Docker Image:

    docker pull hit4man47/rule-engine-image:latest
  2. Run the Docker Container:

    docker run -d -p 27017:27017 --name rule-engine-db hit4man47/rule-engine-image:latest
  3. Additional Docker Commands:

    • Pull Weather Mongo Image:

      docker pull hit4man47/weather-mongo-image:latest
    • Run Weather Mongo Container:

      docker run -d -p 27017:27017 --name weather-mongo-db hit4man47/weather-mongo-image:latest
    • Stop Weather Mongo Container:

      docker stop weather-mongo-db
    • Remove Weather Mongo Container:

      docker rm weather-mongo-db

API Endpoints

Rules

  • GET /api/rules - Fetch all rules.
  • POST /api/rules - Create a new rule.
  • PUT /api/rules/:id - Update an existing rule.
  • GET /api/rules/:id/ast - Fetch AST of a rule.

Evaluation

  • POST /api/evaluate - Evaluate a rule against data.

Attributes

  • GET /api/attributes - Fetch available attributes.
  • POST /api/attributes - Create a new attribute.

Technologies Used

  • Frontend: React, TailwindCSS
  • Backend: Node.js, Express, MongoDB
  • API Client: Axios
  • Data Modeling: Mongoose
  • Containerization: Docker

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License.

About

The Rule Engine Application is a React web application designed to allow users to build, manage, and evaluate complex business rules. It provides a visual interface for creating rule conditions and evaluating them against data inputs. This project leverages a backend powered by Node.js, Express, and MongoDB to manage rules and their evaluation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages