Your database schema is ready in database/schema.sql. Here's how to apply it:
-
Open Supabase Dashboard
- Go to: https://oujzaihnpdffjnhfgfks.supabase.co
- Navigate to SQL Editor
-
Run the schema
- Open
database/schema.sql - Copy entire contents
- Paste into SQL Editor
- Click Run
- Open
-
Verify tables created
- Go to Table Editor
- You should see:
profiles,categories,book_reviews,comments,review_likes
To fix the "Bucket not found" error, you must create the following buckets in Supabase Storage:
- profiles (Public: Yes) - For user avatars
- canvas-media (Public: Yes) - For canvas images
- library-covers (Public: Yes) - For book covers
- library-books (Public: Yes) - For PDF files
- Go to Storage in Supabase Dashboard.
- Click New Bucket.
- Enter the name (e.g.,
profiles) and toggle Public. - Repeat for all 4 buckets.
Alternatively, run the script in database/migrations/setup_storage.sql in the SQL Editor.
Your schema includes:
- ✅ profiles table - User profiles (extends auth.users)
- ✅ categories table - Review categories (Fiction, Non-Fiction, etc.)
- ✅ book_reviews table - Main reviews table
- ✅ comments table - Review comments
- ✅ review_likes table - Review likes/favorites
- ✅ Row Level Security (RLS) - Secure access policies
- ✅ Indexes - Optimized for performance
- ✅ Sample data - 8 categories pre-loaded
Once database is set up, you can:
- Test connection via API routes
- Create sample reviews
- Build review listing page
- Implement like/comment functionality
Status: Schema ready, waiting for migration execution