Create JSON:API and Admin Web App from database, with LogicBank -- 40X more concise, Python for extensibility.
Project description
title: API Logic Server
Find the documentation here. To explore (no download, no install), click...
-
here for an App Fiddle for learning Flask, SQLAlchemy and API Logic Server
-
here for an Instant Eval
Welcome to API Logic Server - Source
API Logic Server creates customizable database web app projects:
-
Creation is Instant: create projects with a single command
-
Projects are Highly Functional:
-
API: an endpoint for each table, with filtering, sorting, pagination and related data access
-
Admin UI: multi-page / multi-table apps, with page navigations and automatic joins
-
-
Projects are Customizable, using your IDE: such as VSCode, PyCharm, etc, for familiar edit/debug services
-
Business Logic Automation: using unique rules, extensible with Python
Background
A brief look at why we built it, and what it is.
Motivation - not instant, propietary IDE, no logic automation
We looked at approaches for building database systems:
-
Frameworks: Frameworks like Flask or Django enable you to build a single endpoint or Hello World page, but a multi-endpoint API and multi-page application would take weeks or more.
-
Low Code Tools: these are great for building great UIs, but
- Want a multi-page app -- no screen painting
- Want to preserve dev tools - VSCode, PyCharm, git, etc
- Need an answer for backend logic (it's nearly half the effort)
Our Approach: Instant, Customizable, Logic Automation
API Logic Server is an open source Python project, consisting of:
-
a set of runtimes (SAFRS API, Flask, SQLAlchemy ORM, rule engine) for project execution, plus
-
a CLI (Command Language Interface) to create executable projects, which can be customized in an IDE such as VSCode or PyCharm
It runs as a standard pip install, or under Docker. After installation, you use the CLI create a project like this:
ApiLogicServer create --project_name=ApiLogicProject db_url=
API Logic Server reads your schema, and creates an executable, customizable project providing the features listed below. Check it out - zero install - here, in Codespaces.
Feature Summary
Feature | Providing | Why it Matters | |
---|---|---|---|
Instant | 1. Admin App | Instant multi-page, multi-table app (running here on PythonAnywhere) | Engage Business Users Back-office Admin |
2. JSON:API and Swagger | Endpoint for each table, with... Filtering, pagination, related data |
Unblock custom App Dev Application Integration |
|
3. Data Model Class Creation | Classes for Python-friendly ORM | Custom Data Access Used by API |
|
Customizable | 4. Customizable Project | Custom Endpoints, Logic Use Python and your IDE |
Customize and run Re-creation not required |
Unique Logic | 5. Spreadsheet-like Business Rules :trophy: | 40X more concise - compare legacy code | Unique backend automation ... nearly half the system |
Extensible with Python | Familiar Event Model | Eg., Send messages, email | |
Testing | 6. Behave Test Framework | Test Suite Automation Behave Logic Report Drive Automation with Agile |
Optimize Automation to get it fast Agile Collaboration to get it right |
Instant -- Single Command
Use the CLI to create the sample API and Admin App project, with a single command.
Create With Docker
Execute the following commands (Windows, use Powershell):
# Start the API Logic Server docker container
docker run -it --name api_logic_server --rm -p 5656:5656 -p 5002:5002 -v ${PWD}:/localhost apilogicserver/api_logic_server
ApiLogicServer create-and-run --project_name=/localhost/ApiLogicProject --db_url=
Or, Create With Local Install
Presuming Python 3.7+ is installed, it's typically:
python -m venv venv # may require python3 -m venv venv
source venv/bin/activate # windows venv\Scripts\activate
venv\Scripts\activate # mac/linux: source venv/bin/activate
python -m pip install ApiLogicServer
ApiLogicServer create-and-run # create, or create-and-run; accept defaults
Execute
Your server is running - explore the data and api at localhost:5656. Using the defaults provided above, you have started the Tutorial, the recommended quick start for API Logic Server.
Customize in IDE
VSCode and PyCharm users can customize and run/debug within their IDE with these steps. Created projects include Launch and Docker configurations.
Rebuild services are provided to accomodate changes to database structure or ORM classes.
Overview Video
Project creation is based on database schema introspection as shown below: identify a database, and the ApiLogicServer create
commands creates an executable, customomizable project.
Click for a video tutorial, showing complete project creation, execution, customization and debugging.
Getting Started
Quick Evaluation - no install
You can avoid install hassles by exploring the Sample Project in Codespaces. This will enable you to use VSCode - in your Browser, zero install - to:
- see the created project
- use the Tutorial to run, customize and debug it
We think you'll find Codespaces pretty amazing - check it out!
Local Install
API Logic Server is designed to make it easy to get started:
-
Install and run Tutorial - install, and explore the tutorial. You'll create a complete project using the pre-installed sample database, explore its features, and support for customization and debugging.
-
Dockerized Test Databases - then, you might like to try out some of our dockerized test databases.
-
Your Database - finally, try your own database.
Project Information
Tutorials
There are a number of facilities that will quickly enable you to get familiar with API Logic Server:
- Tutorial walks you through the steps of creating a server
- Video shows the steps of creating a server
Making Contributions
This is an open source project. We are open to suggestions. Some of our ideas include:
Component | Provides | Consider Adding |
---|---|---|
1. JSON:API and Swagger | API Execution | Serverless, Kubernetes |
2. Transactional Logic | Rule Enforcement | New rule types |
3. This project | API Logic Project Creation | Support for features described above |
To get started, please see the Architecture.
Status
We have tested several databases - see status here.
We are tracking issues in git.
Acknowledgements
Many thanks to
- Thomas Pollet, for SAFRS, SAFRS-react-admin, and invaluable design partnership
- Marelab, for react-admin
- Armin Ronacher, for Flask
- Mike Bayer, for SQLAlchemy
- Alex Grönholm, for Sqlacodegen
- Thomas Peters, for review and testing
- Meera Datey, for React Admin prototyping
- Denny McKinney, for Tutorial review
- Achim Götz, for design collaboration and testing
- Max Tardiveau, for testing and help with Docker
- Michael Holleran, for design collaboration and testing
- Nishanth Shyamsundar, for review and testing
- Gloria Huber and Denny McKinney, for doc review
Articles
There are a few articles that provide some orientation to API Logic Server:
- How Automation Activates Agile
- How Automation Activates Agile - providing working software rapidly drives agile collaboration to define systems that meet actual needs, reducing requirements risk
- How to create application systems in moments
- Stop coding database backends…Declare them with one command.
- Instant Database Backends
- Extensible Rules - defining new rule types, using Python
- Declarative - exploring multi-statement declarative technology
- Automate Business Logic With Logic Bank - general introduction, discussions of extensibility, manageability and scalability
- Agile Design Automation With Logic Bank - focuses on automation, design flexibility and agile iterations
- Instant Web Apps
[^1]: See the FAQ for Low Code
Change Log
02/13/2024 - 10.02.04: kafka_producer.send_kafka_message, sample md fixes, docker ENV, pg authdb
02/07/2024 - 10.02.00: BugFix[38]: foreign-key/getter collision
01/31/2024 - 10.01.28: LogicBank fix, sample-ai, better rules example
01/15/2024 - 10.01.18: Cleanup, logic reminder, nw tutorial fixes
01/08/2024 - 10.01.07: Default Interpreter for VS Code, Allocation fix, F5 note fix, #als signposts
01/03/2024 - 10.01.00: Quoted col names, Default Interpreter for VS Code
12/21/2023 - 10.00.01: Fix < Python 3.11
12/19/2023 - 10.00.00: Kafka pub/sub, Data Type Fixes
12/06/2023 - 09.06.00: Oracle Thick Client, Safrs 3.1.1, Integration Sample, No rule sql logging, curl Post
11/19/2023 - 09.05.14: ApiLogicServer curl, optional project_name arg on add-auth, add-db, rebuild
11/12/2023 - 09.05.08: multi-db bug fix (24)
11/07/2023 - 09.05.07: Basic-demo: simplify customization process
11/05/2023 - 09.05.06: Basic-demo enhancements, bug fixes (22, 23)
10/31/2023 - 09.05.00: Enhanced Security (global filter, permissions), Logic (Insert Parent)
09/29/2023 - 09.04.00: Enhanced devops automation (sqlite, MySql, Postgres)
09/08/2023 - 09.03.04: AI Driven Automation (preview)
09/08/2023 - 09.03.00: Oracle support
09/08/2023 - 09.02.23: Fix Issue 16 - Incorrect admin.yml when table name <> class name
08/22/2023 - 09.02.18: Devops container/compose, Multi-arch dockers, add-auth with db_url, auth docker dbs
07/04/2023 - 09.01.00: SQLAlchemy 2 typed-relns/attrs, Docker: Python 3.11.4 & odbc18
06/22/2023 - 09.00.00: Optimistic Locking, safrs 310 / SQLAlchemy 2.0.15
05/07/2023 - 08.04.00: safrs 3.0.4, tutorial demo notes, rm cli/docs, move pythonanywhere
05/01/2023 - 08.03.06: allocation sample
04/29/2023 - 08.03.03: restore missing debug info for open database failures
04/26/2023 - 08.03.00: virt attrs (Issue 56), safrs 3.0.2, LogicBank 1.8.4, project readme updates
04/13/2023 - 08.02.00: integratedConsole, logic logging (66), table relns fix (65)
03/23/2023 - 08.01.15: table filters, cloud debug additions, issue 59, 62-4
02/15/2023 - 08.00.01: Declarative Authorization and Authentication
01/05/2023 - 07.00.00: Multi-db, sqlite test dbs, tests run, security prototype, env config
11/22/2022 - 06.03.06: Image, Chkbox, Dialects, run.sh, SQL/Server url change, stop endpoint, Chinook Sqlite
10/02/2022 - 06.02.00: Option infer_primary_key, Oct1 SRA (issue 49), cleanup db/api setup, restore postgres dvr
09/15/2022 - 06.01.00: Multi-app Projects
08/28/2022 - 06.00.01: Admin App show_when, cascade add. Simplify Codespaces swagger url & use default config
06/12/2022 - 05.02.22: No pyodbc by default, model customizations simplified, better logging
05/04/2022 - 05.02.03: alembic for database migrations, admin-merge.yaml
04/27/2022 - 05.01.02: copy_children, with support for nesting (children and grandchildren, etc.)
03/27/2022 - 05.00.06: Introducing Behave test framework, LogicBank bugfix
12/26/2021 - 04.00.05: Introducing the Admin app, with Readme Tutorial
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ApiLogicServer-10.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 344450a2dcae8729b5464cfa408d07dec1962f2b35a369fb79d2d582b0b2d000 |
|
MD5 | 99476527bae520427091c8c49daf551d |
|
BLAKE2b-256 | 9a219404a1df8d879141daf5ecaae04c9d1c7943b2fe6c03e258ce2b5b29ae2f |