← RETURN_TO_SYSTEM
CASE_STUDY_REPORT // SYSTEM_ANALYSIS

Flirtmetrics
Event-Driven Real-Time Matchmaking & Chat Optimization

CLIENT
Dating Startup
TIMELINE
3 Months (2024)
ROLE
Mobile Specialist & Flutter Developer

Measurable Transformation Metrics

<200ms
Chat Latency
from 8.2s delay
60 FPS
UI Frame Rate
stable swiping
+32%
User Retention
post-release analytics
4.8★
App Rating
iOS & Play Store

01 / Executive Summary

Optimized a dating app matchmaking page and real-time chat infrastructure. Resolved critical UI thread blockages causing MATCH cards to freeze on swipe, and reduced chat delivery latency from 8 seconds to near-instantaneous (under 200ms) by replacing HTTP polling with WebSockets.

02 / The Challenge

Flirtmetrics was experiencing severe churn during peak hours. When users swiped match cards, the UI would freeze for up to 1.5 seconds due to synchronous Riverpod state rebuilds of the entire card deck. Simultaneously, chat messages took up to 8 seconds to deliver because the client relied on continuous HTTP short-polling, which overwhelmed the network thread and triggered API rate limits.

03 / Research & Diagnostics

Using Dart DevTools and thread profile diagnostics, we tracked the CPU allocation. We discovered that swiping a single card caused the entire list layout of 50+ matches to re-evaluate and rebuild. On the network side, request logs showed that 92% of the HTTP polling requests returned empty responses, wasting bandwidth and blocking the browser/mobile network queues.

04 / Architecture & Strategy

1. Event-Driven Messaging: Transitioned the app messaging protocol to WebSockets using a lightweight gateway to handle bidirectionally pushed messages.
2. Card-Level Rebuild Isolations: Refactored the swiping deck state to isolate swipe events. Rebuilt only the swiped card instead of the entire deck.
3. Local Database Caching: Integrated a local SQLite cache so chat history loads instantly offline, eliminating remote API dependencies.

05 / Implementation & Solution

Designed and deployed a custom WebSocket client connection manager in Flutter with automatic heartbeat pinging and auto-reconnection fallback logic. Integrated a local synchronization pipeline that queries local database indexes for instant rendering while background threads sync new messages. Rewrote the card swiping widget using Framer-equivalent Flutter animations with isolated state listeners.

06 / Technology Pipeline Stack

FlutterRiverpodWebSocketsSQLiteFirebaseREST API

System Visualizations

Flirtmetrics visual 1
Flirtmetrics visual 2
Flirtmetrics visual 3
Flirtmetrics visual 4
Flirtmetrics visual 5
Flirtmetrics visual 6