This directory contains the database schema and configuration for IReader's sync feature.
This is an open-source project. API keys and credentials are NOT included in the repository. Each developer must configure their own Supabase instance.
- Create Supabase Project: https://supabase.com
- Run Complete Schema:
- Open Supabase SQL Editor
- Copy entire
schema.sqlfile - Execute (creates all tables, policies, functions)
- Get Credentials: Go to Settings → API and copy your anon key (NOT service_role!)
- Configure Locally:
# Copy example files cp config.properties.example config.properties cp local.properties.example local.properties # Edit both files and add your credentials
- Build:
./gradlew clean build
If you already have an older database:
- Option 1: Run the complete
schema.sql(recommended for fresh start) - Option 2: Your existing data will work, but you may need to:
- Remove unique constraints on reviews (see Migration Notes in schema.sql)
- Ensure book_url column exists in synced_books
schema.sql- Complete database schema (includes all migrations)- All tables, indexes, RLS policies, functions, triggers
- Book and chapter review system
- Badge system for users
- All migrations already applied
- Deprecated (merged into schema.sql)migration_*.sql
../SECURE_CONFIGURATION_GUIDE.md- Detailed security setup../SUPABASE_API_KEY_FIX.md- API key security explanation../SYNC_SETUP_FINAL.md- Complete sync setup guide
- ✅ Use anon key (safe for client apps)
- ❌ Never use service_role key in client apps
- ✅ Config files are gitignored
- ❌ Never commit credentials to git