This directory contains all the documentation you need to integrate Supabase with Gravity Planner.
-
- Database schema creation
- Row Level Security (RLS) policies
- Authentication configuration
- Initial Supabase setup
-
- Install Supabase client
- Create SupabaseContext
- Create DatabaseService layer
- Update PlannerContext
- Add authentication components
-
- Export data from Google Drive
- Run migration script
- Verify data integrity
- Rollback plan
- .env.example - Environment variable template
- Copy to
.envand fill in your Supabase credentials
# Access Supabase Studio
http://193.122.151.142:8000
# Go to: Settings → API
# Copy: URL and anon/public key# Copy template
cp .env.example .env
# Edit .env and add your credentials
VITE_SUPABASE_URL=http://193.122.151.142:8000
VITE_SUPABASE_ANON_KEY=your-actual-key-herenpm install @supabase/supabase-jsFollow instructions in SUPABASE_SETUP.md to run the SQL schema script.
Follow instructions in SUPABASE_INTEGRATION.md to:
- Create Supabase client
- Add SupabaseContext
- Create DatabaseService
- Update PlannerContext
Follow instructions in SUPABASE_MIGRATION.md to migrate your existing data.
selfdev/
├── .env # Your Supabase credentials (gitignored)
├── .env.example # Template for .env
├── SUPABASE_SETUP.md # Database setup guide
├── SUPABASE_INTEGRATION.md # Code integration guide
├── SUPABASE_MIGRATION.md # Data migration guide
├── README_SUPABASE.md # This file
├── src/
│ ├── lib/
│ │ └── supabase.js # Supabase client
│ ├── context/
│ │ ├── SupabaseContext.jsx # Auth context
│ │ └── PlannerContext.jsx # Updated to use Supabase
│ ├── services/
│ │ └── database.js # Database service layer
│ └── components/
│ └── Auth.jsx # Login/signup component
└── scripts/
└── migrate-to-supabase.js # Migration script
-
.envfile created and configured -
.envadded to.gitignore - RLS policies enabled on all tables
- Authentication configured
- HTTPS/SSL configured (for production)
- Regular database backups scheduled
- Verify Docker containers are running
- Check firewall settings
- Test connection:
curl http://193.122.151.142:8000
- Verify
.envcredentials are correct - Check Supabase Studio → Settings → API
- Restart dev server after changing
.env
- Check RLS policies in Supabase Studio
- Verify user is authenticated
- Check browser console for errors
- Check
backup.jsonformat - Verify user account exists
- See rollback instructions in
SUPABASE_MIGRATION.md
- Supabase Docs: https://supabase.com/docs
- Supabase Discord: https://discord.supabase.com
- Project Issues: Check the guides in this directory
- Test authentication (sign up, sign in, sign out)
- Test CRUD operations (create, read, update, delete)
- Verify real-time sync (optional)
- Migrate production data
- Set up automated backups
- Configure production environment
Good luck with your Supabase integration! 🚀