Requirements
- Node.js 20 LTS and npm
- Expo CLI via
npx expo(project uses Expo SDK 56) - Git
- Android: Android Studio, JDK 17, Android SDK (for emulator or local APK builds)
- iOS (macOS only): Xcode 15+, CocoaPods, Apple Developer account for device/store builds
- Running MelodAI Laravel API (local XAMPP or production HTTPS server)
Project path: melodai-app/ (sibling to Laravel root). Package: com.melodai.app, scheme: melodaiapp.
Step 1: Install Dependencies
cd melodai-appnpm installVerify Expo version:
npx expo --versionStep 2: Configure Environment
Copy and edit melodai-app/.env.example → .env:
copy .env.example .envEXPO_PUBLIC_API_URL=http://localhost/melodai/public/api/v1Rules:
- Use the Laravel API base including
/api/v1(no trailing slash). - Physical phone on same Wi‑Fi: replace
localhostwith your PC IPv4 fromipconfig/ifconfig. - Release APK/AAB must use HTTPS production URL — Expo Go can infer LAN; release builds cannot.
Examples:
EXPO_PUBLIC_API_URL=http://192.168.1.10/melodai/public/api/v1EXPO_PUBLIC_API_URL=https://melodai.site/api/v1After changing .env, restart Metro with cache clear: npx expo start -c. Production builds bake the URL via app.config.js → extra.apiUrl.
Step 3: Run with Expo Go
npx expo start- Install Expo Go on your phone (SDK 56 compatible version).
- Scan the QR code from the terminal (same network as dev machine).
- Press
afor Android emulator orifor iOS simulator (macOS).
Windows Development
Prerequisites
- Install Android Studio → SDK Platform 34+, Build-Tools, Android Emulator.
- Set
ANDROID_HOME(e.g.C:\Users\You\AppData\Local\Android\Sdk). - Add
platform-toolsto PATH.
Start Laravel API (from project root):
composer run devStart Expo:
cd melodai-app && npx expo startRun native Android project (dev client / release build):
npx expo run:androidmacOS & iOS Development
xcode-select --installcd melodai-app && npx expo run:iosFor App Store builds, configure signing in Xcode (ios/ folder after prebuild) with your Apple Team ID.
Linux Development
- Install Node 20, Watchman (optional), Android SDK for emulator.
- Use production or LAN API URL in
.env.
cd melodai-app && npx expo startnpx expo run:androidProduction API Configuration
Before any store or APK release:
- Deploy Laravel with HTTPS and valid SSL.
- Confirm API works:
https://yourdomain.com/api/v1/... - Set
EXPO_PUBLIC_API_URL=https://yourdomain.com/api/v1inmelodai-app/.env. - Rebuild native app (EAS or local Gradle) so env is embedded.
YouTube connect from mobile requires Google OAuth redirect registered for production HTTPS (see Providers doc).
EAS Build (Recommended for Production)
Expo Application Services builds signed APK/AAB in the cloud. Install EAS CLI and log in:
npm install -g eas-clieas logincd melodai-app && eas build:configureSet production env in eas.json or EAS secrets:
eas secret:create --name EXPO_PUBLIC_API_URL --value https://melodai.site/api/v1Build Android APK (preview) or AAB (Play Store):
eas build --platform android --profile previeweas build --platform android --profile productioniOS:
eas build --platform ios --profile productionUpdate app.json → extra.eas.projectId with your EAS project ID after linking.
Local Android APK (Gradle)
Generate native Android project and build release APK locally:
cd melodai-appnpx expo prebuild --platform androidcd android && .\gradlew assembleReleaseAPK output (typical path):
melodai-app/android/app/build/outputs/apk/release/app-release.apkSigning: create a keystore and configure android/app/build.gradle signingConfigs for Play Store uploads.
If CMake/NDK errors occur on Windows, clean android/.cxx and run gradlew clean before rebuild.
Store Release Checklist
- Production
EXPO_PUBLIC_API_URLbaked into build - App icons and splash assets in
assets/images/ - Version bumped in
app.json(version, AndroidversionCode) usesCleartextTrafficdisabled for production HTTPS-only (updateapp.jsonandroid section)- Privacy policy URL and store listing prepared
- Test login, registration, music generation, and profile on release build
Troubleshooting (Mobile)
- App shows welcome instead of home after login (APK): ensure production API URL is set before build; clear app data and reinstall.
- Network request failed: API unreachable — check URL, HTTPS cert, and firewall; on LAN use PC IP not localhost.
- YouTube OAuth blocked: register correct redirect URI in Google Cloud; use server-side connect flow.
- Expo Go works but APK fails: release build missing
EXPO_PUBLIC_API_URL— rebuild with env set. - Metro cache issues:
npx expo start -c