Skip to content

Upload an SQL schema, enter a natural language prompt, and generate SQL queries using AI. Built with React (Vite), Node.js (Express), and Gemini AI. Fully containerized with Docker for seamless deployment. πŸš€

Notifications You must be signed in to change notification settings

hn2006/SQL-query-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ SQL Query Generator

An AI-powered SQL query generator that lets users upload an SQL schema and generate complex queries from natural language prompts. Designed with a sleek modern UI, dark/light mode, and a chat-like experience, powered by Gemini AI & Docker.


✨ Features

βœ… Upload SQL Schema – Drag & drop SQL schema for metadata extraction
βœ… AI-Powered Query Generation – Convert natural language into SQL queries
βœ… Real-time Query Execution – Validate AI-generated queries instantly
βœ… Chat-like UI – Interactive experience for seamless SQL generation
βœ… Dark & Light Mode – Beautiful modern UI with theme toggle
βœ… Fully Containerized – Deploy anywhere with Docker


πŸ“‚ Project Structure

sql-query-generator/
│── frontend/                     # React + Vite UI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/               # Static assets (icons, images)
β”‚   β”‚   β”œβ”€β”€ components/           # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatWindow.tsx    # Chat UI for prompts
β”‚   β”‚   β”‚   β”œβ”€β”€ FileUpload.tsx    # Drag & drop SQL file input
β”‚   β”‚   β”‚   β”œβ”€β”€ ThemeToggle.tsx   # Dark/light mode switch
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.tsx          # Main page
β”‚   β”‚   β”œβ”€β”€ App.tsx               # Entry point
β”‚   β”‚   β”œβ”€β”€ main.tsx              # React root
β”‚   β”‚   β”œβ”€β”€ styles.css            # Global styles
β”‚   β”œβ”€β”€ public/                   # Public assets
β”‚   β”œβ”€β”€ index.html                 # Main HTML file
β”‚   β”œβ”€β”€ vite.config.ts             # Vite configuration
β”‚   β”œβ”€β”€ package.json               # Dependencies
β”‚   β”œβ”€β”€ tsconfig.json              # TypeScript config
β”‚
│── backend/                      # Node.js + Express API
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ upload.ts              # File upload API
β”‚   β”‚   β”œβ”€β”€ query.ts               # SQL query generation API
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ queryController.ts     # Handles query generation
β”‚   β”‚   β”œβ”€β”€ uploadController.ts    # Handles file uploads
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ metadataExtractor.ts   # Parses SQL schema
β”‚   β”‚   β”œβ”€β”€ aiService.ts           # Connects to Claude/OpenAI
β”‚   β”œβ”€β”€ server.ts                  # Main Express server
β”‚   β”œβ”€β”€ package.json               # Dependencies
β”‚   β”œβ”€β”€ tsconfig.json              # TypeScript config
β”‚
│── docker/                        # Docker setup
β”‚   β”œβ”€β”€ frontend.Dockerfile        # Frontend container
β”‚   β”œβ”€β”€ backend.Dockerfile         # Backend container
β”‚   β”œβ”€β”€ docker-compose.yml         # Multi-container setup
β”‚
│── .gitignore                     # Ignored files
│── README.md                      # Project documentation

About

Upload an SQL schema, enter a natural language prompt, and generate SQL queries using AI. Built with React (Vite), Node.js (Express), and Gemini AI. Fully containerized with Docker for seamless deployment. πŸš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published