Environment Configuration
Relevant source files
The following files were used as context for generating this wiki page:
The environment configuration for the ELMEC Mobile App v2 is designed to support a multi-platform architecture (iOS, Android, and Web) integrated with Supabase as the Backend-as-a-Service (BaaS) and Netlify for web hosting. The system utilizes environment variables to manage different deployment stages, ensuring secure connections to database services, authentication providers, and storage buckets.
Sources: README.md:10-25, STATUS-DEPLOY.md:12-25
Core Environment Variables
The application relies on a set of standardized environment variables prefixed with EXPO_PUBLIC_ to ensure visibility within the Expo/React Native runtime. These variables control the connection to Supabase and define the current execution context.
| Variable Name | Description | Environment |
|---|---|---|
EXPO_PUBLIC_SUPABASE_URL | The API URL for the Supabase project instance. | All |
EXPO_PUBLIC_SUPABASE_ANON_KEY | The anonymous public key for Supabase client-side operations. | All |
EXPO_PUBLIC_ENVIRONMENT | Defines the current stage (e.g., development, production). | All |
EXPO_PUBLIC_EAS_PROJECT_ID | Unique identifier for Expo Application Services (EAS). | All |
NODE_ENV | Standard Node.js environment flag (typically production). | Build/CI |
Sources: DEPLOY-NETLIFY.md:38-55, NETLIFY-DASHBOARD-SETUP.md:46-75, supabase/setup-instructions.md:21-27
Supabase Infrastructure Configuration
The backend environment is managed through Supabase, which requires specific configuration for authentication, database schemas, and storage policies.
Connection and Authentication
To establish a connection, the EXPO_PUBLIC_SUPABASE_URL and EXPO_PUBLIC_SUPABASE_ANON_KEY must be retrieved from the Supabase Dashboard under Settings → API. Authentication is further configured via the URL Configuration section to define valid Redirect URLs and the Site URL for the hosted application.
Sources: supabase/setup-instructions.md:9-19, NETLIFY-DASHBOARD-SETUP.md:105-115
Database and Schema Management
The database environment is initialized through a series of SQL migrations that define the core table structure and Row Level Security (RLS) policies.
The diagram above shows the sequential setup required to prepare the Supabase environment for the application.
Sources: supabase/setup-instructions.md:29-41, STATUS-DEPLOY.md:19-35
Netlify Deployment Configuration
Netlify serves as the production environment for the web version of ELMEC. The configuration is defined in netlify.toml and managed through the Netlify Dashboard.
Build and Deployment Settings
The build process is standardized to use Node.js version 20.19.4 to ensure compatibility with modern React Native/Expo dependencies.
| Setting | Value |
|---|---|
| Branch to deploy | netifly |
| Build command | npm ci && npm run build:production |
| Publish directory | dist |
| Node Version | 20.19.4 |
Sources: DEPLOY-NETLIFY.md:15-20, NETLIFY-DASHBOARD-SETUP.md:32-42, STATUS-DEPLOY.md:120-125
Deployment Workflow
The environment transition from local development to production follows a structured pipeline:
Mobile Application Configuration (app.json)
For mobile-specific environments, app.json contains the metadata required for the Expo Router and platform-specific permissions. A critical configuration is the origin property, which must match the real Netlify URL to handle deep linking and routing correctly in production.
{
"expo": {
"plugins": [
[
"expo-router",
{
"origin": "https://your-app.netlify.app/"
}
]
]
}
}
Sources: DEPLOY-NETLIFY.md:105-115, NETLIFY-DASHBOARD-SETUP.md:117-128
Conclusion
The environment configuration of ELMEC v2 ensures a robust separation between infrastructure layers. By centralizing Supabase credentials and Netlify build settings, the project maintains high security through RLS policies and consistent deployments using automated CI/CD pipelines. Proper alignment of Redirect URLs and environment-specific variables is essential for the seamless operation of the authentication and request management modules.