Project system brief

A real estate platform built on NestJS 12 microservices over Redis transport with Clean Architecture, shared Zod v4 contracts, and a React 19 + Tailwind CSS v4 frontend.

Product Context

Product Context

A real estate platform built on NestJS 12 microservices over Redis transport with Clean Architecture, shared Zod v4 contracts, and a React 19 + Tailwind CSS v4 frontend.

System Problem & Scope

System Problem & Scope

Monolithic property portals often tightly couple user authentication, listing search, and buyer lead capture, making independent scaling, strict security boundaries, and shared validation across backend and frontend difficult to maintain.

Engineering Constraints

Engineering Constraints

Coordinating four decoupled NestJS services over Redis RPC while preserving end-to-end type safety, preventing refresh token replay, defending regex-based search against ReDoS, and enforcing strict IDOR ownership checks on property mutations.

System Architecture Flow

System Architecture Flow

Monorepo workspace separating an HTTP API Gateway from three Redis-backed microservices (Identity, Listing, and Inquiry), each structured in Clean Architecture layers (domain, application, infrastructure, presentation) and backed by MongoDB 7 and shared Zod contracts.

5 System Stages
Active Stage: 01
01CLIENT

React 19 + Vite Client

Active Stage
02API

NestJS API Gateway

03OBSERVABILITY

Redis Transport & Shared Contracts

04OBSERVABILITY

Identity, Listing & Inquiry Services

05OBSERVABILITY

MongoDB 7 Persistence

STAGE 01

React 19 + Vite Client

Handles property discovery on Leaflet maps, authenticated user dashboards, and optimistic UI queries via TanStack Query v5.

STAGE 02

NestJS API Gateway

Exposes /api/v1/* REST endpoints with Helmet, Throttler rate limits, cookie JWT extraction, and ZodValidationPipe.

STAGE 03

Redis Transport & Shared Contracts

Routes typed microservice commands and maps DomainError exceptions uniformly via @griya/nest-common.

STAGE 04

Identity, Listing & Inquiry Services

Execute isolated business rules for token rotation, ReDoS-safe listing search, IDOR checks, and SMTP lead notifications.

STAGE 05

MongoDB 7 Persistence

Stores User, RefreshToken, Listing, and Inquiry collections with Mongoose schemas and indexed query paths.

Execution & Failure-Mode Explorer

How the architecture behaves under real faults

Primary stage: Identity, Listing & Inquiry Services

The gateway extracts httpOnly cookie JWTs and routes commands over Redis to Identity and Listing services.

Key Engineering Contributions

Key Engineering Contributions

Built the NestJS 12 API Gateway with Swagger (/api/docs), ZodValidationPipe, ParseObjectIdPipe, Helmet, CORS, and Throttler rate-limiting. Implemented Identity, Listing, and Inquiry microservices with refresh token reuse detection, Firebase Admin OAuth verification, lifecycle states (draft, active, under_offer, sold), and SMTP seller notifications. Developed the React 19 + Vite 6 frontend with TanStack Query v5, Redux Toolkit, React Router v7, Leaflet maps, and Vitest/Playwright test coverage.

Reliability & Integrity Guarantees

Reliability & Integrity Guarantees

Enforced via shared Zod v4 boundary validation, DomainRpcInterceptor error mapping, ReDoS-safe regex escaping, Vitest unit/integration suites, Supertest gateway E2E tests, and Playwright browser verification.