Skip to main content

Configuration

This guide covers the configuration options for LyfeAI Provider.

Environment Variables

Required Variables

VariableDescriptionExample
NEXT_PUBLIC_SUPABASE_URLYour Supabase project URLhttps://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase anonymous keyeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
SUPABASE_SERVICE_ROLE_KEYSupabase service role keyeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
OPENAI_API_KEYOpenAI API key for AI featuressk-...

Optional Variables

VariableDescriptionDefault
NEXT_PUBLIC_APP_URLApplication URLhttp://localhost:3000
AI_MODELOpenAI model to usegpt-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:

  1. Row Level Security (RLS) enabled on all tables
  2. Realtime enabled for communication features
  3. 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:

  1. Use OpenAI (default):

    • Requires valid OPENAI_API_KEY
    • Uses GPT-4 for medical insights
  2. 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

Next Steps