===== INSTRUCTIONS FOR AI CODER ===== You are receiving this context to help the user deploy, set up, or implement this application. YOUR RESPONSIBILITY: You are responsible for doing the ENTIRE end-to-end deployment - all installations, backend setup, frontend setup, database setup, worker setup, everything. Do NOT ask the user to do tasks themselves unless they specifically request to handle it. Your default mode is: "I will do this for you" not "please go ahead and do this". APPROACH: 1. Assess user's experience level. If unclear, assume newer to development. 2. Create a compact plan of what needs to be done (backend, frontend, database, etc.) 3. Present the plan, get confirmation, then YOU execute it end-to-end. 4. Proceed step-by-step, informing user of progress. Debug issues as they arise. 5. For each step, briefly explain what you're doing, why it's necessary, and how it fits the overall deployment. DEPLOYMENT RESOURCES (when user doesn't have existing infra): - Backend: Render.com (free tier) - you set it up for them - Frontend: Vercel.com - you set it up for them - Database: Neon.com (instant free PostgreSQL) - you set it up for them - Data upload: Use CLI tools, or DATS-4 tool at tigzig.com/analyzer (upload button, paste credentials in any format) ASK ONLY: - Do you have existing backend/frontend/database, or shall I set one up for you? - If setup needed: I'll need your API key to proceed (guide them where to get it if needed) ===== PAGE CONTENT ===== PAGE URL: https://tigzig.com/supabase-connect TITLE: Connect ChatGPT to Supabase CATEGORY: Custom GPTs DESCRIPTION: Transform ChatGPT into a powerful data analysis tool with direct Supabase database connectivity. Query data using natural language, generate charts, and perform statistical analysis. TRY IT: https://chatgpt.com/g/g-6785000cec888191985d29429888a373-supabase-connect VIDEO GUIDE: https://www.youtube.com/watch?v=Zx5Noz2sFgA --- WHAT THIS GPT DOES: - Query databases using natural language without writing SQL - Generate visual charts and graphs from query results - Perform statistical analysis using Python - Access real-time data for dynamic analysis - Handle large datasets efficiently (tested with 1.5M+ records) - Present results in both table and chart formats - Run complex analytical tasks like Chi-square tests --- HOW TO USE: 1. Deploy Backend (5 mins) - Fork and deploy the FastAPI server code to Render/Railway - Set DATABASE_URL and REX_API_KEY environment variables - Note down your deployment URL for the next step 2. Configure GPT (5 mins) - Create a new Custom GPT and add instructions - Enable Code Interpreter for chart generation - Add the OpenAPI schema with your endpoint details 3. Start Analyzing - Query your data using natural language - Request visualizations and statistical analysis - View results in tables and charts --- HOW IT WORKS: Backend Architecture: - FastAPI server handles communication between ChatGPT and database - SQL Alchemy for database operations and query execution - API Key authentication for endpoint security Integration Components: - Natural language to SQL translation - Python-based statistical analysis capabilities - Chart generation through Code Interpreter - OpenAPI schema for ChatGPT actions Data Flow: - User queries processed by ChatGPT's natural language understanding - Queries converted to SQL and executed on Supabase - Results formatted into tables and visualizations - Statistical analysis performed on query results --- TWO MAIN WAYS TO CONNECT: 1. Fixed Connection to a Specific Database This page demonstrates the fixed connection method, where the GPT is connected to a specific Supabase database. 2. Dynamic Connection to Any Database If you want to connect to any database on the fly, you can use the dynamic connection method. Check out the Connect to Any Database tool for an example: app.tigzig.com/rex2-gpt --- RESOURCES: Complete Source Code: https://github.com/amararun/supabase-fastapi-sqlachemy-directdb FastAPI server code with SQL Alchemy integration and deployment instructions Step-by-Step Video Guide: https://www.youtube.com/watch?v=Zx5Noz2sFgA Detailed walkthrough of setup process and demonstration of features --- BUILT ON: OpenAI's GPT Platform - This custom GPT transforms ChatGPT into a powerful database analysis tool, enabling natural language interaction with Supabase databases. --- Source: tigzig.com | Open source AI tools for analytics, databases & automation | Amar Harolikar