{"id":20844244,"url":"https://github.com/vinit-180/rule-engine-with-ast","last_synced_at":"2026-04-12T14:53:16.446Z","repository":{"id":259416733,"uuid":"875400605","full_name":"Vinit-180/Rule-Engine-with-AST","owner":"Vinit-180","description":"3-tier rule engine app using AST for dynamic user eligibility based on age, dept, salary, experience.","archived":false,"fork":false,"pushed_at":"2024-10-24T09:51:00.000Z","size":215,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T11:15:15.639Z","etag":null,"topics":["flask","js","mongodb","nosql","python","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vinit-180.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-19T21:50:04.000Z","updated_at":"2024-10-24T10:26:37.000Z","dependencies_parsed_at":"2024-10-31T00:37:44.523Z","dependency_job_id":null,"html_url":"https://github.com/Vinit-180/Rule-Engine-with-AST","commit_stats":null,"previous_names":["vinit-180/rule-engine-with-ast"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vinit-180/Rule-Engine-with-AST","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinit-180%2FRule-Engine-with-AST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinit-180%2FRule-Engine-with-AST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinit-180%2FRule-Engine-with-AST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinit-180%2FRule-Engine-with-AST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vinit-180","download_url":"https://codeload.github.com/Vinit-180/Rule-Engine-with-AST/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinit-180%2FRule-Engine-with-AST/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28004025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","js","mongodb","nosql","python","react"],"created_at":"2024-11-18T02:08:59.716Z","updated_at":"2025-12-24T15:16:59.354Z","avatar_url":"https://github.com/Vinit-180.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rule Engine Application\n\n\nThis project is a simple 3-tier rule engine designed to dynamically evaluate user eligibility based on attributes like age, department, salary and experience.  The application uses an **Abstract Syntax Tree (AST)** to represent conditional rules, allowing for flexible rule creation, modification, and evaluation.\n\n\n\n# Overview\nThe system is divided into three main components:\n- **Frontend (UI)**: A simple interface built using React where users can define rules and attributes.\n- **API Layer**: A Flask-based backend that handles rule creation, combination, and evaluation using AST (Abstract Syntax Tree).\n- **Backend (Data Storage)**: Utilizes MongoDB to store rules and application metadata efficiently.\n\n\n## Data Structure\n- Define a data structure to represent the AST.\n- The data structure should allow rule changes.\n- For example, one data structure could be a `Node` with the following fields:\n  - `type`: String indicating the node type (\"operator\" for AND/OR, \"operand\" for conditions).\n  - `left`: Reference to another Node (left child).\n  - `right`: Reference to another Node (right child for operators).\n  - `value`: Optional value for operand nodes (e.g., number for comparisons).\n\n\n## Features\n- **Create Rules**: Enter strings in a simple format to convert them into rules.\n- **Evaluate Rules**: Easily evaluate rules by entering them in a simple format.\n- **Combine Rules**: Combine multiple rules using logical operators such as AND and OR.\n- **Get All Rules**: Retrieve all the rules stored in the system.\n- **Modify Rules**: Dynamically manage your rules by adding or editing them as needed.\n\n## Requirements\n- React (for the frontend)\n- Flask (for the backend)\n- MongoDB (for data storage)\n- Docker (for containerization)\n\n\n\n## Installation\n### Frontend Setup\n1. Navigate to the frontend directory:\n   ```bash\n   cd AST/frontend\n   ```\n2. Install the required packages:\n   ```bash\n   npm install\n   ```\n3. Start the frontend application:\n   ```bash\n   npm start\n   ```\n\n### Backend Setup\n1. Navigate to the backend directory:\n   ```bash\n   cd AST/backend\n   ```\n2. Install the required Python packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Ensure MongoDB is running on your local machine.\n\n4. Start the backend application (assuming you have a Flask app):\n   ```bash\n   python app.py\n   ```\n\n### Docker Setup\n1. Build and run the application using Docker Compose:\n   ```bash\n   docker-compose up\n   ```\n   This command will use the Docker images which were built by `Dockerfile` for the frontend and backend to create containers and start the entire system.\n\n\n## Configuration\n- Update the `MONGO_DATABASE_URI` in `config.py` if you are using a different database or you can directly create .env file and set your `URI` there.\n\n## Usage\n1. Access the application in your web browser at `http://localhost:3000` and the Flask API on `http://localhost:5000`..\n2. Use the navigation bar to access different functionalities such as creating rules, evaluating them, and managing existing rules.\n\n## API Endpoints\n- `POST /api/rules/create_rule` - Create a new rule.\n- `POST /api/rules/evaluate_rule` - Evaluate a rule.\n- `POST /api/rules/combine_rules` - Combine multiple rules.\n- `PUT /api/rules/update_rule` - Update an existing rule.\n- `GET /api/rules` - Retrieve all rules.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinit-180%2Frule-engine-with-ast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinit-180%2Frule-engine-with-ast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinit-180%2Frule-engine-with-ast/lists"}