Environment Variables Overview
The Nurse Handoff Helper uses environment variables to securely store API keys and configuration settings. The application requires separate environment variables for the frontend (Vite) and backend (Node.js server).All sensitive API keys are stored in environment variables and are never exposed to the browser or committed to version control.
Create Your .env File
Copy the example environment file to create your own:.env file with your actual credentials.
Required Environment Variables
Server Configuration
The port number for the Express backend server.
Anthropic API (Required)
Your Anthropic API key for Claude AI integration. This is used for:
- Analyzing handoff images
- Summarizing patient records
- Extracting structured patient data
claude-sonnet-4-20250514) for all AI operations.Supabase Configuration (Frontend)
Your Supabase project URL. Used by the frontend Vite application.
Your Supabase anonymous/public key. Safe to use in the browser with Row Level Security (RLS) enabled.
Supabase Configuration (Backend)
Your Supabase project URL for backend operations.
Your Supabase anonymous key for general backend operations.
Your Supabase service role key with admin privileges. Required for:
- Creating nurse authentication accounts
- Admin-level database operations
- Managing user accounts
Complete .env Example
Here’s a complete example of the.env file:
Security Best Practices
Never Commit Secrets
The
.env file is included in .gitignore. Never commit it to version control.Use Different Keys
Use different Supabase projects for development, staging, and production.
Rotate Keys
Regularly rotate your API keys and service role keys.
Limit Permissions
Use RLS policies in Supabase to limit what the anon key can access.
Verify Configuration
You can verify your environment configuration is correct by checking the health endpoint:Troubleshooting
Missing Supabase environment variables
Missing Supabase environment variables
If you see this error:Make sure you’ve set both
VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in your .env file.Claude API is not configured
Claude API is not configured
If API requests fail with:Verify that your
ANTHROPIC_API_KEY is correctly set and valid.Admin operations require SUPABASE_SERVICE_KEY
Admin operations require SUPABASE_SERVICE_KEY
This error appears when trying to create nurse accounts without the service role key. Add
SUPABASE_SERVICE_KEY to your .env file.Next Steps
After configuring your environment:- Set up your Supabase database - see Supabase Setup
- Create nurse accounts - see Nurse Accounts
- Start the application with
npm start
