← Back to Documents

VanMeet — Technical Documentation

High-Level Architecture

┌─────────────────────────────────────────────────────────┐
│                    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) │  │
   │  └──────────────┘  └──────────────────┘  │
   └──────────────────────────────────────────┘

Tech Stack

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

Project Structure

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

Database Schema (Supabase PostgreSQL)

Core Tables (27 tables, all with Row Level Security):

Security: Row Level Security (RLS) enabled on every table. Users can only access their own data. Connection-based access gates chat. Builder profiles are publicly readable.

Subscription Integration Details

SDK Setup

Entitlement Model

Provider Architecture (Riverpod)

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)

Gating Strategy

Tab-level gating (full-screen lock):

Inline gating (usage limits):

Content gating (dating photos):

Dating verification gate:

Paywall:

Purchase Flow

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

Supabase Edge Functions (Deployed)

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

Verification Flow

  1. Photo verification: User takes selfie → ML Kit face detection (client-side) → AWS Rekognition Face Liveness (server-side) → confidence score → auto-approve if >90%
  2. Van verification: User uploads van photo → Gemini Vision AI analyzes for real van presence → confidence score → auto-approve if >85%
  3. Trust score: Base 50 + photo verified (+20) + van verified (+15) + vouches (+2 each, max +20) = max 100

Real-Time Features (Supabase Realtime)

Maps Integration (Mapbox GL)

Key Technical Decisions

  1. Riverpod over Bloc — Chosen for compile-time safety, auto-dispose, and cleaner provider composition across 15+ feature modules
  2. Supabase over Firebase — PostgreSQL with RLS provides row-level security without cloud functions for every query; real-time subscriptions built-in
  3. Subscription SDK over raw billing — Abstracts platform billing complexity; single entitlement check works across Android/iOS; dashboard analytics for monetization tracking
  4. PostGIS for routes — Native geospatial queries for route intersection computation; ST_Intersection and ST_Buffer for overlap detection
  5. Edge Functions for AI — Keeps API keys server-side; Deno runtime with Web Crypto API for AWS SigV4 signing