Skip to main content
← All Projects
tooling2025–2026active

Perception

3D visualization of how couples see their relationship differently

Overview

Perception started with a question: how can two people in the same relationship describe it so differently? Each partner takes a 32-question quiz across 8 psychological dimensions independently. The scoring engine compares each person's self-perception against how their partner sees them and visualizes the gaps. A React Three Fiber body map renders 400+ colored particles based on Nummenmaa et al. (2014). D3 draws the radar chart as three overlapping layers (self, partner view, meta-perception). Fastify backend with password, magic link, and Google OAuth. Prisma on Postgres, organized as a 6-package Turborepo.

Built With

Next.js
TypeScript
Three.js
D3.js
Fastify
Prisma
PostgreSQL
Zod
Turborepo
Google OAuth

Architecture

Next.js AppFrontend
React Three Fiber3D Body Map
D3.js RadarVisualization
Fastify APIBackend
Scoring EngineShared Package
localStorageSession Cache
Prisma ORMData Layer
PostgreSQLDatabase

Code

packages/shared/scoring.tsts
// Compare self-perception against how your partner sees you,
// per dimension. Lower gap = higher alignment.
export function computeDimensionScores(
  self: Answers,
  partnerView: Answers,
): DimensionScore[] {
  return DIMENSIONS.map((dim) => {
    const selfItems = self.filter((a) => a.dim === dim);
    const viewItems = partnerView.filter((a) => a.dim === dim);

    const selfAvg = mean(selfItems.map((a) => a.value));
    const viewAvg = mean(viewItems.map((a) => a.value));
    const gap = Math.abs(selfAvg - viewAvg);

    return {
      dim,
      self: selfAvg,
      partnerView: viewAvg,
      gap,
      alignment: 1 - gap / 6, // 6-point scale
    };
  });
}

Feeds both the radar chart layers and the 3D body map. Shared across web and server so numbers match exactly.

Key Highlights

01

3D Body Maps

The body map renders 400+ colored particles mapped to body regions via React Three Fiber, inspired by Nummenmaa et al. (2014) research.

02

Radar Visualizations

A multi-layer D3.js radar chart overlays self, partner, and meta-perception scores across 8 dimensions.

03

Research-Backed

The quiz includes 32 questions derived from ECR-R, Gottman, IOS, Sternberg, and Ickes frameworks across 8 psychological dimensions.

04

Triple Auth

Users can sign in via email/password, magic link (Resend), or Google OAuth, with all three methods using JWT refresh tokens.

05

Monorepo

The codebase is organized as a 6-package Turborepo (web, server, db, shared, monitor, scaler) with shared scoring logic and independent deploys.

Perception: 3D visualization of how couples see their relationship differently
Perception: 3D visualization of how couples see their relationship differently

Get in Touch

Want to work together?

Whether you have a project in mind, want to collaborate, or just want to say hi, I'd love to hear from you. Drop me a message and I'll get back to you as soon as I can.