鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

moai-platform-supabase

专注构建基于 Supabase 的全栈应用,支持 PostgreSQL 16 高级特性、AI 向量检索、行级安全多租户隔离、实时数据同步、边缘函数计算及带转换的文件存储,适用于需要数据库、认证、实时与 AI 能力深度集成的现代应用开发。

数据库
访问 GitHub
文档Skills.MD
name
moai-platform-supabase
description
Supabase specialist covering PostgreSQL 16, pgvector, RLS, real-time subscriptions, and Edge Functions. Use when building full-stack apps with Supabase backend.
version
2.1.0
category
platform
modularizedtrue
user-invocablefalse
tags["supabase","postgresql","pgvector","realtime","rls","edge-functions"]
context7-libraries["/supabase/supabase"]
related-skills["moai-platform-neon","moai-lang-typescript"]
updated"2026-01-11T00:00:00.000Z"
status
active
allowed-tools["Read","Grep","Glob","mcp__context7__resolve-library-id","mcp__context7__get-library-docs"]
triggers{"keywords":["supabase","postgresql","pgvector","real-time","rls","row level security","edge functions"]}

moai-platform-supabase: Supabase Platform Specialist

Quick Reference

Supabase Full-Stack Platform: PostgreSQL 16 with pgvector for AI/vector search, Row-Level Security for multi-tenant apps, real-time subscriptions, Edge Functions with Deno runtime, and integrated Storage with transformations.

Core Capabilities

PostgreSQL 16 provides latest PostgreSQL with full SQL support, JSONB, and advanced features.

pgvector Extension enables AI embeddings storage with HNSW and IVFFlat indexes for similarity search.

Row-Level Security provides automatic multi-tenant data isolation at database level.

Real-time Subscriptions enable live data sync via Postgres Changes and Presence.

Edge Functions provide serverless Deno functions at the edge.

Storage provides file storage with automatic image transformations.

Auth provides built-in authentication with JWT integration.

When to Use Supabase

Use Supabase for multi-tenant SaaS applications requiring data isolation, AI/ML applications needing vector embeddings and similarity search, real-time collaborative features including presence and live updates, full-stack applications needing auth, database, and storage, and projects requiring PostgreSQL-specific features.

Context7 Documentation Access

For latest Supabase API documentation, use the Context7 MCP tools:

Step 1 - Resolve library ID: Use mcp__context7__resolve-library-id with query "supabase" to get the Context7-compatible library ID.

Step 2 - Fetch documentation: Use mcp__context7__get-library-docs with the resolved library ID, specifying topic and token allocation.

Example topics include "postgresql pgvector", "row-level-security policies", "realtime subscriptions presence", "edge-functions deno", "storage transformations", and "auth jwt".


Module Index

This skill uses progressive disclosure with specialized modules for detailed implementation patterns.

Core Modules

postgresql-pgvector covers PostgreSQL 16 with pgvector extension for AI embeddings and semantic search. Topics include vector storage with 1536-dimension OpenAI embeddings, HNSW and IVFFlat index strategies, semantic search functions, and hybrid search combining vector and full-text.

row-level-security covers RLS policies for multi-tenant data isolation. Topics include basic tenant isolation patterns, hierarchical organization access, role-based modification policies, and service role bypass for server operations.

realtime-presence covers real-time subscriptions and presence tracking. Topics include Postgres Changes subscription patterns, filtered change listeners, presence state management, and collaborative cursor and typing indicators.

edge-functions covers serverless Deno functions at the edge. Topics include basic Edge Function with authentication, CORS header configuration, JWT token verification, and rate limiting implementation.

storage-cdn covers file storage with image transformations. Topics include file upload patterns, image transformation URLs, thumbnail generation, and cache control configuration.

auth-integration covers authentication patterns and JWT handling. Topics include server-side client creation, cookie-based session management, auth state synchronization, and protected route patterns.

typescript-patterns covers TypeScript client patterns and service layers. Topics include server-side client for Next.js App Router, service layer abstraction pattern, subscription management, and type-safe database operations.


Quick Start Patterns

Database Setup

To enable pgvector extension and create embeddings table, execute SQL to create extension vector if not exists. Create a documents table with id as UUID primary key defaulting to gen_random_uuid(), content as TEXT not null, embedding as vector with 1536 dimensions, metadata as JSONB defaulting to empty object, and created_at as TIMESTAMPTZ defaulting to NOW(). Create an index on documents embedding using hnsw with vector_cosine_ops operator class.

Basic RLS Policy

To create a tenant isolation policy, alter the projects table to enable row level security. Create a policy named "tenant_isolation" on projects for all operations using a condition where tenant_id equals the tenant_id extracted from the auth.jwt() function cast to UUID.

Real-time Subscription

For real-time subscription, create a channel using supabase.channel with a channel name. Chain the on method for postgres_changes with event set to asterisk for all events, schema set to public, and table set to messages. Provide a callback that logs the payload. Chain subscribe to activate the subscription.

Edge Function Template

For Edge Function template, import serve from deno.land/std/http/server.ts and createClient from esm.sh/@supabase/supabase-js. Call serve with an async handler that creates a Supabase client using environment variables SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY. Process the request and return a new Response with JSON stringified success object.


Best Practices

Performance: Use HNSW indexes for vectors and Supavisor for connection pooling in serverless environments.

Security: Always enable RLS, verify JWT tokens, and use service_role only in Edge Functions.

Migration: Use Supabase CLI with supabase migration new and supabase db push commands.


Works Well With

  • moai-platform-neon for alternative PostgreSQL for specific use cases
  • moai-lang-typescript for TypeScript patterns for Supabase client
  • moai-domain-backend for backend architecture integration
  • moai-foundation-quality for security and RLS best practices
  • moai-workflow-testing for DDD testing with Supabase (characterization tests for legacy, specification tests for new features)

Module References

For detailed implementation patterns, see the modules directory:

  • modules/postgresql-pgvector.md covers complete vector search implementation
  • modules/row-level-security.md covers multi-tenant RLS patterns
  • modules/realtime-presence.md covers real-time collaboration features
  • modules/edge-functions.md covers serverless function patterns
  • modules/storage-cdn.md covers file storage and transformations
  • modules/auth-integration.md covers authentication patterns
  • modules/typescript-patterns.md covers TypeScript client architecture

For API reference summary, see reference.md. For full-stack templates, see examples.md.


Status: Production Ready Generated with: MoAI-ADK Skill Factory v2.0 Last Updated: 2026-01-11 Version: 2.1.0 (Modularized) Coverage: PostgreSQL 16, pgvector, RLS, Real-time, Edge Functions, Storage

数据库

快捷安装

复制到终端去安装 Skill

npxskillsaddmodu-ai/moai-adk--skill"moai-platform-supabase"
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
朱雀AI检测助手朱雀AI检测助手
零感AI零感AI
Skills 推荐
relational-database-mcp-cloudbase
面向 CloudBase 关系型数据库的自动化管理,支持安全执行只读查询、写入与结构变更操作,并可检视及调整表级安全规则,确保在无应用上下文的代理环境中精准控制数据访问与修改权限。
database-index-advisor
通过分析数据库查询负载和现有索引配置,自动识别缺失的高效索引以加速慢查询,同时发现长期未被使用的冗余索引以便清理,从而在提升读取性能的同时节省存储空间并优化写入效率。
detecting-sql-injection-vulnerabilities
自动识别和分析应用程序代码及数据库查询中的 SQL 注入风险,覆盖输入点检测、查询构造审查、参数化验证与安全模式推荐,生成结构化安全报告并提供修复建议。
database
规范 NestJS 应用的数据访问层设计,涵盖 ORM 选型、连接池与分片等可扩展架构,强制使用仓库模式隔离数据库逻辑,通过异步配置加载敏感信息,禁用生产环境自动同步,依赖迁移脚本实现零停机演进,并统一要求分页、索引声明与事务保护。
prisma-schema-helper
提供 Prisma 数据模型定义的自动化辅助能力,涵盖模式校验、关系配置、字段类型推导及迁移脚本生成,支持 Node.js 等后端技术栈的数据库层快速搭建与维护。