← work

07 - Case Study

Stayke

Full-stack rental marketplace

Stayke
Timeline2022
RoleFull-Stack Engineer
StackReact, Node.js, Express.js, MongoDB, JWT
StatusIn development

The Problem

Building a marketplace with two distinct user roles (renters and landlords) on a single backend is architecturally messier than it sounds. The challenge is keeping the permission model clean - a renter should never touch a listing they don't own, and a landlord should never see another landlord's private data.

What I Built

Designed a JWT-based auth system with role claims baked into the token, then built route-level middleware that gates API endpoints by role. Separate React UIs for renters and landlords share a single Express backend - no code duplication, clear permission boundaries.

01 - Auth + Roles

JWT with role claims - the token carries whether the user is a renter or landlord. Express middleware reads the claim and gates routes accordingly. Simpler than RBAC tables for two roles, and easier to reason about.

02 - Search

MongoDB compound queries for property search across location, price range, and amenities. Indexed the fields used in filter combinations - without indexes, compound queries on a growing collection get slow fast.

03 - Dual UIs

Two React apps, one backend. The landlord interface covers listing creation, editing, and inquiry management. The renter interface covers search, filtering, saved properties, and inquiry sending. Shared components where sensible, separate routing trees where not.

What Happened

01

Dual-role auth working cleanly - role claims in JWT, middleware at route level

02

Advanced property search with compound MongoDB queries across location, price, and amenities

03

Renter and landlord UIs sharing one backend with zero endpoint cross-contamination

In the Wild