PropSpaceX API Gateway

Entry point for PropSpaceX — a Web2/Web3 real-estate microservice platform. Handles hybrid auth, distributed rate limiting, and gRPC routing across the service cluster.

Node.jsTypeScriptExpressgRPCRedisNginx
GitHub
01

System Architecture

REQUESTPOST /v1/properties/verifytracing
HTTPSrate limitgRPC · verifygRPCgRPCgRPCownership checkchargewebhookeventsconsumeClientWeb · MobileCLIENTNginxLoad balancerEDGEAPI GatewayAuth · Rate limit · LogsSVCRedisSliding-window limitsDATAUser ServiceJWT · Wallet authSVCProperty ServiceListings · LifecycleSVCMedia ServiceSharp · UploadsSVCPayment ServiceNestJS · WebhooksSVCRabbitMQEvents · DLQQUEUEPostgreSQLUsers · DevicesDATAEthereumOwnership contractsEXTMongoDBProperties · TxnsDATAS3 · CloudinaryMedia storageEXTStripe · Paystack+ FlutterwaveEXTMail ServiceNodemailer · SMTPSVC

A request enters through Nginx, hits the Express gateway (auth, rate limiting, logging), is verified against the User Service, then routed over gRPC to the Property Service — which checks on-chain ownership before persisting to MongoDB. Payment and mail flows run asynchronously through RabbitMQ.

02

Database Design

SCHEMA7 tables · 7 relationshover a table
usersPostgreSQLiduuidemailvarcharwallet_addressvarcharpassword_hashvarcharmfa_enabledboolcreated_attimestampdevicesPostgreSQLiduuiduser_iduuidfingerprintvarcharlast_ipinettrustedboolpropertiesMongoDB_idobjectIdowner_iduuidtitlestringpricenumberstatusenumlocation2dspheretoken_idstringdocumentsMongoDB_idobjectIdproperty_idobjectIdtypestringverifiedboolmedia_assetsMongoDB_idobjectIdproperty_idobjectIdproviderenumvariantsarraytransactionsMongoDB_idobjectIduser_iduuidproperty_idobjectIdproviderenumamountdecimal128statusenumemail_jobsMongoDB_idobjectIduser_iduuidtemplatestringstatusenum

Cross-service view — identity lives in PostgreSQL (User Service); properties, media, transactions, and mail jobs live in MongoDB, linked by owner and property references.

03

Engineering Challenges

01

High availability

Circuit breaker patterns and health checks keep the platform responsive even when downstream services degrade.

02

Distributed rate limiting

Redis-backed sliding-window limits shared across gateway instances, so burst traffic is throttled fairly no matter which node serves it.

03

Service discovery

A dynamic service registry lets new microservices join the cluster without redeploying the gateway.

04

Request tracing

Correlation IDs propagate through every gRPC hop for end-to-end visibility across all services.

04

Trade-offs & Decisions

ChoseOverBecause
gRPCRESTBinary protocol and streaming make inter-service calls far cheaper than JSON over HTTP.
RedisIn-memoryRate-limit state must be shared across gateway instances; local memory breaks under horizontal scaling.
ExpressFastifyMiddleware ecosystem and team familiarity shortened delivery without a meaningful perf penalty at this scale.