Open
Conversation
Implements flexible provider pattern for dual deployment modes: - Provider interfaces for context, billing, analytics, storage - No-op providers for OSS (unlimited, no tracking) - Database migrations for projects and project_members - RLS policies supporting both user-owned and project-owned collections - Feature flags and comprehensive documentation Note: Supabase types will be regenerated after migrations are applied
Separates hosted-only migrations into /migrations-hosted/ to prevent OSS users from accidentally running them. Supabase CLI only reads from /migrations/ by default, so this ensures clean separation. Changes: - Move projects/project_members migrations to migrations-hosted/ - Add warning comments to hosted migration files - Add README explaining hosted-only migrations
Adds content caching for fast queries without database hits. Unlike other providers, cache is opt-in for BOTH OSS and hosted. Features: - DisabledCacheProvider (default for OSS) - MemoryCacheProvider (in-process, dev/single-instance) - FileSystemCacheProvider (persistent, no external deps) - RedisCacheProvider stub (Redis/Upstash for production) OSS users can enable caching with CACHE_PROVIDER env var. Supports memory, filesystem, redis, and upstash options. Use case: Cache published items for public API without DB queries Example: Publish item -> cache.set(slug, data) -> fast retrieval
Replace Redis/memory caching with object storage approach: User → Next.js API → Object Storage Cache → DB (if miss) Benefits: - App is the gateway (control URLs, auth, metrics) - Cache is transparent to users - CDN accelerates storage reads - Cheaper than Redis for static content Providers: - Supabase Storage (FREE for OSS, uses existing instance) - Cloudflare R2 ($0.015/GB, FREE egress, production) - Vercel Blob (simple, Vercel-integrated) - File System (dev/single-instance) Removed: - Redis/Upstash providers (wrong pattern for CMS caching) - Memory provider (not persistent) This architecture is better for a CMS: - Published content cached once, read many times - No need for in-memory cache or Redis - Object storage + CDN is cheaper and simpler - App maintains full control over access
Creates provider pattern for media and video storage. Not yet integrated with existing code - just the architecture. Media Storage (images/files): - Supabase Storage provider (OSS default) - R2 provider (hosted option, stub) - Interface: uploadImage(), uploadFile(), delete() Video Storage (separate - different needs): - Disabled provider (default) - Cloudflare Stream provider (transcoding, HLS, thumbnails) - Bunny.net Stream provider (cheapest option) - Interface: uploadVideo(), getVideoInfo(), playback URLs Design decisions: - Separate media vs video (different requirements) - OSS default: Supabase Storage (already have it, free) - Hosted options: R2 for media, CF Stream/Bunny for video - Video is opt-in (most CMSes don't need it) Not yet implemented: - Provider registry initialization - Integration with existing upload code - Video upload UI - Usage tracking/limits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.