Skip to content

About

Multi-stage AI compiler that transforms natural language into validated, executable app configs (UI + API + DB + Auth). Built with React + Groq + LLaMA 3.3 70B.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

🧠 Natural Language App Compiler

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.


🔗 Live Demo

Try it live on Vercel

💡 The Idea

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.


✨ What Gets Generated

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

🏗️ Pipeline Architecture

The system uses a rigid, sequential pipeline to ensure logical consistency. One prompt to an LLM = immediate failure. This is engineered, not just prompted.

  1. Stage 1: Intent Extraction ⮕ Features, entities, roles, and constraints.
  2. Stage 2: System Design ⮕ Pages, endpoints, DB tables, and user flows.
  3. Stage 3: Schema Generation ⮕ Full technical JSON for UI/API/DB/Auth.
  4. Stage 4: Validation & Repair ⮕ The "Core" that fixes cross-layer inconsistencies.
  5. Stage 5: Refinement ⮕ Assumption logging and conflict resolution.

🔧 Validation + Repair Engine

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 subscriptions table exists.
  • JSON Sanitization: Strips fences and extracts clean blocks.

🚀 Getting Started

Prerequisites

Installation

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

About

Multi-stage AI compiler that transforms natural language into validated, executable app configs (UI + API + DB + Auth). Built with React + Groq + LLaMA 3.3 70B.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages