No project description provided
Project description
API Logic Server
Create instant microservices from your database or natural language prompt - working API + Admin App + Logic in 5 seconds, with 40X code reduction through declarative rules.
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://...
โก 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)
genai-logic start
# Create project from your database (or use sample)
genai-logic 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
- ๐ฑ Instant Admin App UI - Multi-page React app with automatic joins (runs immediately)
- ๐จ Custom Apps via API - Use the API with your favorite vibe tools (Cursor, Bolt, Lovable, etc.) OR leverage GenAI-Logic training for Copilot to build custom UIs (see this article)
- ๐ง Logic Engine - Spreadsheet-like rules (40X more concise than code)
- ๐ Security - Row-level authorization, JWT authentication
- ๐ณ Docker-ready - Pre-configured containers for deployment
Mix and match: Use the instant Admin App for backoffice tasks AND build custom UIs with vibe tools for advanced features like cards and maps - all powered by the same logic-enabled API.
๐ 8-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 - to see an A/B Comparision, click here |
| Manual screen painting | Automated from data model, plus vibe-enabled custom UIs |
| Hard to integrate systems | MCP-enabled APIs |
| Opaque procedural code | Declarative living documentation |
๐ก When to Use API Logic Server
โ Ideal Use Cases
API Logic Server excels at data-centric business applications where the complexity is in multi-table calculations, constraints, and derivations:
- ๐ Application Integration - Instant APIs for legacy databases (modernization without rewrite)
- โก Rapid Prototyping - Working backend in minutes for validation
- ๐ค GenAI Backends - Natural language โ working microservice
- ๐ข Backoffice Apps - Admin dashboards for data maintenance
- ๐ Microservices - Decompose monoliths with instant services
- ๐ Business Rule Automation - Complex calculations, cascading updates, constraint checking
- ๐ CRUD-Heavy Applications - Order management, inventory, customer systems
- ๐๏ธ Legacy Modernization - MCP-enable existing databases, create modern API layer while legacy apps continue running
Sweet Spot: Applications where business logic complexity >> UI complexity
โ ๏ธ Not Recommended For
API Logic Server is optimized for data-centric business logic, but less suited for:
- Real-time streaming systems - Use Kafka/Flink for high-throughput event processing
- Complex UI/UX interactions - Works great as the backend, but not a UI framework
- Machine learning pipelines - Use TensorFlow/PyTorch for ML workflows
- Low-level system programming - Traditional languages better suited
- Document/content management - Use specialized CMS platforms
- Simple static websites - Overkill for basic content delivery
For these scenarios, traditional approaches are more appropriate. API Logic Server can still serve as the backend for hybrid architectures.
โ Frequently Asked Questions
Q: How is this different from low-code platforms (Retool, OutSystems, Hasura)?
A: Unlike pure low-code platforms, API Logic Server generates standard Python projects you own, extend and deploy. Screen creation is by vibe tools rather than screen painting. Unlike API generators, it includes sophisticated multi-table logic automation (40X code reduction). Read detailed comparison โ
Q: Isn't this just vendor lock-in?
A: It's free and open source. The declarative rules sit on top of standard (readable, version-controlled) Python โ you can always drop down to procedural code. If you ever need to migrate away, you can either keep using the rules engine (it's just a library) or replace declarative rules with equivalent procedural code using standard SQLAlchemy events.
Q: Can I customize the generated app?
A: Absolutely. You can override the UI, extend APIs, and plug in your own logic โ using standard Python, SQLAlchemy, and any Vibe tool. The generated project is a starting point, not a black box. See customization patterns โ
Q: What happens when logic doesn't fit the declarative model?
A: The declarative engine handles over 95% of typical business logic (calculations, validations, cascading updates). For complex workflows, state machines, or external integrations, you write standard Python event handlers that coexist with declarative rules. The engine calls your code at the right time โ no conflict, full extensibility.
Q: How long does it take developers to become productive?
A: Developers can start writing rules immediately using natural language, and the DSL syntax is intuitive. Understanding the engine's optimization strategies (pruning, chaining) takes a few days of practice. Most teams are fully productive within a week.
Q: What if I have questions or need help?
A: Join our Discord community for real-time help, check GitHub Discussions, or browse the comprehensive documentation.
โ More FAQs in detailed article
๐๏ธ 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 (for Admin App AND custom UIs)
โ โโโ expose_api_models.py
โ โโโ customize_api.py # Add custom endpoints
โโโ ui/admin/ # Instant Admin App (ready to run)
โ โโโ admin.yaml # Declare UI behavior
โโโ logic/ # Business Logic (enforced on ALL API calls)
โ โโโ declare_logic.py # Spreadsheet-like rules
โโโ security/ # Authentication & Authorization
โ โโโ declare_security.py
โโโ database/ # SQLAlchemy models
โ โโโ models.py
โโโ tests/ # BDD tests (Behave)
โโโ docs/
โ โโโ training/ # GenAI-Logic training for Copilot
โโโ devops/
โโโ docker/ # Deployment configs
Two UI approaches (use both!):
- Instant Admin App - Runs immediately for backoffice/internal users
- Custom UIs - Build with vibe tools (Cursor, Bolt, etc.) OR use GenAI-Logic Copilot training to create React/Vue/Angular apps that consume the API
๐ 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
genai-logic 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 AI tutoring to help you get oriented and productive quickly:
- ๐ค Copilot instructions (
.copilot-instructions.md) - When you open a project, Copilot presents a friendly welcome message explaining what's already built and what you can do next. Ask Copilot to "read instructions" anytime for guidance. - ๐ Training materials (
docs/training/) - Comprehensive guides for all features - ๐ 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
genai-logic add-tests
# Run tests
behave
# Generate documentation
python behave_logic_report.py
Output: Complete traceability from requirements โ tests โ rules โ execution trace.
๐ฌ Video Overview (8 min)
See how Microservice Automation creates and runs a microservice - a multi-page app and an API:
๐ค 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
- ๐ Full Documentation - Comprehensive guides and reference
- ๐ Quick Start Tutorial - 20-minute walkthrough
- ๐ง Logic Documentation - Rule types and patterns
- ๐ Security Guide - Authentication and authorization
- ๐ณ Deployment - Docker, Azure, containers
- ๐ง Architecture - How it works
- โ FAQs - Common questions
- ๐ Issue Tracker - Bug reports and feature requests
๐ Key Documentation Pages
Getting Started
- Express Install - Get running in 10 minutes
- Manager Workspace - Project organization and readme
- Tutorial - Complete walkthrough
Core Concepts
- Logic: Why - The case for declarative logic
- API Self-Serve - Consumer-driven APIs
- Behave Testing - BDD test framework integration
Advanced Topics
- Natural Language Logic - GenAI logic translation
- Integration Patterns - Kafka, B2B, MCP
- Database Changes - Schema evolution
๐ Examples and Samples
| 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
๐ 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
๐ In-Depth Articles
These Medium articles provide comprehensive context on architecture, use cases, and the reasoning behind API Logic Server:
| Article | Topic | Key Insights |
|---|---|---|
| Welcome to GenAI-Logic | Vision & Overview | Big picture: Does GenAI deliver business agility? Start here for context. |
| Declarative GenAI Architecture | Technical Deep Dive | NL โ DSL โ Engines pattern, FrankenCode problem, includes FAQ section |
| Declarative Logic: Living in a Procedural World | Architecture Philosophy | How declarative rules work in Python, the paradox resolved |
| Living With Logic in the Enterprise | Production Patterns | Debugging, testing, performance, customization in real deployments |
| Business User / IT Collaboration | Team Dynamics | How logic acts as a contract between business and IT |
| Vibe an MCP Server | MCP Integration | Creating MCP-enabled services with natural language |
| Probabilistic and Deterministic Logic | AI + Rules | Engineering reliability into agentic systems (AI at runtime + rules) |
| Enterprise Vibe Automation | GenAI Workflows | Full-stack automation from prompts |
These articles represent significant research and real-world experience - they address common questions, architectural decisions, and lessons learned from 40+ years of declarative technology evolution.
๐ Connect
- ๐ Home: genai-logic.com
- ๐ฌ Discord: Join our community - Get help and discuss
- ๐ Issues: GitHub Issues
- ๏ฟฝ Discussions: GitHub Discussions
- ๏ฟฝ Documentation: apilogicserver.github.io/Docs
- ๐ Blog: Medium Articles - Conceptual background and insights
๐ Recommended Reading
Start with the welcome article to understand the vision and architecture:
- Welcome to GenAI Logic - Introduction and core concepts
โญ 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apilogicserver-15.4.1.tar.gz.
File metadata
- Download URL: apilogicserver-15.4.1.tar.gz
- Upload date:
- Size: 45.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
588d71bc8ac00b68744911acd95778f748a9bbc1d33a5305dde03425414418e9
|
|
| MD5 |
6d0b00c6a6aa22b32a0c3ca4cff2ad32
|
|
| BLAKE2b-256 |
4109b28678d9d0f693dc07102c09a8a3451ba33040f0fdc9832c096c6a11bc65
|
File details
Details for the file apilogicserver-15.4.1-py3-none-any.whl.
File metadata
- Download URL: apilogicserver-15.4.1-py3-none-any.whl
- Upload date:
- Size: 47.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8141a65a3567b564d0ecf84bc4a349dd3a5d37e4629e4a898072804c62279d02
|
|
| MD5 |
2e253955eba9d2cf5af8fdcff0d946ed
|
|
| BLAKE2b-256 |
2eb5cc3f1088343ff0f8fadb378e7b390bcaddfde5c54350814fd1977835d5a9
|