Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 8 min read Case study mediumAdept

Designing with AI: Generating unique artwork for every user

Supabase's Launch Week 7 tickets combine Midjourney-generated artwork with a per-user Open Graph image pipeline built on the Supabase stack. The art direction moved from busy prompts to minimal purple swirls. Gold variants came from blending a gold gradient overlay with `/blend` after prompts like "make it gold" failed. A Supabase Edge Function renders each ticket with Satori and caches the PNG in Supabase Storage behind a CDN, generating it only once. The same function detects Twitter and LinkedIn crawler user agents to record shares. A Postgres view behind RLS exposes public ticket fields, referral counts and a computed `golden` flag, and Supabase Realtime pushes the gold status to the client as users share.

Related posts

  • AI Inference now available in Supabase Edge Functions

    Supabase mediumAdept

    Supabase Edge Functions gain a built-in Supabase.ai.Session API for running AI inference in a few lines of code, starting with gte-small embeddings for storage in pgvector and experimental, invite-only Llama and Mistral LLMs with streaming responses. Embeddings run on a native Edge Runtime extension that calls ONNX Runtime through the Rust Ort wrapper, replacing the slow WASM boot of Transformers.js. A typical embedding request finishes in under 1s even from a cold start and uses 100-200ms of CPU, and Supabase claims this is about 10x cheaper than OpenAI's embedding API with comparable MTEB scores. LLM requests are routed to GPU-accelerated Ollama servers, and database webhooks can trigger embedding generation automatically when rows are inserted.

  • Edge Functions are now available in Supabase

    Supabase easyNovice

    Supabase Edge Functions run TypeScript globally on the Deno runtime via Deno Deploy across 30+ data centers. Supabase chose functions-as-a-service over containers for simpler developer experience and faster start-ups, and global deployment over a single region, with Postgres-colocated Database Functions covering DB-heavy work. Requests pass through a Relay gateway that verifies JWTs, rate-limits and logs, then maps function metadata to a Deno Deploy deployment ID. Cold starts fetch code and secrets from Supabase, and logs flow through Logflare into the dashboard. Functions are POST-only, and static hosting is ruled out after phishing abuse on Supabase Storage got the domain denylisted.

  • Making a Real-Time Chat App with Supabase on Replit

    Replit mediumAdept

    A real-time public chat app can be built with a Vue 3 and Tailwind CSS frontend on Replit backed by Supabase's hosted Postgres. The walkthrough creates a messages table via SQL, enables replication-based real-time events, and wraps the supabase-js client in a Vue composable. That composable handles paginated message loading by range, INSERT subscriptions for live updates, and inserts for sending. Users are identified only by a random username stored in localStorage, and older messages load when the list is scrolled to the top.

  • Building ChatGPT Apps with Supabase Edge Functions and mcp-use

    Supabase mediumAdept

    ChatGPT apps built on OpenAI's Apps SDK consist of an MCP server backend and an iframe-rendered web component, and mcp-use lets that MCP server run on Supabase Edge Functions by using Hono instead of the Express-based official SDK. The walkthrough builds a database explorer exposing list-tables, show-table, execute-SQL and Supabase-status tools, each returning React widgets. It distinguishes display-only widgets, which are auto-registered as tools and fetch data client-side, from data-returning widgets, where the server sends separate props to the UI and output to the LLM. It closes with deployment via an mcp-use script and connecting the endpoint in ChatGPT developer mode.

  • Supabase Middleware: composable, reusable middleware for Web Fetch handlers

    Supabase mediumAdept

    `@supabase/middleware` is an MIT-licensed, type-safe middleware engine for Web Fetch handlers. Per-request logic such as CORS, JWT claim verification, feature flags, RLS-scoped Supabase/Postgres clients and MCP OAuth discovery is composed as an ordered pipeline that each adds a typed key to a shared ctx, can short-circuit with a Response, or modify the response on the way out. The pipeline is a plain fetch handler, so it runs on Edge Functions, Vercel, Cloudflare Workers, Deno, Bun and Node 22+. Copy-in bridge files reuse the same entries in Hono, H3, Elysia, NestJS and TanStack Start. Custom middleware is written with `defineMiddleware`, whose type parameters make duplicate keys or misordered dependencies fail to compile (TypeScript 5.4+). The pg-based clients don't work on Workers because they need TCP sockets.

The quest for software engineering knowledge.

Look:
Layout: