Turning natural language requirements into production-ready schemas is a high-entropy task. Traditional "one-shot" LLM prompting often results in hallucinations, where the UI layer references non-existent API endpoints, or the database schema lacks the fields required by the business logic. These "mismatches" are silent killers in automated development pipelines, leading to broken builds and inconsistent state.
AppCompiler rejects the fragile "Single Prompt" approach. Instead, it utilizes a 4-Stage Compiled Pipeline that streams partial state updates to the UI in real-time using Server-Sent Events (SSE).
- Architecting Intent: Parses requirements into a high-level Design Spec (Entities, Roles, RBAC).
- Schema Compilation: Translates design into UI Layouts (JSON), API Endpoints (JSON), and DB DDL (SQL).
- Smart Validation: A "Judge" agent audits the schemas for orphans (e.g., a UI button pointing to a missing API path).
- Self-Repair: If inconsistencies are found, the engine triggers a repair cycle, reconciling all layers before final output.
The UI is built on a streaming architecture. As soon as Stage 1 is complete, the Architectural Intent is rendered in the dashboard while Stage 2 compiles in the background. No more waiting for "all or nothing" responses.
- Production-Ready SQL: Generates Postgres Triggers, Immutable Audit Rules (
INSTEAD NOTHING), and UUID-based primary keys. - HIPAA & Compliance: Built-in awareness for sensitive architectures (Encryption flags, Access logging).
- Infrastructure Resiliency: Implements Exponential Backoff to handle rate limits and API flickers gracefully.
A high-fidelity React dashboard featuring:
- Glassmorphism Layout: A symmetrical 50/50 workspace for controls and output.
- Sequential JSON Viewers: Tabs that update progressively as schemas are validated.
- Success Modal: A summary popup providing an artifact count and repair status upon completion.
An eval harness (evals/) grades compiled output with deterministic checks first and an LLM-as-judge second, traces every pipeline step (latency, tokens, error class), and gates changes against a committed baseline. Infrastructure errors such as quota limits are reported separately and never counted as model failures.
Measured on the recorded HIPAA healthcare output (evals/recorded/healthcare-hipaa.json):
| Check | Result |
|---|---|
| UI → API endpoint consistency (exact match, path params normalized) | ✅ pass |
| Every API resource has a backing table | ✅ pass |
| Foreign keys point at existing tables, no duplicate tables | ✅ pass |
| Audit-log table present and protected from UPDATE/DELETE | ✅ pass |
| A UI component reads a POST-only endpoint | |
/doctor/* and /ai/* paths cannot be mapped to a table by name |
Limits: only one output is recorded so far (the other 12 dataset cases are skipped until recorded with --live --record), and the LLM judge has not yet been calibrated against human labels.
pip install -r requirements.txt -r requirements-dev.txt
python -m pytest -q # unit + regression tests, no API key
python -m evals.runner --replay evals/recorded --no-judge # re-grade recorded outputs, gate on baseline
GOOGLE_API_KEY=... python -m evals.runner --live --record evals/recorded- The validator never checked UI→API when
data_endpointwas top-level, so the self-repair check was skipped for generated schemas. - Prefix matching let
/api/v1/leadspass when only/api/v1/leads/hotexisted. - Quota errors were scored as model failures (a committed run showed 0/10 purely from a 429).
- A per-day quota was retried with backoff for hours although it cannot recover.
See evals/README.md for the design.
├── frontend/ # Vite + React Dashboard
├── blueprints/ # High-level design artifacts
├── schemas/ # Generated UI/API/DB outputs
├── evals/ # Eval harness: checks, judge, tracing, dataset, runner
├── tests/ # Unit + regression tests
├── examples/ # Mock server (not the real pipeline)
├── agents.py # Core LLM Agent logic
└── main.py # Entry point & Pipeline Orchestrator
- Configure Environment: Add
GOOGLE_API_KEYto your.envfile. - Start Backend:
python main.py # Runs on http://localhost:8001 - Start Frontend:
cd frontend && npm run dev # Runs on http://localhost:5173
- Run Tests:
pip install -r requirements-dev.txt && python -m pytest -q
AppCompiler is optimized for Vercel Serverless Functions:
- Root Directory:
./ - Build Command:
cd frontend && npm install && npm run build - Note: Ensure
maxDuration: 300is set in Project Settings to allow for complex AI repair cycles.
Developed by K. Sri Rishikesh varma. High-fidelity, self-healing architecture.