A web application that generates SQL queries from natural language using the Google Gemini API. The app provides an interface to write natural language prompts, generate SQL, and execute queries against a SQLite database.
- Convert natural language to SQL using Google's Gemini API
- Execute SQL queries against a SQLite in-memory database
- View formatted results in a table
- Sample database with tables for a library management system
- Fork or clone this repository to your GitHub account
- Go to Render and sign up or log in
- Click on "New +" and select "Web Service"
- Connect your GitHub repository
- Configure the service:
- Name:
sql-gemini-app
(or your preferred name) - Environment:
Node
- Build Command:
npm install
- Start Command:
npm start
- Name:
- Add the environment variable:
- GEMINI_API_KEY: Your Google Gemini API key
- Click "Create Web Service"
This repository includes a render.yaml
file that can be used with Render Blueprints:
- Fork or clone this repository to your GitHub account
- Go to Render and sign up or log in
- Create a new Blueprint
- Connect your GitHub repository
- Configure the environment variables:
- GEMINI_API_KEY: Your Google Gemini API key
- Deploy the Blueprint
If you encounter issues with your deployment:
- Check Gemini API Key: Ensure your
GEMINI_API_KEY
is correctly set in Render's environment variables - Check Application Logs: In the Render dashboard, navigate to your service's logs to see any error messages
- Health Endpoint: Visit the
/health
endpoint of your deployed app to check system status - See Detailed Guide: For more detailed troubleshooting steps, see TROUBLESHOOTING.md
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file with your GEMINI_API_KEY - Run the server:
npm run dev
- Open http://localhost:3000 in your browser
GEMINI_API_KEY
: Your Google Gemini API keyPORT
: Port to run the server on (defaults to 3000)
POST /api/execute-sql
: Execute SQL queriesPOST /api/generate-sql
: Generate SQL from natural languagePOST /api/delete-all-tables
: Delete all tables and reset the databaseGET /health
: Health check and diagnostic informationGET /api/debug
: Debug information (non-production environments only)
MIT