Dragonchat
I worked on the development and evolution of a product focused on mass messaging via WhatsApp, based on a microservices architecture. This system allowed users to automate messaging campaigns, manage dynamic content, and maintain real-time control over shipments. My role was mainly focused on the backend, participating in service design, data modeling, and optimization of critical flows to improve scalability, maintainability, and system performance.
General Microservices Architecture
One of the key contributions was the creation of an internal feature flags system implemented as an independent microservice. I was responsible for designing the data model, as well as the complete construction of its API, allowing functionalities to be enabled or disabled dynamically without deployments. This facilitated controlled experimentation and progressive rollout of new features within the services ecosystem.
Feature Flags — Enablement Flow
Another of the most relevant developments was the complete reconstruction of the messaging system. I designed a dedicated API for message management, including its data model and endpoints, and integrated RabbitMQ to handle asynchronous communication. This allowed shipments to be processed in the background, regardless of the client's state, enabling functionalities such as pause, resume, and real-time campaign modification, all orchestrated from the backend.
I implemented a "sequence library" functionality that allowed users to create, store, and reuse message templates. These sequences could include multiple messages, text variations, and associated files, which were stored persistently. Additionally, I developed the logic to share sequences between users and manage restrictions based on subscription type, integrating validations at both business and API levels.
File System with Supabase + Redis
I also designed and implemented a complete file management system from the backend, replacing previous logic that depended on the frontend. I integrated storage with Supabase and optimized access using Redis, handling files through unique identifiers and caching signed URLs to reduce latency and repeated request load. Additionally, I implemented an automatic cleanup mechanism that deleted temporary files after 24 hours, ensuring resource efficiency.
At the infrastructure level, I performed the migration of microservices from Express to Fastify within the NestJS framework, which involved adapting middlewares, request/response handling, and file uploads. This migration significantly improved API performance and optimized resource consumption.
API Gateway Refactoring — Before and After
I led the refactoring of the API Gateway, which initially concentrated business logic that did not belong to it. I reorganized the architecture by extracting that logic to an intermediate service (middleend), achieving a clear separation of responsibilities. This allowed the Gateway to focus exclusively on orchestration and inter-service communication, improving the system's scalability and maintainability.
In terms of security, I implemented CORS and Helmet configurations in the services, defining access policies and adding security headers to mitigate common vulnerabilities such as XSS and other risks associated with API exposure.
Additionally, I developed an internal library for NestJS that standardized HTTP requests using Axios, incorporating configurable logging and integration with observability tools like Loki, Prometheus, and Grafana. This improved traceability and monitoring of inter-microservice communications.
Finally, I optimized request context handling through the implementation of AsyncLocalStorage, eliminating the need to use request-scoped services. This allowed maintaining contextual information throughout execution without sacrificing performance, achieving a more efficient architecture based on singleton services.