┌─────────────────────────────────────────────────────────┐
│ Flutter App (Dart) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────────┐ │
│ │ Riverpod │ │ GoRouter │ │ Drift DB │ │ RevenueCat │ │
│ │ State │ │ Nav │ │ (SQLite) │ │ SDK │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └─────┬──────┘ │
│ │ │ │ │ │
│ ┌────┴────────────┴────────────┴──────────────┴──────┐ │
│ │ Repository Layer │ │
│ └────┬───────────────┬──────────────┬────────────────┘ │
└───────┼───────────────┼──────────────┼──────────────────┘
│ │ │
┌────▼────┐ ┌──────▼──────┐ ┌───▼────────┐
│Supabase │ │ Mapbox │ │ Firebase │
│ Backend │ │ Maps │ │ (FCM/AI) │
└────┬────┘ └─────────────┘ └───┬────────┘
│ │
┌────▼──────────────────────────────▼──────┐
│ Supabase Edge Functions │
│ ┌──────────────┐ ┌──────────────────┐ │
│ │AWS Rekognition│ │ Gemini Vision AI │ │
│ │(Face Liveness)│ │(Van Photo Check) │ │
│ └──────────────┘ └──────────────────┘ │
└──────────────────────────────────────────┘
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Flutter 3.35 / Dart 3.9 | Cross-platform mobile UI |
| State Management | Riverpod + StateNotifier | Reactive state, dependency injection |
| Navigation | GoRouter | Declarative routing, deep links, shell routes |
| Backend | Supabase (PostgreSQL) | Auth, database, real-time, storage, RLS |
| Edge Functions | Deno (TypeScript) | Serverless compute for AI/verification |
| Maps | Mapbox GL | Route drawing, builder locations, camp scout |
| Payments | RevenueCat SDK | Subscription management, entitlements |
| Push Notifications | Firebase Cloud Messaging | Real-time alerts for connections, messages |
| AI | Google Gemini 2.0 Flash | Van photo analysis, content moderation |
| Verification | AWS Rekognition | Face liveness detection |
| Local DB | Drift (SQLite) | Offline caching |
| Geospatial | PostGIS | Route intersection computation |
lib/
├── app/ # App entry point, MaterialApp
├── core/
│ ├── auth/ # Auth state notifier (Riverpod)
│ ├── config/ # Environment config (.env)
│ ├── network/ # Supabase client provider
│ ├── router/ # GoRouter config, MainShell (7 tabs)
│ ├── services/ # Mapbox, FCM, geocoding services
│ └── widgets/ # Shared widgets (in-app notifications)
├── features/
│ ├── auth/ # Login, register, forgot password
│ ├── matching/ # Discover page (swipe + grid), profile cards, filters (Dating/Friends/Near Me/Routes Cross)
│ ├── connections/ # Connection requests, accepted connections
│ ├── chat/ # Real-time messaging (Supabase Realtime)
│ ├── marketplace/ # Builder profiles (3 types: Nomad/Mobile/Workshop), reviews, community forum, builder onboarding
│ ├── routes/ # Route intersector, wave system (mutual wave → auto-connection), convoy system
│ ├── toolkit/ # Camp Scout (campsites, water, fuel)
│ ├── verification/ # Photo + van verification, trust scores
│ ├── subscription/ # RevenueCat integration, paywall, feature gates
│ ├── profile/ # User profile, edit, location
│ ├── onboarding/ # Multi-step onboarding flow (6–7 steps)
│ ├── search/ # User search with filters
│ ├── settings/ # App settings, blocked users
│ └── ai/ # Gemini AI repository
└── database/ # Drift local database schema
Core Tables (27 tables, all with Row Level Security):
users — 45+ columns: profile, van details, dating
preferences, location, verification status, trust score, subscription
tier
connection_requests — sender/receiver with status
(pending/accepted/declined)
connections — accepted mutual connections enabling chat
messages — real-time chat messages between connections
builder_profiles — business name, builder type
(nomad_builder/mobile_service/workshop), specialties, pricing, service
area, portfolio images, contact info (WhatsApp, phone, website,
Instagram)
builder_reviews — star ratings and text reviews for
builders
community_posts — forum posts (categories: build_help,
showcase, tips, parts_gear)
community_replies — threaded replies on postscommunity_likes — likes on posts and repliesuser_routes — travel routes with PostGIS geometry line
strings
route_intersections — computed spatial/temporal overlaps
between user routes
convoy_requests / active_convoys — convoy
matching system
route_conversations / route_messages —
route-based chat
route_waves — lightweight "wave" interactions on route
matches (mutual wave auto-creates connection via
create_connection_on_mutual_wave RPC)
verification_requests — photo (liveness) and van
verification records
user_reports / user_blocks /
user_vouches — safety infrastructure
user_usage — daily usage tracking for free-tier limits
user_locations — location history for proximity features
purchases_flutter integrated in
bootstrap.dart at app startup
.env (never
hardcoded)
RevenueCatService singleton initializes SDK, identifies
user by Supabase auth ID
pro (configured in subscription
dashboard)
SubscriptionStatus entity with
isPro / isFree computed getters
users.subscription_tier for server-side enforcement
subscriptionProvider → SubscriptionNotifier (manages subscription state)
isProProvider → bool (derived, true if user has 'pro' entitlement)
isFreeProvider → bool (derived, inverse of isProProvider)
dailyUsageProvider → DailyUsageNotifier (tracks free-tier daily limits)
offeringsProvider → FutureProvider<Offerings?> (loads RevenueCat offerings)
Tab-level gating (full-screen lock):
_BuilderLockedView widget shows Pro benefits and opens
paywall
Inline gating (usage limits):
DailyUsageNotifier tracks per-day usage for free-tier
users
ConnectRequestDialog)
CommunityFeedPage)
CampScoutPage)
Content gating (dating photos):
gallery_photos)
_buildPhotoGallery in DiscoverPage)
Dating verification gate:
Paywall:
PaywallPage) loads RevenueCat
offerings
Purchases.purchasePackage()User hits limit → FeatureGate shows upgrade prompt → PaywallPage opens
→ RevenueCat offerings loaded → User selects package → purchasePackage()
→ Google Play billing sheet → Purchase confirmed → CustomerInfo updated
→ subscriptionProvider notified → UI unlocks immediately
| Function | Purpose | Auth |
|---|---|---|
create-liveness-session |
Creates AWS Rekognition Face Liveness session | JWT required |
verify-liveness-result |
Validates liveness result, updates user verification | JWT required |
analyze-van-photo |
Gemini Vision 2.0 Flash analyzes van photo for authenticity | JWT required |
messages table