From natural language to production-ready SQL schemas in seconds.
Live demo • Overview • Screenshots • Architecture • Getting started • Features
Hosted on free tiers — the backend spins down when idle, so the first request after a while may take up to ~30s to wake up. The UI tells you when this is happening instead of just looking stuck.
EasySchema is a full-stack application that translates plain English descriptions of database structures into complete, executable SQL — CREATE TABLE DDL, INSERT seed DML, and a live entity-relationship diagram — powered by Groq's LLM, enforced through Pydantic schema validation, and compiled deterministically into PostgreSQL, MySQL, or SQLite syntax.
Tip
You don't need any database setup to use EasySchema. Just describe what you want and copy the generated SQL.
Landing page
Generator — Tables view, with syntax-highlighted DDL and seed-insert panels
Generator — Diagram view, foreign keys drawn as connectors between tables
easyschema/
├── backend/ # FastAPI server
│ ├── main.py # Entry point, CORS allowlist
│ ├── routers/schema.py # GET /api/health, POST /api/generate (rate-limited)
│ ├── models/schema.py # Pydantic models (columns, FK references, dialect)
│ ├── services/
│ │ ├── ai_service.py # Async Groq caller, retries transient failures
│ │ ├── sql_generator.py # Validation + dialect-aware DDL/DML compiler
│ │ └── orm_generator.py # Prisma / SQLAlchemy model renderers
│ ├── requirements.txt
│ └── test_service.py # pytest suite
│
├── frontend/ # Next.js App Router
│ └── src/
│ ├── app/
│ │ ├── page.tsx # Landing page
│ │ ├── layout.tsx # Root layout (Space Grotesk, IBM Plex Mono)
│ │ ├── globals.css # Tailwind theme + design tokens
│ │ ├── icon.svg # Favicon / brand mark
│ │ └── generator/page.tsx # Workspace (thin composition of components below)
│ ├── components/
│ │ ├── PromptForm.tsx # Prompt textarea, dialect select, presets
│ │ ├── TablesView.tsx # Sidebar + columns table + DDL/seed SQL panels
│ │ ├── SchemaDiagram.tsx # ER diagram with drawn FK connectors
│ │ ├── HistoryDrawer.tsx # Slide-in schema history (localStorage)
│ │ ├── ResultStates.tsx # Empty / loading / waking-up / error states
│ │ ├── SqlHighlight.tsx # Hand-rolled SQL syntax highlighter
│ │ ├── BrandMark.tsx # Logo glyph
│ │ └── WarmUpPing.tsx # Fire-and-forget health ping on mount
│ └── types/schema.ts # Shared TS types (Column, TableSchema, Dialect...)
│
├── .github/workflows/
│ ├── ci.yml # pytest + tsc + fallow on push/PR
│ └── keep-warm.yml # pings /api/health every 10 min
│
└── docs/screenshots/ # README images
- You type a schema description in natural language (e.g. "E-commerce store with orders, items, inventory and users") and pick a target SQL dialect
- The frontend sends it to
POST /api/generate - The backend calls Groq's
llama-3.3-70b-versatilemodel with strict JSON mode, enforcing the Pydantic schema — including foreign-key references, auto-increment flags, and realistic seed rows - The backend rejects malformed results (duplicate table/column names) before compiling the response
- Dialect-specific syntax (
SERIALvsAUTO_INCREMENTvsINTEGER PRIMARY KEY AUTOINCREMENT, etc.) is generated deterministically insql_generator.py— the LLM's output stays dialect-neutral, so getting the SQL right doesn't depend on the model getting dialect trivia right - The frontend renders columns in a metadata table, SQL in syntax-highlighted copyable/downloadable panels, and foreign keys as a live ER diagram with drawn connector lines
- Python 3.11+
- Node.js 20+
- A Groq API key
cd backend
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt
# Create .env with your API key
cp .env.example .env
# Edit .env: GROQ_API_KEY=your_key_here
uvicorn main:app --port 8000Run the test suite with pytest.
cd frontend
npm install
npm run devOpen http://localhost:3000 in your browser. The dev proxy in next.config.ts routes /api/* requests to the backend (BACKEND_URL env var, defaults to http://localhost:8000).
- Natural language to SQL — Describe your schema in plain English, get valid
CREATE TABLEandINSERTstatements - Multi-dialect compiler — Generate the same schema as PostgreSQL, MySQL, or SQLite; dialect-specific syntax is rendered deterministically, not left to the LLM
- ORM export — Optionally emit the same schema as a Prisma
schema.prismaor SQLAlchemy models file, with foreign keys rendered as proper bidirectional relations (including self-references and multiple FKs to one table) - Live ER diagram — Every generated schema renders as an entity-relationship diagram, with foreign keys drawn as connector lines between the referencing and referenced columns
- Pydantic-enforced output — The AI response is validated against a strict schema, with an additional guard rejecting duplicate table/column names before any SQL is generated
- Resilient to API hiccups — Transient Groq failures (rate limits, 5xx) are retried automatically with backoff
- Structured column viewer — Per-table breakdown of columns, types, and constraints, with foreign keys and primary keys visually tagged
- Syntax-highlighted SQL panels — Copy DDL or seed DML to clipboard, or download individual files or the whole schema as one
.sql - Schema history — A slide-in drawer stores up to 20 previous generations in local storage, with relative timestamps, table counts, and one-click restore
- 3 preset prompts — Quick-start buttons for common schema types (e-commerce, blog, project board)
- Honest cold-start UX — Hosted on free tiers; a dedicated "waking the server" state (not a spinner that just hangs) covers the first request after the backend has been idle
- Rate-limited API — IP-based limiting on
/api/generateprotects the shared Groq key from abuse


