Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Bran258/api_centro_medico/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Medical Center API requires several environment variables to function properly. These variables configure database connections, Supabase authentication, and other critical services.Required Variables
Create a.env file in the root directory of your project with the following variables:
DATABASE_URL
The PostgreSQL database connection string. The format differs depending on whether you’re running migrations or using the application in production.postgresql://USER:PASSWORD@HOST:PORT/DATABASE[?options]
Important notes:
- For migrations, use port
5432(direct PostgreSQL connection) - For production, use port
6543with?pgbouncer=truefor connection pooling - Never commit your actual database credentials to version control
SUPABASE_URL
The URL of your Supabase project.- Go to your Supabase project dashboard
- Navigate to Settings → API
- Copy the “Project URL”
SUPABASE_ANON_KEY
The anonymous (public) key for Supabase.- Go to your Supabase project dashboard
- Navigate to Settings → API
- Copy the “anon public” key
SUPABASE_SERVICE_ROLE_KEY
The service role key for Supabase with elevated permissions.- Go to your Supabase project dashboard
- Navigate to Settings → API
- Copy the “service_role secret” key
Complete Example
Here’s a complete.env file template:
Environment-Specific Configuration
Security Best Practices
- Store production credentials in your deployment platform’s environment variable settings
- Use different Supabase projects for development and production
- Rotate keys regularly, especially if they may have been exposed
- Use strong, unique passwords for database connections
- Enable SSL for production database connections
Verifying Configuration
After setting up your environment variables, verify they’re loaded correctly:Troubleshooting
Database connection fails
- Verify PostgreSQL is running:
pg_isready - Check the connection string format
- Ensure the database exists:
createdb medical_center - Verify firewall rules allow the connection
Supabase authentication fails
- Verify your Supabase project is active
- Check that the keys match your project dashboard
- Ensure the
SUPABASE_URLdoesn’t have a trailing slash - Try regenerating the keys if they’re not working