Deployment
Relevant source files
The following files were used as context for generating this wiki page:
The eefashiondesign project is a cross-platform application built with React Native and Expo, designed to run on web, desktop, and mobile devices. The deployment and build process is primarily managed through Expo Application Services (EAS) and configured via a set of JSON and Gradle files. This system handles different build environments, platform-specific configurations, and the inclusion of environment variables for services like Supabase.
The core of the deployment strategy relies on eas.json for defining build profiles, app.json for the application manifest, and platform-specific files like android/app/build.gradle for native settings. Environment-specific configurations, such as API keys, are managed through .env files and loaded at runtime.
Sources: README.md:5-8, README.md:31-36
Configuration File Architecture
The deployment configuration is distributed across several key files, each with a distinct responsibility. The diagram below illustrates the relationship between these files.
This diagram shows how eas.json orchestrates builds using the metadata from app.json, which in turn provides configuration for native projects like the Android build defined in build.gradle. Runtime configuration is handled separately by env.config.js.
Sources: eas.json, app.json, android/app/build.gradle, src/core/config/env.config.js
Expo Application Services (EAS)
EAS is used to create builds for development, preview, and production. The configuration is defined in eas.json, which specifies different build profiles.
Sources: eas.json
Build Profiles
The project defines three distinct build profiles: development, preview, and production. Each profile can have its own set of configurations, such as environment variables and distribution settings.
| Profile | Description | Key Configurations |
|---|---|---|
development | For creating development client builds. | developmentClient: true, distribution: "internal" |
preview | For internal testing and preview builds. | distribution: "internal" |
production | For App Store and Play Store releases. | env.NODE_ENV: "production" |
Sources: eas.json:5-18
The following flowchart illustrates the EAS build process based on the selected profile.
This flow shows how each profile in eas.json applies specific settings before the build artifact is generated.
Sources: eas.json:5-18
Application Manifest (app.json)
The app.json file serves as the central configuration manifest for the Expo project. It contains metadata for the app, platform-specific settings, and plugin configurations.
Core Configuration
| Property | Value | Description |
|---|---|---|
name | "eefashiondesign" | The display name of the app. |
slug | "eefashiondesign" | The URL-friendly name for the app. |
version | "1.0.0" | The current version of the app. |
orientation | "portrait" | Locks the app to portrait mode. |
sdkVersion | "50.0.0" | The Expo SDK version used. |
platforms | ["ios", "android", "web"] | The target platforms for the app. |
extra.eas.projectId | "..." | The unique project identifier for EAS. |
Sources: app.json:3-10, app.json:28-30
Platform-Specific Settings
The manifest includes dedicated sections for iOS, Android, and Web configurations.
- iOS:
supportsTablet:truebundleIdentifier:com.phucnguyendev.eefashiondesign
- Android:
adaptiveIcon: Specifies foreground image, background color, and monochrome icon.package:com.phucnguyendev.eefashiondesign
- Web:
favicon:./assets/favicon.png
Sources: app.json:16-27
Android Native Build (build.gradle)
For Android, the android/app/build.gradle file contains native build configurations that are not managed by Expo's app.json. This includes SDK versions and application versioning for the Google Play Store.
Key Build Properties
| Property | Value | Description |
|---|---|---|
compileSdkVersion | 34 | The API level the app is compiled against. |
minSdkVersion | 21 | The minimum Android API level required to run the app. |
targetSdkVersion | 34 | The API level the app is designed to run on. |
versionCode | 1 | The internal version number, must be incremented for each Play Store release. |
versionName | "1.0.0" | The public-facing version string. |
These values are critical for publishing to the Google Play Store and ensuring compatibility with different Android devices.
Sources: android/app/build.gradle:126-133
Environment Configuration
The application manages environment-specific variables, such as API keys for Supabase, through a combination of .env files and a dedicated configuration module. This ensures that sensitive keys are not hardcoded in the source code.
Sources: src/core/config/env.config.js, TASK_4_SUMMARY.md
Loading Environment Variables
The following sequence diagram shows how environment variables are loaded and validated when the app starts.
This process ensures that developers are warned about missing or invalid Supabase credentials during development.
Sources: src/core/config/env.config.js:18-53
Environment Variables
The following variables are defined for runtime configuration:
| Variable | Description | Default Value |
|---|---|---|
SUPABASE_URL | The URL for the Supabase project. | https://riwzkjsbnggcmqnjimsa.supabase.co |
SUPABASE_PUBLISHABLE_KEY | The public anonymous key for Supabase. | sb_publishable_L89YcNI2LfXVM1ItoJlSOg_d_CdMrit |
API_TIMEOUT | Timeout for API requests in milliseconds. | 30000 |
APP_ENV | The application environment (development or production). | Determined by __DEV__ |
Security Note: The SUPABASE_PUBLISHABLE_KEY is a public "anon" key and is safe to include in a client-side application. However, it is best practice to load it from environment variables rather than hardcoding it.
Sources: src/core/config/env.config.js:18-31
Local Development and Scripts
To run the application in a local development environment, the following scripts are provided in package.json.
| Command | Description |
|---|---|
npm install | Installs all project dependencies. |
npm start | Starts the Expo development server. |
npm run web | Runs the application in a web browser. |
npm run ios | Runs the application on an iOS simulator (Mac only). |
npm run android | Runs the application on an Android emulator. |
These scripts are the entry points for developers to test and run the application on different target platforms before creating a formal build with EAS.
Sources: README.md:46-59