Skip to main content

BrokerMail

Multi-tenant SaaS emailing platform for brokers — migration from Laravel 8 to Next.js

Next.jsTypeScriptPostgreSQLDrizzle ORMTailwind CSSMailjet APIExact Online APIDigital Ocean Spaces
BrokerMail is a professional emailing SaaS platform for brokers, built collaboratively. I joined the project mid-way and took full ownership of several modules, from design to production.

Tech Stack

Next.js 14 (App Router), strict TypeScript, Drizzle ORM on PostgreSQL (Digital Ocean), Tailwind CSS. External integrations: Mailjet API, Digital Ocean Spaces (file storage), Exact Online (billing). I handled the MySQL → PostgreSQL migration mid-project, maintaining compatibility with the existing Laravel schema.

Article Editor

Module built entirely solo on my own branch. Rich text editor based on TipTap with Word paste support (tables, lists, preserved styles), resizable images, formatted HTML view, and upload to DO Spaces. I wrote a custom sanitizer that cleans arbitrary Word HTML to produce a clean, consistent render in emails.

Integrations & Automation

Mailjet webhooks for deliverability events (unsubscribe, bounce, blocked). Click tracking via a dedicated endpoint. Exact Online OAuth for invoice creation. Auto-assignment of the least populated Mailjet account (among 5 BM accounts) on broker creation. Crons: quarterly article import from the legacy DB, campaign stats, new quarter handling.

Admin & Security

Admin pages for credits, subscriptions, and audit logs. Systematic ownership validation before any mutation. Server-side permission checks. Case-insensitive email lookup fix for compatibility with migrated data.

Broker Portal & UI

Full light/dark theme with consistent tokens, FR/NL/EN language switcher, broker articles section with strict multi-tenant scoping.