Alona

SQL Learning Platform for Shopify Integration

๐ŸŽฏ Project Overview

A comprehensive, AI-powered SQL learning platform designed for seamless integration with Shopify stores. This interactive educational tool enables customers to learn SQL through hands-on practice with real database queries, progressive skill development, and personalized learning experiences.

๐Ÿš€ Vision Statement

Transform SQL education by providing an accessible, interactive learning environment that combines real database practice with intelligent tutoring, seamlessly integrated into e-commerce platforms.


๐Ÿ“‹ MVP Development Workflow

This project is structured into six core MVP components, each addressing critical aspects of the learning platform:

MVP Component 1: SQL Runtime Integration โœ… COMPLETED

The foundational component providing secure, real-time SQL query execution through Supabase integration.

Key Features:

MVP Component 2: Content Preparation & Question Bank ๐ŸŸก IN PROGRESS

Structured learning content with progressive difficulty levels and comprehensive educational materials.

Key Features:

MVP Component 3: UI Development & Shopify Frontend ๐Ÿ”„ PARTIALLY IMPLEMENTED

User-friendly interface optimized for Shopify integration with responsive design and seamless UX.

Key Features:

MVP Component 4: User Progress & Feedback System ๐Ÿ“‹ PLANNED

Comprehensive progress tracking, performance analytics, and personalized feedback mechanisms.

Key Features:

MVP Component 5: AI-Driven Evaluation & Assistance ๐Ÿ”ฎ FUTURE PLANNING

AI-powered intelligent tutoring, query evaluation, and personalized learning assistance.

Key Features:

MVP Component 6: User Authentication & Payment Integration ๐Ÿ’ฐ FUTURE PLANNING

Seamless integration with Shopifyโ€™s authentication and payment systems for monetization and user management.

Key Features:


๐Ÿ—๏ธ Technical Architecture

Backend Infrastructure

Frontend Technology

Integration Strategy


๐ŸŽ“ Learning Experience Design

Skill Progression Path

  1. Foundation: Basic SELECT, WHERE, ORDER BY
  2. Data Relationships: JOINs, foreign keys, table relationships
  3. Aggregation: GROUP BY, HAVING, COUNT, SUM, AVG
  4. Advanced Queries: Subqueries, window functions, CTEs
  5. Optimization: Indexes, query performance, best practices

Interactive Features


๐Ÿ“ Project Structure

sql_practice/
โ”œโ”€โ”€ ๐Ÿ“ src/                          # Source code
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ frontend/                 # Frontend application
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ html/                 # HTML templates
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ index.html           # Landing page with redirect
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ sql_editor.html      # Main SQL editor interface
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ css/                  # Stylesheets
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ style.css            # Main application styles
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ js/                   # JavaScript modules
โ”‚   โ”‚       โ”œโ”€โ”€ config.js            # Application configuration
โ”‚   โ”‚       โ”œโ”€โ”€ database-manager.js  # Supabase integration
โ”‚   โ”‚       โ”œโ”€โ”€ question-manager.js  # Question bank management
โ”‚   โ”‚       โ”œโ”€โ”€ ui-manager.js        # User interface controller
โ”‚   โ”‚       โ””โ”€โ”€ app.js               # Main application coordinator
โ”‚   โ””โ”€โ”€ ๐Ÿ“ database/                 # Database schema and functions
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ schema/               # Table definitions
โ”‚       โ”‚   โ””โ”€โ”€ create_tables_public.sql # Sample tables setup
โ”‚       โ””โ”€โ”€ ๐Ÿ“ functions/            # Stored procedures
โ”‚           โ”œโ”€โ”€ run_sql_query.sql    # Safe query execution function
โ”‚           โ””โ”€โ”€ fix_function_naming.sql # Function permissions setup
โ”œโ”€โ”€ ๐Ÿ“ docs/                         # Documentation
โ”‚   โ””โ”€โ”€ ๐Ÿ“ mvp-components/           # MVP documentation
โ”‚       โ”œโ”€โ”€ MVP_01_SQL_Runtime_Integration.md
โ”‚       โ”œโ”€โ”€ MVP_02_Content_Preparation.md
โ”‚       โ”œโ”€โ”€ MVP_03_UI_Development.md
โ”‚       โ”œโ”€โ”€ MVP_04_User_Progress_Feedback.md
โ”‚       โ”œโ”€โ”€ MVP_05_AI_Driven_Evaluation.md
โ”‚       โ””โ”€โ”€ MVP_06_Authentication_Payment.md
โ”œโ”€โ”€ ๐Ÿ“ config/                       # Configuration files
โ”‚   โ””โ”€โ”€ .env.example                 # Environment variables template
โ”œโ”€โ”€ ๐Ÿ“ tests/                        # Test suite
โ”‚   โ””โ”€โ”€ README.md                    # Testing documentation
โ”œโ”€โ”€ ๐Ÿ“ scripts/                      # Build and deployment scripts
โ”‚   โ””โ”€โ”€ README.md                    # Scripts documentation
โ”œโ”€โ”€ ๐Ÿ“ assets/                       # Static assets (images, icons)
โ”œโ”€โ”€ ๐Ÿ“ .gitignore                    # Git ignore patterns
โ”œโ”€โ”€ ๐Ÿ“ฆ package.json                  # Node.js dependencies and scripts
โ””โ”€โ”€ ๐Ÿ“– README.md                     # Project overview (this file)

๐Ÿ”ง Modular Architecture

The project is now organized into clear, maintainable modules:

Frontend Modules

Database Organization

Documentation Structure


๐Ÿšฆ Current Status & Next Steps

โœ… Completed Milestones

๐Ÿ”„ In Progress

๐Ÿ“‹ Upcoming Priorities

๐Ÿ”ฎ Future Roadmap


๐Ÿ› ๏ธ Development Setup

Prerequisites

Quick Start

  1. Clone Repository: git clone [repository-url]
  2. Database Setup: Execute SQL files in Supabase SQL Editor
    • Run create_tables_public.sql for sample data
    • Run run_sql_query.sql for query execution function
    • Run fix_function_naming.sql for permissions
  3. Configuration: Update Supabase URL and API key in sql_editor.html
  4. Local Testing: Start HTTP server and navigate to index.html
  5. Shopify Integration: Follow guidelines in MVP_03_UI_Development.md

Environment Configuration

// Update these values in sql_editor.html
const supabaseUrl = 'YOUR_SUPABASE_PROJECT_URL';
const supabaseKey = 'YOUR_SUPABASE_ANON_KEY';

๐ŸŽฏ Success Metrics & KPIs

Learning Effectiveness

User Engagement

Technical Performance

Business Impact


๐Ÿค Contributing & Support

Development Contribution

  1. Review MVP component documentation for implementation details
  2. Follow established coding standards and best practices
  3. Test thoroughly across browsers and devices
  4. Update documentation for new features and changes

Content Contribution

Community Support


Open Source Licensing

This project is released under MIT License, allowing for commercial use, modification, and distribution with proper attribution.

Privacy & Data Protection

Educational Use


๐Ÿ“ž Contact & Support: For technical support, feature requests, or partnership inquiries, please use the GitHub Issues system or contact the development team directly.

๐ŸŒŸ Star this repository if you find it useful for your SQL learning or Shopify integration projects!

  1. Visit supabase.com and sign up for an account
  2. Verify your email address

Step 2: Create a New Project

  1. Click โ€œNew projectโ€ in the Supabase dashboard
  2. Enter project details:
    • Name: โ€œSQL Tutorial Sandboxโ€
    • Database Password: Create a strong password
    • Region: Choose one closest to your users
    • Pricing Plan: Free tier is sufficient for MVP
  3. Click โ€œCreate new projectโ€ and wait for setup (2-3 minutes)

Step 3: Create Sample Databases

  1. Go to the SQL Editor in your Supabase dashboard
  2. Create tables for your SQL tutorial:

โ€“ Create SCHEMA practice โ€“ Create basic tables for practice: dim_customers, fact_orders

  1. Run the script to set up your sample database

Step 4: Create a Secure API Key

  1. Go to โ€œSettingsโ€ โ†’ โ€œAPIโ€ in your Supabase dashboard
  2. Under โ€œProject API keysโ€, copy your anon public key
  3. Create a service role key with limited permissions (optional but recommended for security)

Part 2: Creating the SQL Playground Interface

Step 5: Create a Custom SQL Editor Page

โ€“ Create index.html to redirect to sql_editor.html โ€“ Create sql_editor.html

Step 6: Add Stored Procedure for Safe SQL Execution

Create a safe execution environment for user SQL queries:

  1. Go to SQL Editor in Supabase
  2. Create this stored procedure:

โ€“ Execute the query create_sql_executor.sql to create a function to safely execute SQL queries

Part 3: Embedding in Shopify

Step 7: Prepare Your Shopify Store

  1. Log in to your Shopify admin panel
  2. Go to โ€œOnline Storeโ€ โ†’ โ€œThemesโ€
  3. Find your active theme and click โ€œCustomizeโ€

Step 8: Create a New Page

  1. Go to โ€œPagesโ€ โ†’ โ€œAdd pageโ€
  2. Name it โ€œSQL Practiceโ€ or similar
  3. Switch to HTML editor mode

Step 9: Embed the SQL Editor

โ€“ Upload the HTML file to a web hosting service or GitHub Pages โ€“ Embed it in your Shopify page

Step 10: Add Custom Theme Code (Optional for Better Integration)

  1. Go to โ€œThemeโ€ โ†’ โ€œEdit codeโ€
  2. Add this snippet to your theme.liquid or appropriate section:

```liquid name=custom-sql-page-style.liquid

```

Step 11: Configure CORS for Supabase

  1. In Supabase Dashboard, go to โ€œSettingsโ€ โ†’ โ€œAPIโ€
  2. Add your Shopify domain to the allowed domains list:
    • Format: https://your-store.myshopify.com
  3. Save changes

Part 4: Final Setup and Testing

Step 12: Add Question Database

  1. Create a table in Supabase for storing questions
  2. Add more questions as needed

Step 13: Test the Integration

  1. View your SQL Practice page on your Shopify store
  2. Try running a simple query: SELECT * FROM customers;
  3. Test question selection and hints
  4. Ensure error messages are user-friendly

Step 14: Monitor and Adjust

  1. Set up rate limiting in Supabase to prevent abuse
  2. Monitor database performance

  3. Collect user feedback using a simple form

Troubleshooting Common Issues


Additional Tips