Back to case studiesLoveline app iconCase study · Full-stack AI product

Loveline: An AI Matchmaking Dating App, from Backend to App Store

How I designed and built a premium iOS dating app end to end: the swipe-and-chat UI, six backend services, an AI matchmaker that turns a free-text request in English or Chinese into ranked matches, and the build pipeline that ships it to iPhone.

Product
Loveline iOS app (my own product)
Role
Solo: product, UI, backend, AI, deployment
Stack
React · Capacitor · NestJS · FastAPI · Supabase · Redis
Models
GPT-4o (structured output) + rule-based scoring
00 · Overview

Four layers: iOS client, services, AI matchmaker, and delivery

Loveline is for people looking for a serious relationship. On top of the usual swipe and chat, it adds verified professional identity, a Family Circle where relatives can endorse a profile, and an AI matchmaker. One codebase serves the iPhone app and the web.

Swipes and messages · Profile, photo and verification uploads · Free-text match requests (EN / 中文)
1 · iOS client
One React codebase, shipped as a native iPhone app
React 19 + TypeScript + ViteCapacitor 8 iOS shellFramer Motion swipe cardsNative Google Sign-In + RevenueCat
2 · Backend services
Small NestJS services with clear boundaries
Read the guide
auth · user · swipe · match · paymentSupabase Postgres (system of record)Redis: mutual-match sets + BullMQ queueSocket.IO real-time chat
3 · AI matchmaker
The model reads the request; code ranks the people
Read the guide
FastAPI service (Python)GPT-4o → structured criteriaHard filters in SQLWeighted, explainable score
4 · Delivery
From commit to a running backend and an iPhone build
Docker multi-stage buildsRender + Nginx gatewaySupabase Storage signed URLsXcode build → TestFlight
Mutual like → match → live chat
AI picks with a match score
Premium unlocked via in-app purchase
Verification → admin review
01 · Context

A dating app for people who want something serious

Mainstream swipe apps are optimized for volume. Loveline is built for users who care about who someone is, what they do, and whether their families would get along. That shaped every part of the product.

Discover
A swipe feed of profiles. A like on both sides becomes a match, and the match opens a real-time chat.
Trust
Professional verification: users upload a credential document, it's stored privately, and an admin approves or rejects it before the badge appears.
Family Circle
Users invite family members with a one-time link (valid 7 days). Family members fill in their own profile, and their endorsement is shown to potential matches.
AI matchmaker
Describe who you're looking for in plain English or Chinese, and get a ranked list of people with a match score.
Premium
Subscriptions through Apple in-app purchase, synced to the backend so every service knows who is premium.
Loveline AI Matchmaker promotional artwork

AI Matchmaker

Loveline “Connect with real people” artwork showing verified, active profiles

Verified, active profiles

Loveline Family Verification artwork with ID, career and family checks

Family verification

Launch artwork for the three ideas the product is built around.

Who it's for

Primary · 25–38
The ambitious professional

College-educated, working in tech, finance, medicine, or law. Wants a serious partner and doesn't trust unverified profiles.

Secondary · 50–65
The involved parent

Wants to help their child find a trustworthy match, and feels left out of modern dating apps.

Tertiary · 25–40
The cross-cultural seeker

Bilingual or multicultural, open to cross-cultural relationships, but values shared family norms.

vs. Hinge · Shaadi · The League
Where it differs

Swipe discovery like Hinge, plus ID, degree, and license verification and family endorsement, which no single competitor combines.

I built it alone, so the architecture had to be simple enough for one person to run, while keeping boundaries clean enough that any one piece (chat, matching, payments) could be scaled or replaced on its own.

02 · Walkthrough

One match request, two designs

A user types (illustrative):

“帮我找洛杉矶附近、1.8米以上、阳光、喜欢运动的男生,30岁左右。”
Filter-only dating app
The user does the translating
  1. 01User opens a filter screen with sliders and checkboxes
  2. 02Has to map “30岁左右” and “1.8米” to exact numbers
  3. 03No place for “阳光” or “喜欢运动” beyond a tag list
  4. 04Results come back unranked, sorted by distance
Loveline AI matchmaker
Model parses, code ranks
  1. 01GPT-4o → { location: Los Angeles, max_distance_km: 80, height_min_cm: 180, interests: [sports], personality: [sunny] }
  2. 02SQL applies hard filters: not yourself, height ≥ 180, location matches
  3. 03Each candidate scored: interests 40, height 20, location 20, age 20
  4. 04Top results returned with their score and the parsed criteria

The model never decides who you see. It only turns words into structured criteria; filtering and ranking are plain, testable code.

03 · Layer 1 — iOS client

One React codebase, a native iPhone app

Instead of writing the UI twice, the app is a React single-page app wrapped in a native iOS shell with Capacitor. Native features (Google Sign-In, Apple in-app purchase) come through Capacitor plugins.

Capacitor shell
vite build → cap sync → Xcode

The same build runs in a browser for development and inside a native iOS container for the App Store, with no separate Swift UI.

Swipe & micro-interactions
Framer Motion drag + spring

Cards follow the finger, tilt, and snap away with physics, which is what makes a swipe app feel native.

Persistent login
1h access token · 90-day refresh

Every API call goes through one fetch wrapper. On 401/403 it refreshes the token once (deduplicated) and retries, so users stay signed in for months.

Native purchases
RevenueCat Capacitor SDK

Apple subscriptions are bought natively; the backend verifies the entitlement and writes is_premium so every service can trust it.

Loveline sign-in screen with Google Sign-In

Sign in

Discovery card for a verified professional with a 95% match score

Discovery

Likes screen with mutual likes, sent likes and saved profiles

Likes

Messages screen with new matches and family referrals

Matches & referrals

Chat between two matched, credential-verified users

Chat

Premium paywall offering a 14-day free trial

Premium

My Profile screen with premium status and family management

Profile

Screen designs for the iOS app. Note the “Referred by Mother” tags in Messages: Family Circle referrals sit next to regular matches.
04 · Layer 2 — Backend services

Six services, one database, Redis where speed matters

Five NestJS services (auth, user, swipe, match, payment) and one Python AI service sit behind an Nginx gateway. Supabase Postgres is the single source of truth; Redis is only used where it clearly helps, and every Redis path has a Postgres fallback.

auth
Email and Google sign-in, token refresh, and the Family Circle record.
user
Profiles, photos, education, and verification uploads. Photo processing runs in a BullMQ queue so uploads return immediately.
swipe
Records every swipe (pass, like, or Super Like) and detects a mutual like in constant time with Redis sets. Already-swiped profiles are excluded from the discovery feed.
match
Match list and messages, with Socket.IO for real-time chat between matched users.
payment
Syncs RevenueCat subscription status into the profile.
ai-chatbot
FastAPI service for the AI matchmaker; reads profiles from Supabase.
async recordLike(me: string, target: string): Promise<{ matched: boolean }> {
  await this.db.insert("swipe_events", { user_id: me, target_id: target, action: "like" })

  let mutual: boolean
  try {
    await this.redis.sadd(`user:${target}:liked_by`, me)
    await this.redis.expire(`user:${target}:liked_by`, NINETY_DAYS)
    mutual = (await this.redis.sismember(`user:${me}:liked_by`, target)) === 1
  } catch {
    mutual = await this.db.exists("swipe_events", { user_id: target, target_id: me, action: "like" })
  }

  if (mutual) await this.db.insert("matches", { user_a_id: me, user_b_id: target, is_mutual: true })
  return { matched: mutual }
}
Mutual-match detection (simplified). Redis makes the check instant (under 150 ms end to end); Postgres keeps it correct when Redis is down.
05 · Layer 3 — AI matchmaker

Let the model read, let code decide

The AI service has one narrow job for the model: read a messy, bilingual request and return structured criteria. Everything after that is deterministic, so a match score can always be explained and tested.

Structured output
response_format: json_object · temperature 0

GPT-4o returns a fixed schema (height, age, location, distance, interests, personality), validated with Pydantic before use.

Bilingual normalization
1.8米 → 180 · 洛杉矶附近 → LA, 80 km

Units, city names, and interests are converted to English keywords, so Chinese and English requests hit the same data.

Hard filters in SQL
height ≥ min · location ILIKE

Non-negotiable criteria are applied in the database query, so a candidate who doesn't qualify is never ranked.

Weighted score
interests 40 · height 20 · location 20 · age 20

Each factor gives full, partial, or no credit (for example, a few centimeters short still earns some points). No preference stated means full marks.

WEIGHT_HEIGHT, WEIGHT_INTERESTS, WEIGHT_LOCATION, WEIGHT_AGE = 20, 40, 20, 20

async def recommend(query: str, user_id: str, limit: int = 5) -> RecommendResponse:
    criteria = await parse_preferences(query)          # GPT-4o -> ParsedCriteria (Pydantic)
    rows = profiles_query(criteria, exclude=user_id)   # hard filters in SQL
    scored = sorted(
        ((score_height(r, criteria) + score_interests(r, criteria)
          + score_location(r, criteria) + score_age(r, criteria), r) for r in rows),
        key=lambda pair: pair[0], reverse=True,
    )
    return RecommendResponse(
        parsed_criteria=criteria,                     # shown back to the user
        candidates=[to_candidate(r, s) for s, r in scored[:limit]],
        total_found=len(rows),
    )
Ranking (simplified from the production service). The model is out of the loop by this point.
Model picks people

Send every profile to the LLM and ask it who is the best match.

The model only parses the request. Ranking is code: cheap, fast, and the same input always gives the same result.

Lost in translation

“阳光、喜欢运动” matches nothing because profiles are tagged in English.

The parser maps Chinese terms to a shared English vocabulary before any lookup.

Unexplainable scores

A user asks why someone was recommended, and there's no answer.

Every score is a sum of four named parts, and the parsed criteria are returned with the results.

06 · Layer 4 — Delivery

From commit to a running backend and an iPhone build

Containers
Docker multi-stage builds on node:22-alpine keep images small. Every service listens on one PORT variable, so the same image runs locally, in Docker Compose, and on Render.
Gateway
Nginx routes /api/v1/* to the right service and upgrades /socket.io connections for chat, with JSON access logs for debugging.
Photos & documents
Uploads go straight to Supabase Storage with signed URLs; verification documents stay in a private bucket for admin review.
iOS release
vite build → cap sync → Xcode archive → TestFlight, including developer certificates and provisioning profiles, with App Store review fixes handled in the same codebase.

One production bug worth noting: services crashed at startup on Render because the Supabase realtime client needed a WebSocket implementation that Node 20 didn't provide. Moving the images to Node 22 fixed it without adding a polyfill.

07 · Trade-offs

Decisions I made, and what they cost

Native Swift vs. React + Capacitor

Rejected: a separate Swift app. Best native feel, but two UIs to build and maintain alone.

Chosen: one React codebase in a native shell. Some animation tuning needed, but web and iOS ship together.

One server vs. services

Rejected: a single backend that does everything. Simple at first, but chat, payments, and AI scale differently.

Chosen: small services sharing one Postgres. More deployment config, clear boundaries.

Redis as truth vs. Redis as speed

Rejected: keep likes only in Redis. Fast, but a flush would lose matches.

Chosen: Postgres stores every swipe; Redis only speeds up the check, with a fallback.

LLM ranking vs. rule-based ranking

Rejected (for now): let GPT-4o rank candidates. Richer, but slow, costly, and hard to explain.

Chosen: GPT-4o for parsing, rules for ranking. The next step adds semantic matching on top, not instead.

08 · Results & next steps

What's built, and what's next

  1. 01A complete iOS dating app built by one person: swipe discovery, real-time chat, verification, Family Circle, and premium subscriptions.
  2. 02Six backend services on one Postgres database, with Redis used only where it adds speed and always backed by a fallback. Match detection completes in under 150 ms end to end.
  3. 03An AI matchmaker that understands requests in English and Chinese and returns ranked, explainable matches.
  4. 04Next: two-way intent matching. Each user writes what they're looking for; GPT-4o turns it into an intent profile stored as an embedding in pgvector, and a pair is scored in both directions (does B fit A, and does A fit B), so one-sided matches rank lower.
  5. 05Then: a short, cached explanation for each match (“you both value family involvement and outdoor weekends”), shown on the profile.

Building an AI product from zero to App Store?

I can take it end to end: product, UI, backend, AI, and the release pipeline, or join your team for the hardest part.

Talk through your product