# SQLQueryBuilder-OpenAI
SQLQueryBuilder-OpenAI is a full-stack application built with React (frontend) and Node.js + Express (backend).
It leverages OpenAI's GPT API to dynamically generate SQL queries from natural language prompts.
This project demonstrates modern web development combined with AI-driven SQL query generation,
making it a great showcase for full-stack and AI integration skills.
---
## Features
- User-friendly React frontend to input natural language query requests.
- Express backend API to handle requests and communicate with OpenAI’s GPT API.
- Dynamically generates optimized SQL queries based on user input.
- Ready for deployment on platforms like Vercel (frontend) and Render (backend).
- Environment variables support for API keys and backend URLs.
---
## Tech Stack
- React.js
- Node.js + Express.js
- OpenAI GPT API
- SQL query generation
---
## Getting Started
### Prerequisites
- Node.js installed
- OpenAI API key (sign up at [OpenAI](https://openai.com))
### Installation
1. Clone the repo:
```bash
git clone https://github.com/yourusername/SQLQueryBuilder-OpenAI.git
- Navigate to the server folder and install dependencies:
cd SQLQueryBuilder-OpenAI/server
npm install
- Create a
.env
file insideserver
folder and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
- Navigate to the client folder and install dependencies:
cd ../client
npm install
- Start the development servers:
- In one terminal, run the backend:
cd server
npm start
- In another terminal, run the frontend:
cd client
npm start
- Open your browser at like :
http://localhost:5173
Make sure to update your frontend API calls to use your backend’s deployed URL.
OPENAI_API_KEY
- Your OpenAI API keyREACT_APP_API_URL
- Backend API base URL (used in frontend)
Created by Jelonmusk — feel free to reach out for questions or collaborations!