- Python 3.8+
- Node.js 16+
- OpenRouter API key (get from https://openrouter.ai/)
- Navigate to backend directory:
cd backend- Create virtual environment:
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac- Install dependencies:
pip install -r requirements.txt- Create .env file:
copy .env.example .envThen edit .env and add your OpenRouter API key:
OPENROUTER_API_KEY=your_actual_api_key_here
OPENROUTER_MODEL=meta-llama/llama-3.3-8b-instruct:free
GEMINI_API_KEY=your_gemini_api_key_here
DATABASE_URL=sqlite:///./sql_learning.db
- Initialize database:
python -c "from app.database import init_db; init_db()"- Start backend server:
uvicorn app.main:app --reloadBackend will run on http://localhost:8000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start development server:
npm run devFrontend will run on http://localhost:3000
- Comprehensive SQL reference with syntax and examples
- Search and filter by category (DDL, DML, Constraints, etc.)
- Copy-to-clipboard functionality
- Syntax highlighting
- 6 structured learning modules:
- Data Definition and Data Manipulation Language
- Constraints
- Single Row Functions
- Operators and Group Functions
- Sub Query, Views and Joins
- High Level Language Extensions
- Adaptive difficulty (easy β medium β hard)
- AI-powered evaluation and feedback
- Progress tracking per module
- Overall performance metrics
- Progress charts and visualizations
- Module-wise performance breakdown
- Personalized learning recommendations
- Recent attempts history
- Strengths and improvement areas
Backend API is available at http://localhost:8000/docs (Swagger UI)
Key endpoints:
GET /api/cheatsheet- Get cheat sheet entriesGET /api/modules- Get learning modulesPOST /api/practice/submit- Submit SQL answer for evaluationGET /api/analysis/{user_id}- Get user analytics
- Start β Landing page shows SQL cheat sheet
- Practice β Select a learning module
- Question β AI generates questions based on difficulty
- Submit β User enters SQL query
- Feedback β AI evaluates and provides detailed feedback
- Adapt β System adjusts difficulty based on performance
- Progress β Track improvement in Analysis section
- Frontend: React 18, Vite, Tailwind CSS, React Router
- Backend: FastAPI, SQLite, Pydantic
- AI: OpenRouter API (GPT-3.5-turbo)
- Charts: Recharts
- Syntax: React Syntax Highlighter
- No authentication required for MVP
- Simple user ID system (
user_123) for demo - Questions generated dynamically by AI
- Adaptive difficulty based on recent performance
- Comprehensive progress tracking and analytics