Web GenAI Microservices Creation: An Overview

  1. This article will show you how to use GenAI from your browser to create and run a microservice in about a minute. Here is what you'll learn: 
  2. Provide a prompt to a cloud-based microservice appliance, and you get a system with a running database, a web app, and an API.
  3. Collaborate with stakeholders using the web app.
  4. Iterate instantly, to get the requirements right.
  5. Download the created project, and customize it in your IDE to build out the system using Python and Rules — 40x more concise than code.  

All of this is open source.  No runtime or license fees.

Microservices Creation: Get the Requirements Right

We've all seen many projects fail due to difficulties in getting the requirements right. Let's explore that.

Catch 22: Screens Best for Collaboration, But Available Too Late

A common — and frustrating — project experience is:

So, how do we get the screens — in moments — to collaborate and iterate, to get the requirements right?

Introducing Web GenAI Automation Services

GenAI technology has enabled an exciting new class of software to address this. Products are accessed via your browser and are able to create complete running systems from a natural language prompt. Let's look at one example: Web/GenAI.

Web/GenAI: Get Working Screens Instantly from a Prompt

Web/GenAI creates complete running systems from a prompt.  It works like this:

  1. Create by providing a prompt, right in your Browser. The system creates the microservice in a minute or so.
  2. Runthe microservice.
    1. A database, a web app, and an API
      • No database definition needed, no framework complexity, not even any screen painting
    2. It's live on the web - stakeholders can collaborate and review the app and API
      • Contrast this to wireframes, which provide little insight into the actual data and its behavior
    3. Iterate in just a minute. Rename tables, add new tables, change attributes, all while retaining what you have.
    4. It's not just a wizard - you have a standard project you can download and customize in your IDE, using Python and Rules (described below).

To see it in action, play the video above. Or, run it yourself (link at end).

All that's needed is one minute to create running screens -
collaborate and iterate
to get the requirements right.

Enterprise Class API

The standard JSON:API is enterprise class - multi-table, filtering sorting, pagination, and optimistic locking. Explore it with automatically created Swagger.

Development of a Standard, Fully Customizable Project

Web GenAI may be fast and simple, but it's far more than a wizard. You also get a fully executable project you can download, and customize in your IDE using Python and Rules.  

Automation can also reduce architectural risk. For example, using a manual framework does not ensure aspects such as APIs that provide pagination, optimistic locking, and logic sharing (further discussed below). An automated approach can/should provide these.

The basic process is shown in the thumbnail diagram below:

  1. Inception phase: use Web GenAI to get the requirements right, as described above
  2. Backend development in your IDE, using Python and Rules, further described below

Screenshot of the inception and development phase of Web/GenAI


Architecture

Speed is great, but architecture matters. Let's take a quick look under the hood of how projects are created, developed, and ran.

1. Creation: ChatGPT, API Logic Server

When you provide your prompt, the system:

  1. Invokes ChatGPT to compute a data model
  2. Invokes API Logic Server to create and run an executable Python project from a data model, or an existing database (see references, at end).

Not a FrankenPrompt or low level technical instructions
that require deep framework understanding.

Web GenAI prompts are simple business-level requirements.

2. Development: Your IDE, Code-Based, Models

You can download the created project and customize it in your IDE. And/or, use CodeSpaces, a browser-based version of the popular VSCode IDE.

Your project is completely represented as code. There is a not a formal repository stored as a database or markup files. That means you can use your IDE to debug and manage your project. For example, see below how logic is entered in Python, as a DSL.

The resultant project is not a massive amount of code that is hard to understand and customize. Rather, it is a set of models that are clear and concise.  For example, 

Models, represented as code,
are easier to manage, debug, understand, and modify.

3. Runtime: Standard 3-Tiered, API-Driven, Container-Based

Clients access the system via the JSON:API, described above. More than access, the API enforces the semantics of your data - the business logic that governs security, and integrity (multi-table derivations and constraints) with automatic transaction bracketing.

The server executes as a container, accessing the database(s) as required. Containers are share-nothing, providing scalability.


A diagram of a created API logic project, illustrating the flows of API clients and ultimate output into the database.


Backend Development: Your IDE, Python, and Rules

Let's now see how you add logic in your IDE, using Python and Rules.

Python

The Python code below illustrates how you can add business logic to format and send Kafka messages for internal application integration. Use your IDE to enter the code, debug it, and manage your source control. Leverage external packages as required - it's a standard Python project.

A screenshot of Python code to demonstrate how to add business logic to format and send Kafka messages.


This combines the speed and simplicity of AI, with the flexibility of a framework.  

Rules Enforce Security and Integrity

A rules engine is provided to automate backend business logic. This is a substantial part of any project - typically nearly half.

Rules address:

  1. Row-level security based on user roles (e.g., use Keycloak for Single Sign-on), and 
  2. Multi-table Derivations and Constraints (with automatic transaction bracketing)

The following rules govern entering and altering orders to enforce the Credit Limit check:

A screenshot demonstrating the setup of Rules.


These 5 rules represent the same logic as 200 lines of code.

Maintenance Automation

While conciseness is perhaps the most salient point, rules provide substantial value in maintenance.  Maintenance often seems to be a matter of archaeology - you spend most of your time reading existing code to figure out where to insert your new code, so that it always called, and in the correct order. 

Rules automate that.

The rules engine plugs into SQLAlchemy events, and monitors updates at the attribute level. Rules that don't apply are pruned. Rules that do apply are executed in an order that respects their system-discovered dependencies. This results in:

Unlike Rete engines and some ORMs, rules are highly optimized to eliminate expensive (and often chained) aggregate queries. In the example above, a new Order makes 1 update to Customer, without reading all the existing Orders and OrderDetails to compute the new Balance.

While the GenAI Automation is exciting, you just might conclude it's "come for creation, stay for the rules."

Front End Development

We do not contend that the automatically created app is a customer-facing app.  

This approach is to leverage your existing UI dev tools such as UI frameworks or low code screen painters, by automating the API. In addition to existing UI Dev tools, please explore automation support for Ontimize.

That said, it's worth noting the value that a robust backend can provide to front-end dev:

Open Deployment

Created projects include scripts to automate docker creation, so you can deploy on your own infrastructure. To try out your own Web GenAI prompt creation, click here.

In summary, if you provide a natural language prompt, and you'll get:

You can begin collaborating with business users, and extending the project in your IDE.

 

 

 

 

Top