AI/ML powered application that converts natural language text to SQL queries.
Welcome to Text to SQL Converter
Convert natural language to SQL queries with ease
Real-time SQL generation and execution
Watch the Text to SQL converter in action
- Frontend: React
- Backend: FastAPI
- Database: MySQL, PostgreSQL & SQLite (user-provided)
- AI/ML: Natural language processing for SQL generation
- Model: mradermacher/natural-sql-7b-i1-GGUF
- Convert plain English to SQL queries
- Real-time query generation
- Clean, intuitive interface
- Multi-database support
- One-click sample database loading
# Start development environment
docker-compose up --build# Run deployment script (recommended)
./deploy.sh
# Or use make commands
make prod # Docker deployment
make pm2-start # PM2 deploymentAccess the application at http://localhost:3000
Advantages: Isolated environment, easy scaling
# Production
make prod
# View logs
make logs
# Stop services
make stopAccess:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3000/api (via Nginx proxy)
- Database: Connect to your own PostgreSQL/MySQL/SQLite database
Advantages: Process management, auto-restart, load balancing
# Prerequisites
npm install -g pm2 serve pnpm
# Deploy
make pm2-start
# Manage
pm2 logs
pm2 status# Backend
cd backend
pip install -r requirements.txt
python install_llama.py
# Frontend
cd frontend
pnpm install
pnpm build
# Start services
cd backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 &
cd frontend && serve -s dist -l 3000 &# Backend
ENV=production
PYTHONPATH=/app
# Database (if external)
DATABASE_URL=postgresql://user:pass@host:5432/dbnameThe application supports multiple database types:
- Sample Database: Click "Load Sample Database" for instant demo with e-commerce data
- PostgreSQL: Create a database and user with appropriate permissions
- MySQL: Create a database and user with appropriate permissions
- SQLite: Upload your own .db file through the interface
Example PostgreSQL setup:
CREATE DATABASE textosql;
CREATE USER texttosql WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE texttosql TO texttosql;# View logs
docker-compose -f docker-compose.prod.yml logs -f
# Check status
docker-compose -f docker-compose.prod.yml ps# View logs
pm2 logs
# Monitor
pm2 monitCommon Issues:
- Port conflicts: Change ports in docker-compose.prod.yml
- Memory issues: Increase Docker memory limits
- Model loading: Ensure sufficient disk space (4GB+ for AI model)
Health Checks:
# Frontend
curl http://localhost:3000
# Backend API
curl http://localhost:3000/api/healthThe application supports multiple database types:
- Connect via credentials (PostgreSQL/MySQL)
- Upload SQLite files
- Real-time schema detection and query generation
- Frontend: React app with Nginx (port 3000)
- Backend: FastAPI on internal Docker network
- Database: User-provided (PostgreSQL/MySQL/SQLite)
- AI Model: 4GB cached in persistent volume
- Security: Backend only accessible via proxy


