Skip to content

A full-stack application built with React and Node.js that leverages OpenAI’s API to dynamically generate optimized SQL queries based on natural language prompts.

Notifications You must be signed in to change notification settings

jelonmusk/SQLQueryBuilder-OpenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👾 Try the SQL Query Builder 👾

image

# 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
  1. Navigate to the server folder and install dependencies:
cd SQLQueryBuilder-OpenAI/server
npm install
  1. Create a .env file inside server folder and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
  1. Navigate to the client folder and install dependencies:
cd ../client
npm install
  1. Start the development servers:
  • In one terminal, run the backend:
cd server
npm start
  • In another terminal, run the frontend:
cd client
npm start
  1. Open your browser at like : http://localhost:5173

Deployment

  • Backend can be deployed on platforms like Render
  • Frontend can be deployed on platforms like Vercel

Make sure to update your frontend API calls to use your backend’s deployed URL.


Environment Variables

  • OPENAI_API_KEY - Your OpenAI API key
  • REACT_APP_API_URL - Backend API base URL (used in frontend)

License


Contact

Created by Jelonmusk — feel free to reach out for questions or collaborations!

About

A full-stack application built with React and Node.js that leverages OpenAI’s API to dynamically generate optimized SQL queries based on natural language prompts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published