A modern, browser-based SQL playground with AI-powered assistance for learning, analyzing, and optimizing databases.
- In-Browser SQLite: Full SQLite database in your browser using WebAssembly
- Monaco Editor: Professional code editor with SQL syntax highlighting
- Real-time Results: Execute queries and see results instantly
- Multi-database Support: Create and manage multiple databases
- Data Visualization: Interactive tables with sorting, filtering, and pagination
- Dual-Mode AI: Ask mode for learning, Agentic mode for analysis
- Smart Query Generation: Context-aware SQL query creation
- Real Database Analysis: AI can read and analyze your actual data
- Performance Insights: Optimization recommendations and best practices
- One-Click Integration: Insert AI-generated queries directly into editor
- Authentication: Secure user sessions with NextAuth.js
- Responsive Design: Works perfectly on desktop and mobile
- Dark/Light Themes: Multiple editor themes to choose from
- Export/Import: Save and load your databases
- Sample Data: Pre-built sample databases for testing
- Node.js 18+ and npm
- Google AI Studio API key (for AI features)
- Clone the repository
git clone https://github.com/maasir554/sequatic.git
cd sequatic- Install dependencies
npm install- Set up environment variables
cp .env.local.example .env.local
# Edit .env.local and add your API keys- Required Environment Variables
# Google AI (Gemini) API Configuration
GOOGLE_AI_API_KEY="your_gemini_api_key_here"
NEXT_PUBLIC_GOOGLE_AI_API_KEY="your_gemini_api_key_here"
# NextAuth Configuration
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your_nextauth_secret_here"
# Database Configuration (if using MongoDB for user data)
DATABASE_URL="your_mongodb_connection_string"- Start the development server
npm run dev- Open in browser Visit http://localhost:3000
-
Get Gemini API Key
- Visit Google AI Studio
- Create a new API key
- Add it to your
.env.localfile
-
Test AI Features
- Load the sample database (
sample-database.sql) - Try asking questions in both Ask and Agentic modes
- Use the "Insert Query" button to add AI-generated queries
- Load the sample database (
For detailed AI setup instructions, see AI_INTEGRATION_GUIDE.md
Load the included sample database to test AI features:
-- Contains realistic e-commerce data:
-- - users table (customer information)
-- - products table (inventory data)
-- - orders table (transaction records)Use the file sample-database.sql in your SQL playground.
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Modern React component library
- Monaco Editor - VS Code editor in the browser
- SQL.js - SQLite compiled to WebAssembly
- IndexedDB - Browser storage for persistence
- Google Gemini AI - Advanced AI assistant
- React Table - Powerful data grid component
- NextAuth.js - Authentication solution
- MongoDB - User data storage (optional)
- API Routes - Serverless backend functions
sequatic/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ ├── playground/ # SQL playground page
│ └── ...
├── components/ # React components
│ ├── sql-playground/ # Playground-specific components
│ ├── ui/ # Reusable UI components
│ └── ...
├── lib/ # Utility libraries
│ ├── ai-service.ts # AI integration
│ ├── sqlite.ts # SQLite manager
│ └── ...
├── prisma/ # Database schema
├── public/ # Static assets
└── types/ # TypeScript definitions
"How do I join two tables?"
"Generate a query to find users who made orders in the last 30 days"
"What's the difference between INNER JOIN and LEFT JOIN?"
"Analyze the users table and give me insights"
"What are the sales trends in my orders data?"
"Find patterns in product categories and sales"
"Suggest database optimizations"
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- SQL.js for SQLite in the browser
- Google AI for Gemini AI integration
- shadcn/ui for beautiful components
- Monaco Editor for the code editor
Built with ❤️ for SQL enthusiasts and data analysts