An open API service indexing awesome lists of open source software.

https://github.com/jelonmusk/sqlquerybuilder-openai

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.
https://github.com/jelonmusk/sqlquerybuilder-openai

chatgpt express expressjs nodejs openai openai-api react reactjs sql vitejs

Last synced: 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

👾 [Try the SQL Query Builder](https://sql-query-builder-open-ai.vercel.app/) 👾

![image](https://drive.google.com/uc?export=view&id=1-zPKrgfMP1JbwGCOnwwfUGRLtcTAUrCW)

````markdown
# 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
````

2. Navigate to the server folder and install dependencies:

```bash
cd SQLQueryBuilder-OpenAI/server
npm install
```

3. Create a `.env` file inside `server` folder and add your OpenAI API key:

```env
OPENAI_API_KEY=your_openai_api_key_here
```

4. Navigate to the client folder and install dependencies:

```bash
cd ../client
npm install
```

5. Start the development servers:

* In one terminal, run the backend:

```bash
cd server
npm start
```

* In another terminal, run the frontend:

```bash
cd client
npm start
```

6. Open your browser at like : `http://localhost:5173`

---

## Deployment

* Backend can be deployed on platforms like [Render](https://render.com)
* Frontend can be deployed on platforms like [Vercel](https://vercel.com)

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!