The Smart Rule Engine is a generative AI-powered rule engine that leverages GPT-4 to provide a chat-based interface for managing rule engines in IoT platforms. Currently, it integrates with Thingsboard, with support for additional platforms to be added in the future.
Clone repo
git clone https://github.com/kamran890/smart-rule-engine.git
cd smart-rule-engine
Install python3.11
https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz
Create virtual env
python3.11 -m venv env
Enable virtual env
source env/bin/activate
Install dependencies
pip install -r requirements.txt
Create .env
file
cp .env.example .env
Update following env
DEBUG=DEBUG
ENVIRONMENT=DEV
AI_API_KEY=AI_API_KEY
REDIS_ENDPOINT=localhost
DB_ENDPOINT=localhost
DB_NAME=DB_NAME
DB_USER=DB_USER
DB_PASSWORD=DB_PASSWORD
SECRET_KEY=SECRET_KEY
REACT_APP_API_ENDPOINT=http://localhost:8000
REACT_APP_ENDPOINT=http://localhost:3000
Run following containers
docker-compose up -d db redis
Run backend
./scripts/run_backend.sh
Apply migration
./scripts/run_migrations.sh
Create core tenant
./scripts/create_core_tenant.sh
Create core admin user
./scripts/create_core_admin_user.sh
Run other services in seprate terminals
./scripts/run_task_manager.sh
./scripts/run_data_subscriber.sh
Run frontend
docker-compose up frontend
Run unit tests
./scripts/run_test.sh
Backend: http://localhost:8000
API Docs: http://localhost:8000/docs
Frontend: http://localhost:3000
As an open-source project, contributions are most welcome:
Your contributions, no matter how small, are valued and help make Smart Rule Engine better for everyone
This project is licensed under the terms of the MIT license.