/phpSlimRulesGUI

A simple PHP GUI and REST API build on top of the SLIM PHP framework, Composer, and HOA Project Rules lib.

Primary LanguageJavaScriptGNU General Public License v2.0GPL-2.0

phpSlimRulesGUI

A simple PHP GUI and REST API build on top of the SLIM PHP framework, Composer, and HOA Project Rules lib.

This is not a release. There are going to be changes.

MASSIVE kudos to HOA Rules and Slim. This is just another step down the road for your users.

Load the dependancies, then run composer.phar update. Finally, curl the install step.

Screen Shots

Start the web service on port 3000.
Starting the API
Start the web server on port 4000. In production, you would likely use Apache or reverse proxy.
Starting the web server in development
Top level page.
First page controls
Rulesets.
Rulesets
It is a good idea to create a ruleset for your rules, but it isn't required.
Creating a new ruleset - not required but recommended The menu bar.
Menu bar
Create a new rule. Only the rule is required but all fields are recommended. Active should be 1 or 0, 1 represents true.
Create a rule, Active = 1 for true
Test cases are managed under Tests.
Click tests to manage test cases
Click the test button next to a rule to test it.
Click the test button next to a rule to test it
Test result.
test result
You can also test an entire resultset. Currently they run in order.
you can also test an entire resultset. Currently they run in order

Dependancies

PHP5
sqlite3
Composer
Slim

RUN

http-app$ php -S localhost:4000  
rulespec$ php -S localhost:3000  
# (port doesn't matter but front-end expects 3000 for curl ATM)  

REST Examples

Create the SQLite DB (REQUIRED FIRST STEP)

curl -X GET http://127.0.0.1:3000/install

List

curl -X GET http://127.0.0.1:3000/rule  
curl -X GET http://127.0.0.1:3000/ruleset

Update

curl -X PUT -d "ruleset=1" -d "rule_active=0" -d "rule_comment=ignore this one" -d "rule=something = 1 and another < 10 or unfinished idea" http://127.0.0.1:3000/rule/3

Insert

curl -X POST -d "ruleset=1" -d "rule_active=0" -d "rule_comment=ignore this one" -d "rule=something = 1 and another < 10 or unfinished idea" http://127.0.0.1:3000/rule

Delete record

curl -X DELETE http://127.0.0.1:3000/rule/3

Roadmap

interface enhancements
ruleset flow control
salience
prioritization entropy
execute route, figure out the JSON parameter structure if any
reflection
ability to choose test object
ability to init class
Live data example

Please send feedback! Let me know how you use it.