Matcha
Because love, too, can be industrialized
A dating site in a monorepo: an Express API, a single-page React application, and a PostgreSQL database where every SQL query is written by hand. The subject rules out ORMs, validators and account managers: sign-up, email verification, login and tokens are all our own code.
- Area
- 42
- web
- fullstack
- Stack
- TypeScript, React, Node.js, Express, PostgreSQL, Socket.IO, WebRTC
- Grade
- 125%
- Date
- 2026
New ways to meet
A dating site built as a monorepo: an Express API, a React single-page application, and a PostgreSQL database whose every query is written by hand. Twenty-two tables, twelve migrations, fifty-five HTTP routes, and a seed of 550 demonstration profiles.

The constraint
The subject allows a micro-framework and defines it narrowly: a router, optionally templating, but no ORM, no validators, no user account manager. Express qualifies. Everything that definition removes had to be written. Each SQL query sits in a *.repo.ts file, and registration, email verification, login, tokens and their renewal are all our own code. The one layer above the pg driver measures query time and joins transactions; it generates no SQL.
One contract, both sides
A third workspace holds the Zod schemas for every exchange, REST and Socket.IO alike, and is imported by the API and by the front end. A validation rule is written once and cannot drift between the two. On the server a middleware applies the matching schema to the body, params or query before the controller runs, so no route ever sees unvalidated data. The client’s own validation is a display convenience, since anyone can send a request without going through the form.


Security
Passwords are hashed with bcrypt: salted per password, deliberately slow, compared in constant time, and refused outright when they appear in a dictionary, in four languages. Against XSS, React escapes by default and dangerouslySetInnerHTML appears nowhere in the project, with Helmet’s headers and httpOnly cookies behind that. SQL injection is closed by parameterised queries, where the value travels beside the statement rather than inside it. The one place text has to be concatenated is the ORDER BY of the discovery feed, and it comes out of a switch that can only return literals written in the source.
Because the auth cookies are httpOnly, and therefore safe from theft, the browser attaches them to any request, including one a hostile site triggers. Hence a double-submit cookie: the server plants a random token in a readable cookie and demands it back in a header, which a third-party site can make the browser send but cannot read in order to copy. Constant-time comparison, sameSite: strict, no server-side state, and the check sits ahead of every route, so a route added later is protected without anyone remembering to protect it.




Uploads
The step evaluators push hardest on. Nothing reaches the disk before it has been validated: the file stays in memory, Multer caps size and count, and the declared MIME type is a first pass only, since the client can lie about it. The real control is re-encoding through sharp. The image is decoded and written back out as WebP, and a script renamed .jpg has no image to decode. The stored name is 128 random bits plus an extension, which closes path traversal, special characters, overwriting and URL enumeration in one move.

The bonuses
An interactive map, rendered by MapLibre GL over OpenFreeMap tiles, with Supercluster collapsing markers so that several hundred profiles stay legible at low zoom. Position comes from three sources in order of precision: the browser’s geolocation, a place entered by hand, then an IP lookup for the case the subject insists on, a user who refuses to be located. Other people’s coordinates are blurred before they ever leave the API.

Audio and video calls go through WebRTC directly, with no third-party calling library: RTCPeerConnection and getUserMedia, Socket.IO carrying the offer, the answer and the ICE candidates, and a public STUN server for NAT discovery. Without a TURN relay, two peers behind symmetric NATs cannot reach each other. That is an accepted limit, and one an environment variable lifts without touching a line of code.

