{"id":29482236,"url":"https://github.com/tsembp/sql-gym","last_synced_at":"2026-04-09T12:04:57.360Z","repository":{"id":303558181,"uuid":"1002879722","full_name":"tsembp/SQL-Gym","owner":"tsembp","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-08T08:43:32.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-08T08:43:36.619Z","etag":null,"topics":["fastapi","react","sqlalchemy","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsembp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-16T09:32:24.000Z","updated_at":"2025-07-08T08:43:36.000Z","dependencies_parsed_at":"2025-07-08T08:53:44.636Z","dependency_job_id":null,"html_url":"https://github.com/tsembp/SQL-Gym","commit_stats":null,"previous_names":["tsembp/sql-gym"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsembp/SQL-Gym","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsembp%2FSQL-Gym","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsembp%2FSQL-Gym/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsembp%2FSQL-Gym/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsembp%2FSQL-Gym/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsembp","download_url":"https://codeload.github.com/tsembp/SQL-Gym/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsembp%2FSQL-Gym/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265385759,"owners_count":23756728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","react","sqlalchemy","tailwindcss","typescript"],"created_at":"2025-07-15T01:31:47.485Z","updated_at":"2025-09-25T22:21:21.015Z","avatar_url":"https://github.com/tsembp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏋️ SQLGym\n\n**SQLGym** is an interactive SQL challenge platform designed to help users practice SQL using realistic, fintech-style datasets — all in a clean local-first setup.\n\nBuilt with a Python + FastAPI backend and a React + Tailwind frontend, SQLGym evaluates SQL queries safely and gives instant feedback using mock financial data (users, transactions, refunds, subscriptions).\n\n\n## ✨ Features\n\n- 🧠 15 realistic SQL challenges (from `BASIC` to `HARD`)\n- 🔐 Secure backend with safe SQL evaluation (no DDL/DML)\n- 🧾 Realistic mock financial datasets generated with `Faker`\n- 💡 Frontend with challenge prompts, schema previews, and Monaco-based SQL editor\n- ✅ Query correctness feedback with result previews\n- ⚡ Local SQLite support for rapid development\n\n\n// ...existing code...\n\n## 📸 Preview\n\n| Home Page                                     | Filtered View                                  |\n|-----------------------------------------------|------------------------------------------------|\n| ![Home](./screenshots/home-page.png)          | ![Challenge](./screenshots/home-page-filtered.png) |\n\n| Challenge Page                                | Correct Solution                               |\n|-----------------------------------------------|------------------------------------------------|\n| ![Correct](./screenshots/challenge-preview.png) | ![Incorrect](./screenshots/challenge-preview-correct.png) |\n\n| Incorrect Solution                      | SQL Injection Protection                                 |\n|-----------------------------------------------|------------------------------------------------|\n| ![SQLi](./screenshots/challenge-preview-incorrect.png) | ![Filtered](./screenshots/challenge-preview-sqli.png) |\n\n\n## 🚀 Getting Started\n\n### 1. Clone and setup environment\n\n```bash\ngit clone https://github.com/tsembp/SQL-Gym.git\ncd SQL-Gym\npython -m venv venv\nsource venv/bin/activate  # or venv\\Scripts\\activate on Windows\npip install -r requirements.txt\n````\n\n### 2. Generate mock DB\n\n```bash\npython backend/db/db_seeder.py\n```\n\n### 3. Start backend\n\n```bash\ncd backend\nuvicorn main:app --reload\n```\n\n### 4. Setup frontend\n\n```bash\ncd frontend/tailwindcss4\nnpm install\nnpm run dev\n```\n\n\n## 🗂️ Project Structure\n\n```\nsqlgym/\n├── backend/\n│   ├── main.py                 # FastAPI app\n│   ├── challenge_definitions   # Challenges JSON\n│   ├── db/\n│   │   ├── db_seeder.py        # SQLite + Faker mock data\n│   │   ├── models.py           # SQLAlchemy models\n|   |   └── sqlgym.db           # Generated DB (gitignored)\n├── frontend/\n│   └── src/\n│       ├── pages/\n│       ├── api/\n|       ...\n```\n\n\n## 🛠️ Tech Stack\n\n* **Backend**: Python, FastAPI, SQLAlchemy, SQLite\n* **Frontend**: React, TypeScript, Tailwind CSS, Vite\n* **Editor**: Monaco Editor\n* **Data**: Faker, Pandas\n\n\n## 📈 Future Ideas\n\n* 🤖 GPT-powered SQL hints\n* 💬 AI assistant for each challenge\n* 📊 Leaderboard or progress tracking\n\n\n## 📄 License\n\nMIT License © 2025 \\[Panagiotis Tsembekis]","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsembp%2Fsql-gym","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsembp%2Fsql-gym","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsembp%2Fsql-gym/lists"}