|
| 1 | + |
| 2 | +````markdown |
| 3 | +# SQLQueryBuilder-OpenAI |
| 4 | + |
| 5 | +SQLQueryBuilder-OpenAI is a full-stack application built with React (frontend) and Node.js + Express (backend). |
| 6 | +It leverages OpenAI's GPT API to dynamically generate SQL queries from natural language prompts. |
| 7 | + |
| 8 | +This project demonstrates modern web development combined with AI-driven SQL query generation, |
| 9 | +making it a great showcase for full-stack and AI integration skills. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Features |
| 14 | + |
| 15 | +- User-friendly React frontend to input natural language query requests. |
| 16 | +- Express backend API to handle requests and communicate with OpenAI’s GPT API. |
| 17 | +- Dynamically generates optimized SQL queries based on user input. |
| 18 | +- Ready for deployment on platforms like Vercel (frontend) and Render (backend). |
| 19 | +- Environment variables support for API keys and backend URLs. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Tech Stack |
| 24 | + |
| 25 | +- React.js |
| 26 | +- Node.js + Express.js |
| 27 | +- OpenAI GPT API |
| 28 | +- SQL query generation |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Getting Started |
| 33 | + |
| 34 | +### Prerequisites |
| 35 | + |
| 36 | +- Node.js installed |
| 37 | +- OpenAI API key (sign up at [OpenAI](https://openai.com)) |
| 38 | + |
| 39 | +### Installation |
| 40 | + |
| 41 | +1. Clone the repo: |
| 42 | + |
| 43 | +```bash |
| 44 | +git clone https://github.com/yourusername/SQLQueryBuilder-OpenAI.git |
| 45 | +```` |
| 46 | + |
| 47 | +2. Navigate to the server folder and install dependencies: |
| 48 | + |
| 49 | +```bash |
| 50 | +cd SQLQueryBuilder-OpenAI/server |
| 51 | +npm install |
| 52 | +``` |
| 53 | + |
| 54 | +3. Create a `.env` file inside `server` folder and add your OpenAI API key: |
| 55 | + |
| 56 | +```env |
| 57 | +OPENAI_API_KEY=your_openai_api_key_here |
| 58 | +``` |
| 59 | + |
| 60 | +4. Navigate to the client folder and install dependencies: |
| 61 | + |
| 62 | +```bash |
| 63 | +cd ../client |
| 64 | +npm install |
| 65 | +``` |
| 66 | + |
| 67 | +5. Start the development servers: |
| 68 | + |
| 69 | +* In one terminal, run the backend: |
| 70 | + |
| 71 | +```bash |
| 72 | +cd server |
| 73 | +npm start |
| 74 | +``` |
| 75 | + |
| 76 | +* In another terminal, run the frontend: |
| 77 | + |
| 78 | +```bash |
| 79 | +cd client |
| 80 | +npm start |
| 81 | +``` |
| 82 | + |
| 83 | +6. Open your browser at like : `http://localhost:5173` |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## Deployment |
| 88 | + |
| 89 | +* Backend can be deployed on platforms like [Render](https://render.com) |
| 90 | +* Frontend can be deployed on platforms like [Vercel](https://vercel.com) |
| 91 | + |
| 92 | +Make sure to update your frontend API calls to use your backend’s deployed URL. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Environment Variables |
| 97 | + |
| 98 | +* `OPENAI_API_KEY` - Your OpenAI API key |
| 99 | +* `REACT_APP_API_URL` - Backend API base URL (used in frontend) |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## License |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Contact |
| 110 | + |
| 111 | +Created by Jelonmusk — feel free to reach out for questions or collaborations! |
| 112 | + |
0 commit comments