A powerful web application that generates natural language SQL test questions using AI, with global statistics tracking and fallback predefined questions.
- π€ AI-Powered Generation: Uses Groq API to generate contextual SQL questions
- π Three Difficulty Levels: Basic, Intermediate, and Advanced questions
- π Schema Upload: Upload CSV/JSON files for context-aware question generation
- π Smart Fallback: 60+ predefined questions when AI is unavailable
- π Global Statistics: Real-time tracking across all users worldwide
- π Feedback System: Rate questions with thumbs up/down
- π± Responsive Design: Works perfectly on desktop and mobile
- π Secure: API keys protected on server-side
- β‘ Fast: Deployed on Vercel with global CDN
# Clone the repository
git clone <your-repo-url>
cd sql-testcases-generator
# Install Vercel CLI
npm install -g vercel
# Set up environment variable
echo "GROQ_API_KEY=your_api_key_here" > .env
# Start development server
vercel dev
# Deploy to Vercel
vercel --prod
# Set environment variable in Vercel dashboard
# GROQ_API_KEY = your_api_key_here
- Select Difficulty: Choose Basic, Intermediate, or Advanced
- Upload Schema (Optional): Upload CSV/JSON for context
- Set Quantity: Choose 1-10 questions
- Generate: Click generate to create questions
- Copy & Use: Copy individual questions or all at once
- Provide Feedback: Rate the quality with thumbs up/down
- Pure JavaScript: No frameworks, fast loading
- Responsive CSS: Modern, clean interface
- Local Storage: Persistent user identification
- API Proxy: Secure Groq API integration
- Global Stats: File-based statistics storage
- CORS Enabled: Cross-origin request support
- Smart Fallback: 20 questions per difficulty level
- Global Tracking: Real-time user statistics
- Admin Controls: Passcode-protected stats clearing
- Simple SELECT queries
- Basic filtering and counting
- Single table operations
- JOINs and GROUP BY
- Subqueries and aggregations
- Multi-table scenarios
- Window functions and CTEs
- Complex analytics
- Performance optimization scenarios
GROQ_API_KEY=your_groq_api_key_here
GET /api/stats
- Get global statisticsPOST /api/stats
- Update statisticsPOST /api/groq
- Groq API proxy
The app tracks:
- Total Questions Generated across all users
- Positive Feedback (thumbs up)
- Negative Feedback (thumbs down)
- Total Users who have used the app
- β API keys never exposed to frontend
- β Serverless functions for secure API calls
- β User privacy with anonymous IDs
- β Admin controls with passcode protection
After deployment, your app will be available at:
https://your-app-name.vercel.app
MIT License - feel free to use and modify!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
For issues or questions, please create an issue in the repository.
Built with β€οΈ using Groq AI, Vercel, and modern web technologies