Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Supabase Plugin Marketplace

A comprehensive collection of production-ready plugins for building modern applications with Supabase.

Overview

This marketplace provides 10 specialized plugins covering all aspects of Supabase development:

  1. Advanced Authentication - Complete auth solution with OAuth, MFA, and session management
  2. Database Operations - Advanced queries, transactions, and RLS policies
  3. Storage Manager - File uploads, CDN integration, and transformations
  4. Realtime Sync - WebSocket subscriptions for presence and database changes
  5. Edge Functions - Serverless Deno functions with TypeScript
  6. RLS Security - Row Level Security patterns and policies
  7. Database Migrations - Schema management and migration tools
  8. Client SDK - TypeScript/JavaScript client patterns
  9. Testing Tools - Unit and integration testing utilities
  10. Performance Optimization - Query optimization and caching

Quick Start

Installation

# Install the Supabase CLI
npm install -g supabase

# Clone the marketplace
git clone https://github.com/skillstash/supabase-marketplace
cd supabase-marketplace

# Install a specific plugin
npm install ./plugins/auth-advanced

Basic Setup

import { createClient } from '@supabase/supabase-js'

// Initialize Supabase client
const supabase = createClient(
  process.env.SUPABASE_URL!,
  process.env.SUPABASE_ANON_KEY!
)

// Use plugins
import { AuthManager } from 'supabase-auth-advanced'
import { DatabaseOps } from 'supabase-database-operations'
import { StorageManager } from 'supabase-storage-manager'

const auth = new AuthManager(supabase)
const db = new DatabaseOps(supabase)
const storage = new StorageManager(supabase)

Plugin Architecture

Each plugin follows a consistent structure:

plugin-name/
├── plugin.json           # Plugin metadata and configuration
├── README.md             # Comprehensive documentation
├── CHANGELOG.md          # Version history
├── .claude/              # AI-powered development tools
│   ├── commands/         # Slash commands for quick actions
│   ├── skills/           # Auto-loading development skills
│   └── agents/           # Specialized AI agents
├── src/                  # Source code
│   ├── index.ts          # Main entry point
│   └── lib/              # Core functionality
├── examples/             # Usage examples
└── tests/                # Test suites

Features

🚀 Production Ready

  • TypeScript support throughout
  • Comprehensive error handling
  • Security best practices
  • Performance optimized

🤖 AI-Powered Development

  • Slash Commands: Quick actions like /auth-setup, /db-migrate
  • Auto Skills: Automatic implementation when patterns detected
  • Expert Agents: Specialized agents for complex scenarios

🔒 Enterprise Security

  • Row Level Security (RLS)
  • Multi-Factor Authentication
  • OAuth 2.0 providers
  • GDPR compliance ready

📊 Advanced Features

  • Real-time subscriptions
  • Edge Functions
  • PostGIS support
  • Full-text search
  • JSONB operations

Environment Setup

Create a .env.local file:

# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

# Database
DATABASE_URL=postgresql://postgres:password@localhost:54322/postgres

# Optional: External Services
OPENAI_API_KEY=your-openai-key
RESEND_API_KEY=your-resend-key
STRIPE_SECRET_KEY=your-stripe-key

Common Use Cases

Authentication Flow

// Sign up with email
await auth.signUp({
  email: 'user@example.com',
  password: 'secure-password',
  metadata: { name: 'John Doe' }
})

// OAuth sign in
await auth.signInWithProvider('google')

// Enable MFA
await auth.enableMFA('totp')

Database Operations

// Complex query with joins
const { data } = await db
  .from('posts')
  .select('*, author:users(*), comments(*)')
  .eq('published', true)
  .order('created_at', { ascending: false })

// Transaction
await db.transaction(async (tx) => {
  await tx.insert('orders', orderData)
  await tx.update('inventory', { quantity: db.raw('quantity - 1') })
})

File Storage

// Upload with transformations
const { data } = await storage
  .upload('avatars/user-123.png', file, {
    transform: {
      width: 200,
      height: 200,
      quality: 80
    }
  })

// Get public URL
const url = storage.getPublicUrl('avatars/user-123.png')

Realtime Sync

// Subscribe to changes
const subscription = supabase
  .channel('posts')
  .on('postgres_changes', {
    event: '*',
    schema: 'public',
    table: 'posts'
  }, (payload) => {
    console.log('Change received!', payload)
  })
  .subscribe()

Development Workflow

Using Slash Commands

# Set up authentication
/auth-setup --providers google,github --mfa true

# Run database migration
/db-migrate --version latest

# Deploy edge function
/edge-deploy --function send-email

Auto Skills

The marketplace includes intelligent skills that activate automatically:

  • implement-auth: Detects auth patterns and implements complete flows
  • optimize-queries: Analyzes and optimizes database queries
  • secure-routes: Adds protection to routes and endpoints

Expert Agents

Specialized agents for complex tasks:

  • auth-specialist: Handles complex authentication scenarios
  • query-optimizer: Optimizes database performance
  • security-auditor: Performs security assessments

Best Practices

Security

  1. Always enable RLS on tables
  2. Use environment variables for secrets
  3. Implement proper error handling
  4. Enable MFA for admin accounts
  5. Regular security audits

Performance

  1. Use connection pooling
  2. Implement caching strategies
  3. Optimize database indexes
  4. Use Edge Functions for compute
  5. Enable CDN for static assets

Development

  1. Write tests for critical paths
  2. Use TypeScript for type safety
  3. Follow consistent code style
  4. Document API changes
  5. Version control migrations

Testing

# Run all tests
npm test

# Run specific plugin tests
npm test -- plugins/auth-advanced

# Run with coverage
npm test -- --coverage

# E2E tests
npm run test:e2e

Deployment

Supabase Cloud

# Link to project
supabase link --project-ref your-project-ref

# Push database changes
supabase db push

# Deploy functions
supabase functions deploy

# Set secrets
supabase secrets set KEY=value

Self-Hosted

# Start local development
supabase start

# Apply migrations
supabase migration up

# Deploy with Docker
docker-compose up -d

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Support

License

MIT License - see LICENSE for details.

Acknowledgments

Built with ❤️ by the SkillStash team using:


Version: 1.0.0 | Last Updated: January 2024

About

Production-ready Claude Code plugins for Supabase database, auth, storage, realtime, and edge functions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages