Mobile Build & Distribution
Relevant source files
The following files were used as context for generating this wiki page:
The Mobile Build & Distribution system for ElmecV2 leverages the Expo ecosystem and Netlify for multi-platform delivery. This architecture supports deployment across iOS, Android, and Web environments using a unified codebase. The project utilizes Expo 51 for mobile development and Netlify as the primary hosting and distribution platform for the web-based version of the mobile app.
Sources: README.md:1-15, STATUS-DEPLOY.md:1-5
Build Pipeline Architecture
The build process is divided into two primary streams: Mobile (Native) builds managed via Expo Application Services (EAS) and Web builds managed via Netlify.
Web Deployment Flow
For the web platform, the distribution follows a CI/CD pattern where code pushed to specific branches (e.g., netifly or main) triggers automated builds on Netlify's infrastructure.
The flow ensures that every update to the repository is automatically reflected in the distributed web application.
Sources: DEPLOY-NETLIFY.md:37-55, NETLIFY-DASHBOARD-SETUP.md:35-50, package.json:11-14
Native Build Management
Native builds for iOS and Android are managed through EAS. The app.json file contains critical metadata, including the expo-router configuration and the EAS Project ID.
Sources: README.md:158-166, app.json:1-15
Build Configuration and Scripts
The distribution process is automated through a series of NPM scripts defined in package.json. These scripts handle environment-specific builds and deployment triggers.
| Script | Command | Description |
|---|---|---|
build:production | NODE_ENV=production EXPO_PUBLIC_ENVIRONMENT=production expo export --platform web --output-dir dist --clear | Generates a clean production-ready web bundle in the dist folder. |
deploy | npm run build:production && netlify deploy --prod | Chain command to build and push to production CDN. |
deploy:preview | npm run build:production && netlify deploy | Generates a preview URL for testing before production release. |
android | expo run:android | Executes the local build for Android testing. |
ios | expo run:ios | Executes the local build for iOS testing. |
Sources: package.json:8-15, STATUS-DEPLOY.md:46-54
Environment and Distribution Variables
Successful distribution requires specific environment variables to be configured in the deployment platform (Netlify) to connect the build with the Supabase backend and Expo services.
| Variable Key | Required Value/Source | Scope |
|---|---|---|
EXPO_PUBLIC_SUPABASE_URL | Supabase Project URL | Production & Preview |
EXPO_PUBLIC_SUPABASE_ANON_KEY | Supabase Anonymous Key | Production & Preview |
EXPO_PUBLIC_ENVIRONMENT | production | Production |
NODE_ENV | production | Production |
EXPO_PUBLIC_EAS_PROJECT_ID | elmec-mobile-app-demo | Production & Preview |
Sources: DEPLOY-NETLIFY.md:65-102, NETLIFY-DASHBOARD-SETUP.md:55-100
Infrastructure Configuration
Netlify Configuration (netlify.toml)
The project includes a netlify.toml file that standardizes the build environment across different developer machines. It specifies Node.js version 20.19.4 to ensure build consistency.
Sources: STATUS-DEPLOY.md:133-140, NETLIFY-SETUP-PASOS.md:145-155
Distribution Checklist
Before a release is finalized, the following infrastructure components must be verified:
- Site URL Configuration: The Netlify URL must be whitelisted in Supabase Authentication under Redirect URLs.
- app.json Origin: The
originfield inapp.jsonmust be updated to the final production URL to allow correct deep linking. - RLS Policies: Row Level Security must be active in the backend to protect distributed data.
Conclusion
The Mobile Build & Distribution system for ElmecV2 effectively bridges native mobile capabilities with web accessibility. By utilizing Expo for native packaging and Netlify for web distribution, the project achieves a scalable deployment model. The strictly defined build scripts and environment configurations ensure that production releases are reproducible and secure across all targeted platforms.