⚡ Live Interactive Code Sandbox: AI Dev Tool: Show HN Huzzah
▶️ Run Code
💳 Unlock Source Code ($5)
📝 Editable Code Sandbox
```python # AI Dev Tool: FastAPI + Supabase Production Starter Boilerplate # Description: A high-performance, production-ready boilerplate for building scalable APIs with FastAPI and Supabase. from fastapi import FastAPI, HTTPException from fastapi.responses import JSONResponse from fastapi.requests import Request from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from supabase import create_client, Client from typing import Optional # Initialize Supabase client SUPABASE_URL = "https://your-supabase-instance.supabase.co" SUPABASE_KEY = "your-supabase-key" SUPABASE_SECRET = "your-supabase-secret" supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) # Define the FastAPI app app = FastAPI() # Enable CORS app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Define a Pydantic model for the user class User(BaseModel): id: Optional[int] name: str email: str # Define a route to create a new user @app.post("/users
🖥️ Interactive Execution Terminal Console
⚡ Ready! Click ▶️ Run Code to execute code in browser terminal...