Configuration
This guide covers the configuration options for LyfeAI Provider.
Environment Variables
Required Variables
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Your Supabase project URL | https://your-project.supabase.co |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase anonymous key | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
OPENAI_API_KEY | OpenAI API key for AI features | sk-... |
Optional Variables
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_APP_URL | Application URL | http://localhost:3000 |
AI_MODEL | OpenAI model to use | gpt-4-turbo-preview |
User Roles and Permissions
The application supports four user roles with different permissions:
Admin
- Full access to all features
- Can manage users and system settings
- Access to all patient data
Doctor
- Full patient access
- Can create and modify care plans
- Access to AI clinical assistant
- Can write prescriptions
Nurse
- View and update patient vitals
- Access to patient communication
- Limited prescription access
- Can add clinical notes
Staff
- Basic patient view access
- Can schedule appointments
- Limited data modification
Database Configuration
Connection Settings
The application uses Supabase for database management. Ensure your Supabase project has:
- Row Level Security (RLS) enabled on all tables
- Realtime enabled for communication features
- Storage bucket for document uploads
Schema Setup
The database schema includes:
- User management tables
- Patient records
- Medical data (conditions, medications, allergies)
- Communication and collaboration features
AI Service Configuration
The AI service can be configured to:
-
Use OpenAI (default):
- Requires valid
OPENAI_API_KEY - Uses GPT-4 for medical insights
- Requires valid
-
Fallback Mode:
- Simulated responses when API key is not available
- Useful for development and testing
Security Settings
Authentication
- Mock authentication system for development
- Production deployments should implement proper authentication
Data Protection
- All sensitive data is encrypted at rest
- API keys should never be exposed to the client
- Use environment variables for all secrets