Skip to main content

No project description provided

Project description

API Logic Server

Downloads Latest Version Supported Python versions

Transform 30-40 years of backend development requests into 3-4 days with GenAI-powered microservice automation.

Create instant microservices (MCP-enabled API + Admin App + Business Logic) from your database or a natural language prompt:

ApiLogicServer create --project_name=my_app --db_url=mysql://...

API Logic Server Architecture


โšก Quick Start (2 minutes)

# Install (Python 3.10-3.13)
python -m venv venv                      # windows: python -m venv venv
source venv/bin/activate                 # windows: venv\Scripts\activate
python -m pip install ApiLogicServer

# Start the Manager (opens readme with instructions)
ApiLogicServer start

# Create project from your database (or use sample)
ApiLogicServer create --project_name=my_app --db_url=

# Run it
cd my_app
python api_logic_server_run.py

What you get in 5 seconds:

  • ๐Ÿš€ JSON:API - Endpoints for every table with filtering, pagination, related data
  • ๐Ÿ“ฑ Admin App - Multi-page React app with automatic joins
  • ๐Ÿง  Logic Engine - Spreadsheet-like rules (40X more concise than code)
  • ๐Ÿ” Security - Row-level authorization, JWT authentication
  • ๐Ÿณ Docker-ready - Pre-configured containers for deployment

๐Ÿ“– 4-minute video demo | ๐Ÿ“š Full Documentation | ๐Ÿ  Home


๐ŸŽฏ Why API Logic Server?

Built on 40+ years of proven technology (Wang PACE โ†’ Versata โ†’ API Logic Server):

  • 6,000+ production deployments validated the declarative approach
  • Fortune 500 companies relied on this architecture for mission-critical systems
  • Now open source and modernized for cloud-native Python/React stack

The Problem It Solves

Traditional Approach API Logic Server
Weeks to create API endpoints 5 seconds (automated)
200+ lines of update logic code 5 rules (40X reduction)
Manual screen painting Automated from data model
Hard to integrate systems MCP-enabled APIs
Opaque procedural code Declarative living documentation

๐Ÿ’ก Use Cases

  • ๐Ÿ”Œ Application Integration - Instant APIs for legacy databases
  • โšก Rapid Prototyping - Working backend in minutes, not weeks
  • ๐Ÿค– GenAI Backends - Natural language โ†’ working microservice
  • ๐Ÿข Backoffice Apps - Admin dashboards for data maintenance
  • ๐Ÿ”— Microservices - Decompose monoliths with instant services

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Natural Language Prompt or Existing DB     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚ ApiLogicServer create
                โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Generated Project                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  ๐Ÿ“ฑ Admin App (React)                       โ”‚
โ”‚  ๐Ÿ”Œ JSON:API (SAFRS)                        โ”‚
โ”‚  ๐Ÿง  Logic (Rules Engine)                    โ”‚
โ”‚  ๐Ÿ’พ ORM (SQLAlchemy)                        โ”‚
โ”‚  ๐Ÿ” Security (JWT + Row-level)              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
                โ†“
        ๐Ÿณ Docker Container

Technology Stack:

  • Python 3.10-3.13
  • Flask + SQLAlchemy
  • React + Material-UI
  • Docker + Docker Compose

๐Ÿ“ฆ What Gets Created

my_app/
โ”œโ”€โ”€ api/                    # JSON:API endpoints
โ”‚   โ”œโ”€โ”€ expose_api_models.py
โ”‚   โ””โ”€โ”€ customize_api.py    # Add custom endpoints
โ”œโ”€โ”€ ui/admin/              # Admin App
โ”‚   โ””โ”€โ”€ admin.yaml         # Declare UI behavior
โ”œโ”€โ”€ logic/                 # Business Logic
โ”‚   โ””โ”€โ”€ declare_logic.py   # Spreadsheet-like rules
โ”œโ”€โ”€ security/              # Authentication & Authorization
โ”‚   โ””โ”€โ”€ declare_security.py
โ”œโ”€โ”€ database/              # SQLAlchemy models
โ”‚   โ””โ”€โ”€ models.py
โ”œโ”€โ”€ tests/                 # BDD tests (Behave)
โ””โ”€โ”€ devops/
    โ””โ”€โ”€ docker/            # Deployment configs

๐Ÿš€ Key Features

1๏ธโƒฃ Declarative Logic (40X More Concise)

Before (200+ lines of Python):

# Manual cascade updates, balance calculations, constraint checking...
# Complex dependency tracking, old_row comparisons...
# Missed corner cases: reassign order, change quantity, delete order...
# (Imagine 200 lines of procedural code here)

After (5 declarative rules):

Rule.constraint(derive=Customer.Balance <= Customer.CreditLimit)
Rule.sum(derive=Customer.Balance, as_sum_of=Order.AmountTotal, 
         where=lambda row: row.ShippedDate is None)
Rule.sum(derive=Order.AmountTotal, as_sum_of=OrderDetail.Amount)
Rule.formula(derive=OrderDetail.Amount, 
             as_expression=lambda row: row.Quantity * row.UnitPrice)
Rule.copy(derive=OrderDetail.UnitPrice, from_parent=Product.UnitPrice)

Rules automatically handle all dependencies:

  • โœ… Chain up (OrderDetail โ†’ Order โ†’ Customer)
  • โœ… Chain down (Product price change cascades)
  • โœ… Old row comparisons (moved orders adjust both customers)
  • โœ… All 9 use cases (add, update, delete, reassign...)

2๏ธโƒฃ Self-Serve APIs

Consumers select their own attributes and related data - no custom API development required:

# Get customer with orders and order details
GET /api/Customer/ALFKI?include=OrderList,OrderList.OrderDetailList&fields[Customer]=CompanyName,Balance

# Filter and sort
GET /api/Customer?filter[Balance][$gt]=1000&sort=-Balance&page[size]=10

Features:

  • Filtering, sorting, pagination
  • Related data (automatic joins)
  • Optimistic locking
  • Swagger documentation
  • Logic enforcement on all updates

3๏ธโƒฃ GenAI Integration

Create from Natural Language

ApiLogicServer genai --using=prompt.txt

Example prompt:

Create a system for customers, orders, items and products.
Customer balance is sum of unshipped order totals.
Order total is sum of item amounts.
Item amount is quantity * unit price.
Copy product price to item unit price.
Constraint: customer balance cannot exceed credit limit.

Result: Working microservice with logic in 10 seconds!

AI-Assisted Development

Every created project includes:

  • ๐Ÿค– Copilot instructions (.copilot-instructions.md)
  • ๐Ÿ“š Training materials (docs/training/)
  • ๐Ÿ” Logic from natural language (translate English โ†’ rules)
# Paste into Copilot: "Create logic for check credit"
# Copilot generates the 5 rules above!

4๏ธโƒฃ Living Documentation

Automated test generation from your rules:

# Generate Behave tests from declared logic
ApiLogicServer add-tests

# Run tests
behave

# Generate documentation
python behave_logic_report.py

Output: Complete traceability from requirements โ†’ tests โ†’ rules โ†’ execution trace.


๐ŸŽฌ Video Overview (4 min)

See how Microservice Automation creates and runs a microservice - a multi-page app and an API:

GenAI Automation


๐Ÿค Contributing

We welcome contributions! Areas of interest:

Area Current Ideas for Contribution
API JSON:API, Swagger GraphQL, gRPC support
Deployment Docker, Azure AWS (ECS/Lambda), Kubernetes/Helm charts
Logic Rules engine Additional rule types, performance tuning
UI Admin App (React) Custom UI frameworks, mobile SDK
GenAI Web version, CLI Enhanced natural language understanding

See issues for current requests.

Development Setup

For development (extending API Logic Server itself):

# Clone and install dev version
git clone https://github.com/ApiLogicServer/ApiLogicServer-src.git
cd ApiLogicServer-src

# Install dependencies
python -m pip install -r requirements.txt

# Run build/test automation
python test/build_and_test.py

See dev installation docs for complete setup.


๐Ÿ“š Documentation


๐Ÿ“– Key Documentation Pages

Getting Started

Core Concepts

Advanced Topics


๐ŸŒŸ Examples and Samples

See all sample projects

Sample Description Database
basic_demo Check credit rules, Behave testing SQLite (Northwind)
genai_demo Created from natural language SQLite
classicmodels Sales, employees, offices MySQL
chinook Music store (artists, albums, tracks) SQLite/PostgreSQL
postgres-nw Northwind on PostgreSQL PostgreSQL
sqlserver Adventure Works SQL Server

๐Ÿ† Technology Lineage

API Logic Server builds on proven technology with 40+ years of production validation:

Wang Labs PACE (1980s-1990s)

  • Inventor: Val Huber (Designer and Co-inventor with Ron Ross of declarative rules)
  • Scale: 6,000+ production deployments
  • Innovation: First commercial declarative business rules system
  • Platform: Minicomputers โ†’ Visual Basic

Versata (1990s-2010s)

  • Leadership: Val Huber (CTO)
  • Customers: Fortune 500 companies
  • Scale: $3.4 billion company (IPO: VSTA)
  • Innovation: Evolved rules for J2EE enterprise applications
  • Platform: Java Enterprise Edition

API Logic Server (2020-present)

  • Leadership: Val Huber (Architect and Lead Developer)
  • Innovation: Modern cloud-native Python/React implementation
  • Platform: Open source, Docker, microservices architecture
  • Unique: Combined with GenAI for natural language logic

The same declarative rules paradigm, proven at scale, now open source and AI-enhanced.


๐Ÿ“Š Comparison: Frameworks vs Low Code vs API Logic Server

Aspect Frameworks
(Django, Flask)
Low Code
(Retool, Appsmith)
API Logic Server
API Creation Manual (weeks) Limited/proprietary โœ… Automated (5 sec)
Logic Automation โŒ Manual code โŒ Limited โœ… Rules (40X)
App Automation โŒ Manual โœ… GUI builder โœ… From data model
Customization โœ… Full Python โš ๏ธ Proprietary โœ… Python + Rules
IDE โœ… Standard tools โŒ Proprietary โœ… VSCode, PyCharm
Deployment โœ… Any platform โš ๏ธ Vendor lock-in โœ… Docker, any cloud
GenAI Integration โŒ None โš ๏ธ Limited โœ… Full (DB + Logic)
Testing Manual Limited โœ… Auto-generated

๐Ÿ’พ Supported Databases

  • SQLite (included samples)
  • PostgreSQL
  • MySQL / MariaDB
  • SQL Server
  • Oracle
  • Any SQLAlchemy-supported database

๐Ÿ” Security Features

  • Authentication: SQL-based, Keycloak, or custom providers
  • Authorization: Role-based grants with row-level filtering
  • Multi-tenant: Global filters based on user attributes
  • JWT Tokens: Standard authentication flow
  • Swagger Security: Integrated with API documentation

See Security Overview


๐Ÿ“„ License

MIT License - see LICENSE file


๐Ÿ™ Acknowledgments

Built on the shoulders of giants:

Technology Pioneers:

  • Wang Labs PACE (1980s) - Original declarative rules concept (Val Huber, designer/co-inventor)
  • Versata (1990s-2010s) - $3.4B company, Fortune 500 deployments (Val Huber, CTO)
  • Ron Ross - Co-inventor of declarative rules paradigm

Open Source Foundation:

  • Flask - Web framework
  • SQLAlchemy - ORM layer
  • SAFRS - JSON:API implementation
  • React - Admin App UI
  • Material-UI - Component library
  • Behave - BDD testing framework

Community:

  • All contributors who have submitted issues, PRs, and feedback
  • The Python and React ecosystems

๐Ÿ“ž Connect

๐Ÿ“– Recommended Reading

Start with the welcome article to understand the vision and architecture:


โญ Star this repo if you find it useful!

Made with โค๏ธ by the API Logic Server team

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

apilogicserver-15.2.0.tar.gz (45.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apilogicserver-15.2.0-py3-none-any.whl (47.0 MB view details)

Uploaded Python 3

File details

Details for the file apilogicserver-15.2.0.tar.gz.

File metadata

  • Download URL: apilogicserver-15.2.0.tar.gz
  • Upload date:
  • Size: 45.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for apilogicserver-15.2.0.tar.gz
Algorithm Hash digest
SHA256 ae73e84cdc8036a2adc6e8bde041101e07bfbe05ff3260a0713251a024c93e0d
MD5 5af2fe7277755c32eb4d3acc5375505f
BLAKE2b-256 9a592851197b34a529d55110e81e4f79fdf92ced97ebd51aef3fea66dbcbfb0c

See more details on using hashes here.

File details

Details for the file apilogicserver-15.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apilogicserver-15.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3224f288d58dde1f6648c7d7356a4d3daed44f01b1af1e2184adb049b8d0eb
MD5 2882a93492efe7a9f6e930861b87fad1
BLAKE2b-256 e822672a4dc5256d4c9937f3ce46bb52d223ec97f9a0e54edcffe3298508e3ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page