Transform plain English into a complete, validated, executable application config using a deterministic multi-stage AI pipeline.
Not a chatbot. Not a code generator. A compiler.
When you ask ChatGPT to "build me a CRM," it gives you code snippets to read and manually wire together. That is an assistant. This is a compiler.
The Flow:
English Prompt ⮕ 5-Stage Pipeline ⮕ Structured Config ⮕ Runtime Scaffolder
You type one sentence. The system produces a complete, cross-validated machine-readable blueprint covering every layer of your application—ready to be executed by a code generator.
From a single prompt like:
"Build a CRM with login, contacts, dashboard, and a premium plan with payments."
The compiler produces a synchronized blueprint:
| Layer | What's Inside |
|---|---|
| UI | Pages, routes, components, layouts |
| API | REST endpoints, methods, auth flags, request/response shapes |
| Database | Tables, columns, types, indexes, relations |
| Auth | Strategy, roles, per-role permissions |
| Business Logic | Premium feature gates, role guards |
The system uses a rigid, sequential pipeline to ensure logical consistency. One prompt to an LLM = immediate failure. This is engineered, not just prompted.
- Stage 1: Intent Extraction ⮕ Features, entities, roles, and constraints.
- Stage 2: System Design ⮕ Pages, endpoints, DB tables, and user flows.
- Stage 3: Schema Generation ⮕ Full technical JSON for UI/API/DB/Auth.
- Stage 4: Validation & Repair ⮕ The "Core" that fixes cross-layer inconsistencies.
- Stage 5: Refinement ⮕ Assumption logging and conflict resolution.
This is the heart of the system. It detects and fixes inconsistencies automatically—no blind retries.
- API Integrity: Ensures endpoints reference valid DB tables.
- Auth Consistency: Auto-injects missing roles across all layers.
- Logic Mapping: If you mention "payments," it ensures a
subscriptionstable exists. - JSON Sanitization: Strips fences and extracts clean blocks.
- Node.js 18+
- Groq API Key (Get one for free here)
git clone https://github.com/codeitwithaayush/Natural-language-app-compiler.git
cd Natural-language-app-compiler
npm install
Environment Setup
Create a .env file in the root:
Code snippet
REACT_APP_GROQ_API_KEY=your_groq_api_key_here
Run the Compiler
Bash
npm start
The UI opens at http://localhost:3000.
📦 Using the Output
The compiled JSON can be fed into the included generator script to scaffold a real Next.js app:
Copy the compiled config from the "Compiled Config" tab in the UI.
Save it as app-config.json in your target directory.
Run the generator:
Bash
node generate.js
What gets created:
prisma/schema.prisma — Database schema ready to migrate.
pages/api/ — Next.js API routes per endpoint.
pages/ — UI page scaffolds.
lib/auth.js — Role-based auth middleware.
🛠️ Tech Stack
Frontend: React 18
Inference: Groq API
Model: LLaMA 3.3 70B
Target Output: Next.js, Prisma, Tailwind CSS