Turn it up
All projects

Project detail · technical deep-dive

SaaSReal EstateMulti-tenantClean ArchitectureNestJSNext.jsReact NativePrismaPostgreSQLTypeScriptDocker

MylarPro — Multi-Tenant SaaS for Brazilian Real-Estate Operations

Architected and built a full SaaS platform for the Brazilian real-estate market: NestJS backend with Clean Architecture, multiple Next.js frontends, a React Native mobile app, and solid infrastructure for queues, payments, and integrations.

Role

Full-stack / systems architecture

Timeline

2025–2026

Tech

NestJS 11, Next.js 15/16, React 19, React Native (Expo), Prisma 7, PostgreSQL 17, Redis, Bull, Docker

3 page views

Product showcase

Flows & screens

Landing page: product story and entry into the MylarPro ecosystem.

In production

Status

9 projects

Applications

100+ entities

Data models

Technical implementation

  • Clean Architecture backend

    NestJS API with Use Case → Repository → Prisma, immutable domain entities, Either monad for errors, and strict scoping by organizationId (rigorous multi-tenancy).

  • Specialized frontends

    Next.js App Router across four apps (dashboard, customer portal, admin, public catalog), each with its own auth, modern stack (React 19, Tailwind v4), and shared React Query + Zod patterns.

  • Payments & queue infrastructure

    Stripe and ASAAS integrations, Bull queues for async work, Gotenberg for PDFs, Cloudflare R2 for storage, Evolution API for WhatsApp, and a full billing pipeline with fines, interest, installments, and reconciliation.

Experience the result

Live product, repository, or both—pick what matters for this case.

Overview

MylarPro is a complete multi-tenant SaaS for the Brazilian real-estate market, built so agencies can manage the full lifecycle of contracts, billing, payouts to owners, and customer relationships. The monorepo bundles nine independent applications—backend, four web frontends, mobile apps, a public catalog, and marketing pages—all integrated via API and backed by a single PostgreSQL database with 100+ Prisma models.

More than a CRM, it is a financial-operations system that automates dunning, boleto/PIX issuance, commission math, owner payouts, DIMOB (Brazilian rental-income reporting), and bank reconciliation—with accounting discipline aligned to how the local market actually works.

Technical architecture & responsibilities

  • Backend (NestJS + Prisma): Clean Architecture with strict separation of domain, application, and infrastructure. Injected use cases, abstract repositories, mappers between domain entities and persistence, and Either-based error flows.
  • Multi-tenancy: Every query scoped by organizationId with ownership checks on each operation. Isolation enforced at the application layer.
  • Frontends (Next.js): Four App Router apps on React 19 and Tailwind v4. Shared module layout (services, queries, models, components) and a consistent stack: React Query, Zod, react-hook-form, shadcn/ui.
  • Mobile (Expo): Broker app in React Native with calendar, visits, clients, contracts, and profile—11 endpoints dedicated to the mobile client.
  • Infrastructure: Bull + Redis queues (seven queues: payment, notification, WhatsApp, lead scoring, invoice processing, and more), Gotenberg for PDFs, Cloudflare R2 for files, multi-stage Docker deploys via GitHub Actions.

Stack

  • Backend: NestJS 11, Prisma 7, PostgreSQL 17, Redis, Bull, TypeScript
  • Frontends: Next.js 15/16, React 19, Tailwind CSS v4, shadcn/ui, React Query, Zod, Zustand
  • Mobile: Expo, React Native, TypeScript
  • Integrations: Stripe, ASAAS, SendGrid, Twilio, Evolution API (WhatsApp), Cloudflare R2
  • Document generation: Gotenberg (production-grade PDFs)
  • Observability: Sentry (frontend), Datadog APM + Pino (backend)
  • Deploy: Multi-stage Docker, GHCR, GitHub Actions, SSH deploy

Implemented features

  • Billing groups & invoices: Recurring rent groups, one-off invoices, annual index adjustments (IGP-M, IPCA, INPC, FIXED) via cron.
  • Fees & commissions: Automatic admin fee and broker commission per paid invoice, with hierarchy contract → group → override.
  • Fines, interest & partial payments: Fixed fine + proportional daily interest on arrears, partial payments with PARTIALLY_PAID status and full transaction history.
  • Proof-of-payment workflow: Customer uploads proof in the portal → PENDING_APPROVAL → admin approves/rejects with a full audit trail.
  • Payouts & adjustments: Automatic payout to owners after payment, PDF statements via Gotenberg, manual adjustments to settle against future payouts.
  • Visual dunning timeline: Fifteen configurable steps per organization, manual resend, and multi-channel delivery (email, WhatsApp, SMS).
  • Debt agreements / installments: Consolidate invoices into agreements with discounts, installments, and IN_AGREEMENT status.
  • Bank reconciliation: OFX 1.x + CSV parsers (BR/US), auto-matching by amount and date with tolerance, manual confirmation UI.
  • DIMOB & income statements: Yearly aggregation per owner and property, PDF output for income-tax filing.
  • Customer portal: CPF/CNPJ + OTP (email/WhatsApp), separate JWT, 13 routes for invoices, contracts, properties, payouts, tickets, and maintenance.
  • Public SEO catalog: Listings with meta tags, analytics, embedded chat, and portal feeds (e.g. Imovelweb / XML).
  • Broker mobile app: Profile module with 11 endpoints, document approval workflow, OTP for email change, validated PIX key picker.

Engineering highlights

  • Architectural rigor: Clean Architecture without shortcuts—immutable entities via Entity.create(), abstract repositories, explicit mappers, and Either in 100% of use cases.
  • Leak-proof multi-tenancy: organizationId validated on every operation, audited by default at the controller layer.
  • Resilient processing: Bull queues with five retries and exponential backoff replaced fire-and-forget for critical paths (payments, boleto generation, notifications).
  • Financial data quality: Custom validators (IsValidPixKey, CPF/CNPJ), soft delete on invoices and groups, full audit trail for partial payments.
  • Performance & DX: Standardized Prettier + ESLint, absolute imports, 100+ documented Prisma models, ~100 use-case modules organized by feature.