⚠️ Stop! Before You Deploy
Make sure you have tested the app locally and configured Firebase correctly. Deploying without proper testing can result in broken functionality and frustrated users.
Make sure you have tested the app locally and configured Firebase correctly. Deploying without proper testing can result in broken functionality and frustrated users.
Quick Pre-Flight Checklist
Complete these essential items before proceeding with deployment:
✅ All items checked? Great! You're ready to deploy.
Deployment Overview
This guide covers deploying all components of Missão:
Android App
Deploy to Google Play Store
iOS App
Deploy to Apple App Store
Admin Panel
Deploy to Firebase Hosting
Cloud Functions
Deploy backend services
Pre-Deployment Checklist (Detailed)
Before deploying: Ensure all these items are completed.
Configuration
- ✓ Production environment file (
.env.prod) configured - ✓ Firebase project set to production
- ✓ Google Maps API keys configured with production restrictions
- ✓ SendGrid configured with verified domain
- ✓ All debug flags disabled (
ENABLE_DEBUG_LOGS=false)
Branding
- ✓ App name updated
- ✓ App icons replaced (all sizes)
- ✓ Splash screen customized
- ✓ Theme colors configured
Testing
- ✓ All unit tests passing (
flutter test) - ✓ Manual testing completed on real devices
- ✓ Admin panel tested with real data
Deploy Admin Panel (Web)
Step 1: Build the Web App
# Build for production
flutter build web --release --dart-define-from-file=.env.prod
# Optional: Optimize with tree shaking
flutter build web --release --dart-define-from-file=.env.prod --web-renderer html
Step 2: Configure Firebase Hosting Target
# Set up hosting target (first time only)
firebase target:apply hosting admin YOUR_PROJECT_ID
Step 3: Deploy to Firebase Hosting
# Deploy only hosting
firebase deploy --only hosting:admin
# Or deploy everything
firebase deploy
Step 4: Verify Deployment
Your admin panel will be available at:
- Default:
https://YOUR_PROJECT_ID.web.app - Custom domain (if configured):
https://admin.yourdomain.com
Custom Domain Setup
- Go to Firebase Console → Hosting
- Click "Add custom domain"
- Enter your domain (e.g.,
admin.yourdomain.com) - Add the provided DNS records to your domain registrar
- Wait for SSL certificate provisioning (usually 24 hours)
Deploy Cloud Functions
Step 1: Verify Functions Build
cd functions
npm run lint
npm run build
cd ..
Step 2: Deploy Functions
# Deploy all functions
firebase deploy --only functions
# Deploy specific function
firebase deploy --only functions:inviteAdmin,functions:validateAdminAccess
# Deploy with environment config
firebase functions:config:set app.admin_url="https://admin.yourdomain.com"
firebase deploy --only functions
Step 3: Verify Deployment
# Check function logs
firebase functions:log
# Check specific function
firebase functions:log --only inviteAdmin
Cold starts: First invocation after deployment may be slow. Consider using min instances for critical functions.
Deploy Android App
Step 1: Update Version
Edit pubspec.yaml:
version: 1.0.0+1 # Format: version_name+version_code
Step 2: Build Release APK/Bundle
# Build APK (for testing)
flutter build apk --release --dart-define-from-file=.env.prod
# Build App Bundle (for Play Store - recommended)
flutter build appbundle --release --dart-define-from-file=.env.prod
Output files:
- APK:
build/app/outputs/flutter-apk/app-release.apk - Bundle:
build/app/outputs/bundle/release/app-release.aab
Step 3: Create Play Console Listing
- Go to Google Play Console
- Click "Create app"
- Fill in app details:
- App name
- Default language
- App or game
- Free or paid
- Complete all required sections in the dashboard
Step 4: Upload to Play Store
- Go to Release → Production
- Click "Create new release"
- Upload the
.aabfile - Add release notes
- Review and roll out
Required Store Listing Assets
| Asset | Specifications |
|---|---|
| App icon | 512 x 512 px, PNG |
| Feature graphic | 1024 x 500 px, PNG/JPEG |
| Phone screenshots | Min 2, 16:9 or 9:16 aspect ratio |
| Tablet screenshots | Optional but recommended |
| Short description | Max 80 characters |
| Full description | Max 4000 characters |
Deploy iOS App
Step 1: Update Version
Edit pubspec.yaml:
version: 1.0.0+1
Step 2: Configure Xcode Project
- Open
ios/Runner.xcworkspacein Xcode - Select Runner target
- Set version and build number in General tab
- Configure signing (select your Team)
- Set deployment target (iOS 12.0+)
Step 3: Build for Release
# Build iOS release
flutter build ios --release --dart-define-from-file=.env.prod
Step 4: Archive and Upload
- Open Xcode
- Select Product → Archive
- Wait for archive to complete
- In Organizer, click "Distribute App"
- Select "App Store Connect"
- Follow the wizard to upload
Step 5: Configure App Store Connect
- Go to App Store Connect
- Click "My Apps" → "+" → "New App"
- Fill in app information
- Complete all required sections
- Submit for review
Required App Store Assets
| Asset | Specifications |
|---|---|
| App icon | 1024 x 1024 px, PNG (no alpha) |
| iPhone screenshots | 6.5" (1284 x 2778) and 5.5" (1242 x 2208) |
| iPad screenshots | 12.9" (2048 x 2732) |
| App preview video | Optional, 15-30 seconds |
| Description | Max 4000 characters |
| Keywords | Max 100 characters |
| Privacy Policy URL | Required |
App Review: Apple reviews typically take 24-48 hours but can take longer. Ensure your app complies with App Store Guidelines.
Deploy Security Rules
Firestore Rules
firebase deploy --only firestore:rules
Storage Rules
firebase deploy --only storage
Verify Rules
Test your security rules in Firebase Console → Firestore → Rules → Rules Playground
Post-Deployment
Monitoring
- Firebase Console: Monitor authentication, database, and function usage
- Crashlytics: Monitor app crashes and errors
- Analytics: Track user engagement and behavior
- Performance: Monitor app and network performance
Set Up Alerts
- Go to Google Cloud Console → Monitoring
- Create alerting policies for:
- Function errors
- High latency
- Budget thresholds
Backup Strategy
Set up automated Firestore backups:
# Enable Firestore exports (requires Blaze plan)
gcloud firestore export gs://YOUR_BACKUP_BUCKET --async
Continuous Deployment (Optional)
GitHub Actions for Web
# .github/workflows/deploy-web.yml
name: Deploy Admin Panel
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.0'
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Build web
run: flutter build web --release --dart-define-from-file=.env.prod
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: live
projectId: YOUR_PROJECT_ID
GitHub Actions for Functions
# .github/workflows/deploy-functions.yml
name: Deploy Cloud Functions
on:
push:
branches: [main]
paths: ['functions/**']
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: cd functions && npm ci
- name: Lint
run: cd functions && npm run lint
- uses: w9jds/firebase-action@master
with:
args: deploy --only functions
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
Next Steps
After deployment:
- Customization - Further customize your app
- FAQ - Common questions and troubleshooting