This is a quick reference guide to get started with Supabase integration for the Aushadham platform.
- Go to https://supabase.com
- Sign up/Sign in
- Click "New Project"
- Fill in details and create
- In Supabase dashboard, go to "SQL Editor"
- Copy-paste the SQL from
supabase_schema.sql - Click "Run"
- Copy
.env.exampleto.env - Get your credentials from Supabase (Settings → API)
- Update
.env:
USE_SUPABASE=true
SUPABASE_URL=your-project-url
SUPABASE_KEY=your-anon-keypip install -r requirements.txt
python app.pyDone! Your app is now using Supabase! 🎉
- Users - All user accounts and authentication data
- Questionnaires - Saved medical questionnaires with answers
- Feedback - User ratings and comments
- Sessions - Active questionnaire sessions
USE_SUPABASE=trueUSE_SUPABASE=false
# or just remove the lineCheck the application logs when starting:
- Supabase:
INFO:__main__:Using Supabase for database operations - SQLAlchemy:
INFO:__main__:Using SQLAlchemy for database operations
Run the test suite:
python test_api.pyThe tests work with both backends automatically!
- Full setup guide: SUPABASE_SETUP.md
- API documentation: API_DOCUMENTATION.md
- Main README: README.md
Issue: "Supabase configuration found but initialization failed"
- Solution: Check your
SUPABASE_URLandSUPABASE_KEYin.env
Issue: Tables don't exist
- Solution: Run the SQL from
supabase_schema.sqlin Supabase SQL Editor
Issue: Can't connect to Supabase
- Solution: Check your internet connection and Supabase project status
Supabase free tier includes:
- 500 MB database
- 1 GB storage
- 2 GB bandwidth
- 50,000 monthly active users
Perfect for development and small production deployments!
- Never commit
.envfile to git - Use environment variables in production
- Rotate API keys regularly
- Enable Row Level Security (RLS) - already done in schema!
- Monitor usage in Supabase dashboard
- Customize the schema for your needs
- Add more tables as needed
- Set up monitoring and alerts
- Configure backups
- Deploy to production
Happy coding! 🚀