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://...# 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.pyWhat 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
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
| 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 |
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
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.
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
βββββββββββββββββββββββββββββββββββββββββββββββ
β 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
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
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...)
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]=10Features:
- Filtering, sorting, pagination
- Related data (automatic joins)
- Optimistic locking
- Swagger documentation
- Logic enforcement on all updates
genai-logic genai --using=prompt.txtExample 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!
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!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.pyOutput: Complete traceability from requirements β tests β rules β execution trace.
See how Microservice Automation creates and runs a microservice - a multi-page app and an API:
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.
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.pySee dev installation docs for complete setup.
- π 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
- Express Install - Get running in 10 minutes
- Manager Workspace - Project organization and readme
- Tutorial - Complete walkthrough
- Logic: Why - The case for declarative logic
- API Self-Serve - Consumer-driven APIs
- Behave Testing - BDD test framework integration
- Natural Language Logic - GenAI logic translation
- Integration Patterns - Kafka, B2B, MCP
- Database Changes - Schema evolution
| 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 |
API Logic Server builds on proven technology with 40+ years of production validation:
- 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
- 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
- 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.
| 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 | β Python + Rules | |
| IDE | β Standard tools | β Proprietary | β VSCode, PyCharm |
| Deployment | β Any platform | β Docker, any cloud | |
| GenAI Integration | β None | β Full (DB + Logic) | |
| Testing | Manual | Limited | β Auto-generated |
- SQLite (included samples)
- PostgreSQL
- MySQL / MariaDB
- SQL Server
- Oracle
- Any SQLAlchemy-supported database
- 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
MIT License - see LICENSE file
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
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.
- π 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
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

