System Case Study
Chemistry.IRL Matchmaker
Fastify 5 + TypeScript + Expo App
Fastify 5TypeScriptPostgreSQL
RoleFreelance Full-Stack Developer
Duration3 Months
ContextSocial Platform Scaling
Main StackFastify 5 • TypeScript • Drizzle ORM
01
The Concept & Purpose
A production-grade social dating platform backend and universal mobile client. The backend features a strict three-layer architecture (routes → services → repositories) handling 132 endpoints across 36 core services.
02
Architecture & Data Routing
Routing LayerFastify 5 thin routes parsing query/body payloads
↓
Logic LayerService domain layers throwing custom HTTP exceptions
↓
DB LayerRepositories hosting all raw Drizzle expression objects
↓
Client LayerExpo (React Native) app with file-based routing
03
Toughest Challenge & Hard Decision
Migrating business logic from a legacy React admin dashboard without causing regressions or duplicating complex matchmaking queries. I isolated all Drizzle queries into dedicated repositories, creating a clean service API layer utilized by both Admin portals and the mobile app.
Technical Snippet Overview
chemistry-irl.snippet
// Fastify 5 + TypeScript 3-layer architecture repository query
export class MatchmakingRepository {
private readonly db: PgDatabase;
async findMutualMatches(userId: string, limit: number): Promise<Match[]> {
return this.db
.select()
.from(matchesTable)
.where(
and(
eq(matchesTable.status, 'mutual'),
or(eq(matchesTable.userOneId, userId), eq(matchesTable.userTwoId, userId))
)
)
.limit(limit)
.execute();
}
}Systems Specs Registry
endpoints132 REST API routes
services36 decoupled domains
DBDrizzle ORM execution
Implementation Features
- ✓Fully typed, strict CommonJS build pipeline with ts-alias paths
- ✓Supabase S3-compatible file upload management via Fastify multipart
- ✓Access verification middlewares protecting admin and user pathways
- ✓Drizzle migration runner initializing PostgreSQL cloud database tables
Technologies
Fastify 5TypeScriptDrizzle ORMPostgreSQLExpo React Native

