March 10 Production Readiness

Push notifications, auth migration, deploy separation, Flutter app fixes. 8 areas resolved.

Issues Resolved

AreaIssueFixStatus
Push NotificationsSilent notifications (no sound)Added sound: "default" to APNs payloadFixed
Push NotificationsSuper admins not receiving pushesAdded super_admin to 4 API routesFixed
Push NotificationsNo repeat alerts for unacknowledged orders30-second repeat timer + in-app bannerFixed
Auth Migration77 Firebase users missing from prodMigration scripts created and runFixed
Admin AccessNo admins on production databaseNicky, Ariane, Nelson set as super_adminFixed
DeploymentStaging and prod deployed togetherSeparate deploy scripts createdFixed
Flutter AppRestaurant list not scrollableDraggableScrollableSheet in settingsFixed
Flutter AppAlert sound continues after logoutClear polling/timers on sign outFixed

Push Notification Flow

1
Customer places order on ricoya.net
2
Payment status route queries assignments (staff) + users (admin/super_admin)
3
Staff get “New order!” • Admins get “New order · Restaurant Name”
4
APNs push with sound → Flutter app shows banner + “Order! Order! Order!” TTS
5
If unacknowledged, repeat alert every 30 seconds until order is accepted

APNs Key Configuration

EnvironmentKey IDAPNs HostUsed By
ProductionG3BHXM2HW6api.push.apple.comTestFlight, App Store, ricoya-live
SandboxXZZ44W7RYRapi.sandbox.push.apple.comXcode debug builds, staging

Production key cannot send to sandbox APNs (returns BadEnvironmentKeyInToken). Each environment requires its matching key and endpoint.

Deploy Workflow

deploy-staging.sh
Rsyncs to /opt/ricoya, builds, restarts pm2 ricoya. Serves staging.ricoya.net on port 3000.
deploy-prod.sh
Rsyncs to /opt/ricoya-live, builds, restarts pm2 ricoya-live. Serves ricoya.net on port 3001.

Note: .env.local is never synced. Cloudflare proxy must remain ON (SSL uses Origin cert).

Flutter App Changes (v1.0.1)

FileChange
AppDelegate.swiftForward push data (title, body, userInfo) to Flutter instead of nil
orders_provider.dart30s repeat alert timer, in-app banner flag, clear on logout
settings_screen.dartScrollable restaurant picker (DraggableScrollableSheet)
login_screen.dartIncreased TabBarView height to fix email text cutoff
theme.dartWhite bottom sheet (overrides Material 3 pinkish tint)
new_order_banner.dartNew widget — orange banner overlay, shows 5s on alert fire
main.dartStop OrdersProvider polling on sign out
Push Notification Fixes — Full Details
Independent Deploy Scripts
Production Auth Migration
Back to Ricoya