A modern web application that allows you to chat with your PostgreSQL database using natural language. Ask questions about your data in plain English, and get instant responses with the relevant data and the underlying SQL queries.
- 🗣️ Natural language interface to your database
- 🔍 View the generated SQL queries
- 📊 Beautiful data presentation
- 💫 Modern, responsive UI
- 🔒 Secure database connection
- Python 3.8+
- Node.js 14+
- PostgreSQL database
- OpenAI API key
-
Clone the repository
-
Set up the backend:
cd backend python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate pip install -r requirements.txt
-
Set up the frontend:
cd frontend npm install -
Create a
.envfile in the root directory with your configuration:DATABASE_URL=postgresql://username:password@localhost:5432/database_name OPENAI_API_KEY=your_openai_api_key_here
-
Start the backend:
cd backend uvicorn main:app --reload -
Start the frontend (in a new terminal):
cd frontend npm start -
Open your browser and navigate to
http://localhost:3000
- Type your question in natural language in the chat input
- The application will generate and execute the appropriate SQL query
- View the results in a clean, tabular format
- Click the "Show SQL" button to see the generated query
- Never commit your
.envfile - Ensure your database connection is secure
- Consider implementing authentication for production use