Full-Stack & Real-Time Systems
GlanceSync: Angular & PostGIS Matchmaking Platform
A full-stack dating and matchmaking platform with geospatial recommendations, real-time chat, live notifications, and WebRTC audio and video calls.
Last updated:

Introduction
GlanceSync is a full-stack dating and matchmaking platform built with Rida Rhnizar for the Matcha project at 1337 Coding School and 42. It covers the complete journey from secure account creation and profile setup to intelligent discovery, mutual matching, real-time communication, and planning a date.
Users build customizable profiles with interests and galleries of up to five photos, edited with drag-and-drop uploads, cropping, rotation, zoom, and filters. They can discover people through recommendations, advanced search and sorting, or an interactive OpenStreetMap view, then chat, call, and send date proposals with invitation, acceptance, decline, and cancellation workflows. Blocking, account reporting, and an administration panel support moderation.
The problem
Matcha asks for a dating platform where people find compatible matches nearby and talk to them in real time, built on hand-written SQL rather than an ORM. A good suggestion depends on several signals at once, including two-way gender and orientation compatibility, distance, shared interests, and popularity, and it must exclude anyone the viewer has blocked while staying fast across hundreds of profiles.
Once two people match, the experience has to feel live: messages, read states, presence, notifications, and calls must arrive instantly in every open tab, while sensitive data such as exact locations, credentials, and uploaded photos stays protected.
Architecture
The frontend is a responsive Angular 19 application written in TypeScript with server-side rendering, using Leaflet and OpenStreetMap for the map experience. The backend is a modular Java 17 API built on Spark Java and plain JDBC without an ORM, backed by PostgreSQL with PostGIS for spatial queries, and documented with OpenAPI/Swagger.
Inside the backend, a custom annotation-based router and a small dependency container sit on top of Spark Java's embedded Jetty server. Each module (auth, profiles, discovery, likes, fame, chat, calls, events, reports, and admin) keeps its controllers, services, and DAOs separate from the HTTP layer, HikariCP pools the JDBC connections, and the OpenAPI document is generated directly from the registered routes.
A single authenticated WebSocket connection powers chat, read states, presence indicators, unread counters, live notifications, and WebRTC call signaling across multiple browser tabs and devices, with STUN and TURN support for peer-to-peer audio and video. The stack runs with Docker Compose alongside Nginx, and GitHub Actions deployment pipelines include health checks and automatic rollback.
Implementation decisions
- Ranking inside one PostGIS query
- Recommendations are scored in SQL: 10 points per shared interest, plus 0.1 per fame point, minus 0.1 per kilometer up to 200 km. People within 50 km or in the same city come first, and filters, sorting, and pagination are added to the same query, so the database does the heavy lifting instead of the application.
- Distance filters that use the spatial index
- Distance limits are expressed with ST_DWithin rather than by comparing ST_Distance, which lets PostgreSQL answer them from the GiST index instead of measuring every row.
- Fame computed from real activity
- The fame rating is recomputed in SQL from profile views, active likes, mutual connections, and reports, so it reflects how people actually interact and cannot be edited by the user.
- A lightweight, hand-built web layer
- The backend started on Micronaut and was migrated to Spark Java with a custom router and dependency container. That kept the stack small and every request path explicit, while annotations keep controllers as readable as they would be in a larger framework.
- One real-time channel per tab
- Chat, presence, notifications, unread counters, and call signaling share one authenticated WebSocket instead of a connection per feature, which keeps state consistent across tabs and devices. Audio and video travel directly between browsers, and a TURN relay is used only when peers cannot connect directly.
- Security and privacy by default
- Only hashes of verification, reset, and refresh tokens are stored, access and refresh JWTs have separate types and lifetimes, uploads are identified by file signature rather than headers, blocked users are excluded from discovery, chat, calls, and notifications, and map markers show approximate locations.
- A single public origin
- Nginx serves the SSR frontend, the API, and the WebSocket from one origin. That keeps HttpOnly refresh cookies working and meets the HTTPS requirement browsers impose on camera and microphone access.
Technical challenges
- Writing the matching engine as hand-written spatial SQL that combines two-way orientation compatibility, geographical proximity, shared interests, fame rating, filtering, and blocking rules
- Multiplexing chat, presence, notifications, unread counters, and call signaling over one authenticated WebSocket connection shared across tabs and devices
- Establishing reliable peer-to-peer audio and video calls with WebRTC, STUN, and TURN
- Securing the platform with JWT access tokens, HttpOnly refresh-token cookies, BCrypt, email verification, password recovery, strong password validation, and OAuth with 42, Google, and Facebook
Results
- Personalized recommendations computed in a single query, with filters by age, distance, city, fame, and interests and sorting on each of them
- Chat, presence, notifications, and unread counters synchronized live across tabs and devices
- Peer-to-peer audio and video calls that fall back to a TURN relay on restrictive networks
- A seeded dataset of 500 profiles to exercise discovery and the map at a realistic scale
- Every push to main deploys automatically, with a health check and an automatic rollback to the previous release if it fails
Demo video
Related case studies
Full-Stack & Media Streaming
Filmexa: Angular & Spring Boot streaming platform
A full-stack movie discovery and streaming platform with torrent-based downloads, adaptive HLS playback, and on-the-fly FFmpeg transcoding.
Containers & Infrastructure
Inception: Dockerized NGINX, WordPress & MariaDB stack
A three-container web stack, NGINX with TLS, WordPress on PHP-FPM, and MariaDB, built from Debian images with Docker Compose and persistent volumes.
Kubernetes & GitOps
Inception of Things: K3s & Argo CD GitOps lab
A Kubernetes and GitOps lab: K3s clusters provisioned with Vagrant, hostname-based ingress routing, and continuous delivery with K3d and Argo CD.