A project time-tracking system should allow entry of:
GenAI Logic is a web page, like many chatbots, that allows the user to enter a prompt. The more details provided, the better the result (although you can iterate to add or change the outcome using the "Iterate" button).
You want to describe the model and attribute, the logic, and the use cases as fully as possible. Then, simply click "Create Projects" and wait about 90 seconds.
One note: Under "Advance Settings," change the data model size to 8 (the number of tables to create). This prevents GenAI from adding more tables that are needed.
The invoice has an flag that, when set to , sends the invoice row to Kafka. This allows a Kafka consumer to initiate the workflow integration in a separate container. Other workflows and integrations can be easily added to the use cases.
When completed, GenAI Logic creates an SQL Database (SQLite), a SQLAlchemy ORM model, an API (JSON API), a react-admin client, complete business logic (25+ rules), and sample data for testing. This would easily be over 1,000 lines of code to handle all the use cases of adding, updating, deleting, and reparenting entries. The entire project can be downloaded from GitHub or a zip file for the developer to review.
Just for fun, the system also created a single-page application landing page to demonstrate your project prompt.
The "Backend Admin" button leads to the working page that includes the logic, the model, a sample react-admin application (for testing the rules), and tools for the developer. This was the model created from the prompt.
The API entities are now ready to test on the left (a react application) to see test data. Enter a Client, Project, Task, and Timesheet for a Person and watch the sums, counts, and constraint rules change value.
You can also run the generated application locally using Docker or click on the GitHub link to see the code and run the application using GitHub CodeSpaces.
Finally, explore the API endpoints using OpenAPI (Swagger). If the "> Logic Rules" have any issues, they can be individually reviewed, edited, rejected, or accepted. GenAI can even suggest logic based on your model (see the "Logic" button).
Business logic is not a black box. As API endpoints are accessed (POST, PATCH, and DELETE), the rules fire on state changes of dependent entities and attributes. A complete log of rules that fired and the order they fired, along with the row values impacted, gives a full, transparent view of the processing. This is not a black box but a true companion to businesses that require auditable and transparent logic transactions.
Note that the shows the state change of each row impacted in order, and the shows the final collection of rules that fired (this is a lot of detail, but it is important if you need to pass an audit).
Also, note that the order starts with the timesheet change and cascades up to the parent Client. Rules are unordered in the declaration (see logic folder) and can easily be added/modified without impacting other rules.
The entire generative approach is built on top of the open-source ApiLogicServer (ALS). Once the project is downloaded, it can be edited using VSCode (or your favorite IDE). The platform is built on Python 3.12, SQLAlchemy ORM, and Flask.
The super-power is the declarative rules engine LogicBank.
The project is organized into folders: API, config, logic, database, integration, security, DevOps, and test. Each folder is thoroughly documented and provides the developer with the ability to add/modify features and services (e.g., custom API endpoints, integrations, behave test cases, or declarative role-based access control) in an IDE. (Bring your own favorite AI tool 0. -- CoPilot, Sourcery, Cursor, etc.)
Here are the steps taken to edit/modify the local project. While it is possible to use SQLIte in production (8 billion smartphones can't be wrong), I chose the PostgreSQL route.
Note: You may need to change the linux/amd64 to linux/arm64 for your deployed environment.
One quick word about testing logic. Using the Behave scenario feature shown below, we quickly added the implementation to insert various API entities and test the derivations, aggregations, and events with full log traceability.
ApiLogicServer can also generate an Angular front-end using OntimizeWeb from Imatia. Each API endpoint is used to create pages that can be modified using standard tools or regenerated by modifying the templates (jinja style) used to build page styles (tables, grids, master/detail, treeview, etc.).
Once the Angular front-end has been approved by the UX team, it is ready to be dockerized and pushed.
Add the new front-end to the docker-compose.yml file and restart. The new Ontimize application should be running on port 80. Use Keycloak to log in (or add SQL authentication and use a name/password). Once logged in, create a client, a project, task, or person and enter a timesheet (below). Then, see the logs to watch how rules fire.
The prompt to production process required approximately 2 hours to complete. Although "Prompt to Production" is the headline, human involvement was still necessary for tasks such as security configuration (authentication and authorization), docker compose file configuration, and UX/UI fine-tuning.
Furthermore, Kafka and Workflow integrations and configurations required the expertise of a separate team member. The UX team may want to enhance the look and feel, but this is 100% functional and tested.