Home  >  Article  >  API appliances are extremely agile and simple

API appliances are extremely agile and simple

百草
百草Original
2024-03-21 16:13:55926browse

Insert this API device into the database just like you would a toaster and add bread, and add rules and Python code. This automation provides superior agility and simplicity with all the flexibility of a framework. Creating a modern API-based web application using traditional frameworks would typically take weeks, but with API Logic Server it can be done in just minutes, even with no framework or Python knowledge. It runs a multi-page admin application and a multi-table JSON:API with Swagger, out of the box, supporting custom client application development, ad hoc application integration and agile collaboration based on working software.

API appliances are extremely agile and simple

Just like you can plug in a toaster and add bread...

You can plug this API Appliance into a database , and add rules and Python.

API Appliance 作为烤面包机

Automation can provide:

  • Exceptional agility and simplicity

  • With all the flexibility of a framework

Creating a modern, API-based web application using a traditional framework is a daunting task. This may take several weeks and extensive knowledge of the framework.

In this article, we'll use API Logic Server (open source, available here) to create it in minutes instead of weeks or months. And, we'll show how to do it with almost zero framework knowledge or even Python knowledge. We'll even show you how to add message-based integration.

1. Insert it into the database

The following is how to insert the ApiLogicServer device into the database:

$ ApiLogicServer create-and-run --project-name=sample_ai -- db-url=sqlite:///sample_ai.sqlite

No database? Use AI to create one, as described in the article Artificial Intelligence and Rules for Agile Microservices in Minutes.

It runs: Management Applications and APIs

Instantly, you have a running system, as shown in the split screen below:

  • Multi-page management application (shown on the left), powered by

  • Multi-table JSON:API with Swagger (shown on the right Pictured)

运行系统显示多页面管理应用程序和多表 JSON:API 与 Swagger

So, out of the box, you can support:

  • Customization Client Application Development

  • Ad hoc application integration

  • Agile collaboration based on working software

Instead of spending weeks coding complex and time-consuming frameworks, #you now have working software.

Containerization

API Logic Server can be run as a container or standard pip installation. In either case, scripts are provided to containerize your project for deployment, such as to the cloud.

2. Add logic rules

Instant work software is great: just one command can replace weeks of work, and the knowledge required is next to zero. But without logic execution, it's nothing more than a cool demo.

Behind the running application is a standard project. Open it with an IDE, then:

  • Use code completion to declare the logic.

  • Use the debugger to debug it.

API appliances are extremely agile and simple

The above code is not traditional procedural logic, but declarative. As with spreadsheets, you can declare rules for multi-table derivation and constraints. These rules handle all database access, dependencies, and ordering.

The results are remarkable:

  • The five spreadsheet-like rules above execute the same logic as 200 lines of Python.

  • The backend part of the system is 40 times simpler.

Similar rules are provided to grant row-level access based on user roles.

3. Add Python for increased flexibility

Automation and rules provide superior agility with little in-depth knowledge required. However, automation always has its limitations: you need flexibility to deliver complete results.

For flexibility, the device allows you to use Python and popular software packages to get the job done. Below, we customize pricing discounts and send Kafka messages:

定制定价折扣和发送 Kafka 消息

Scalable Declarative Automation

The screenshot above demonstrates Extraordinary agility. Using traditional frameworks, this system could take weeks or months.

But it’s not just agility. The level of abstraction here is very high, bringing a level of simplicity that enables you to create microservices - even if you are new to Python or frameworks like Flask and SQLAlchemy.

There are 3 key elements to achieve this speed and simplicity:

1. Microservice automation: No need to do slow and complex framework coding, just plug into the database to get instant API and Management application.

2. Logic automation with declarative rules: Rules are not boring code that describes how logic runs, but express what you want to accomplish.

3. Extensibility: Use IDEs, Python, and standard packages (such as Flask and SQLAlchemy) to complete the remaining elements.

This kind of automation equipment can provide significant benefits, allowing more people to do more things.

The above is the detailed content of API appliances are extremely agile and simple. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn