Supabase Storage Buckets Setup
This document lists all storage buckets required for the application.
Required Buckets
1. avatars
- Purpose: User profile avatars
- Public: Yes
- Setup: See
supabase/storage_setup.md
2. tone-packs
- Purpose: AI-generated tone pack images
- Public: Yes
- File size limit: 5MB
- Allowed MIME types:
image/png,image/jpeg,image/jpg,image/webp - Setup: Run migration
018_create_tone_packs_bucket.sqlor seedocs/TONE_PACKS.md
3. entry-backgrounds
- Purpose: AI-generated background images for journal entries
- Public: Yes
- File size limit: 10MB (recommended)
- Allowed MIME types:
image/png,image/jpeg,image/jpg,image/webp - Setup: Create manually via Supabase dashboard or SQL
Quick Setup
Via Supabase Dashboard
- Go to https://supabase.com/dashboard
- Select your project
- Navigate to Storage in the left sidebar
- Click New bucket for each bucket above
- Configure settings as specified
Via SQL Migration
Run the migration files in order:
018_create_tone_packs_bucket.sql- Creates tone-packs bucket with policies
For other buckets, use the Supabase dashboard or create similar migration files.
Storage Policies
All buckets use Row Level Security (RLS) policies to ensure:
- Users can only upload/update/delete their own files
- Public files can be viewed by anyone
- Super admins have full access
Troubleshooting
"Bucket not found" Error
If you see this error:
- Check that the bucket exists in Supabase Storage
- Verify the bucket name matches exactly (case-sensitive)
- Ensure the bucket is public if it needs to be accessed via URL
- Check that RLS policies are set up correctly
"Permission denied" Error
If you see permission errors:
- Verify RLS policies are created
- Check that the user is authenticated
- Ensure the file path matches the policy conditions (e.g., user ID in path)