Skip to main content

6 posts tagged with "nestjs"

View All Tags

NestJS Dependency Injection Pitfalls: A Tale of Duplicate Providers

· 2 min read
Max Kaido
Architect

The Scenario

Today, I encountered a classic dependency injection issue while integrating a new tournament system with artifacts tracking in our Mercury Bot project. The error was subtle but instructive:

[Nest] 2991604  - 02/03/2025, 6:01:58 PM   ERROR [ExceptionHandler] Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')

The Root Cause

Elegant Refactoring: A Journey to Better Domain-Driven Architecture

· 15 min read
Max Kaido
Architect

In any growing project, there comes a time when the initial architecture starts showing signs of strain. As features expand and requirements evolve, what once seemed like a clear structure can become muddled. Today, I want to share our journey of refactoring TON Arcana, focusing on creating a more cohesive, domain-driven architecture.

Here are 10 elegant improvements we're implementing to make our codebase cleaner, more maintainable, and better aligned with domain concepts.

NestJS Module for Implementing a Token in Redis

· 6 min read
Max Kaido
Architect

Overview

We will create a NestJS module called TokenModule that implements a token system using Redis as the data store. The module will handle token balances, transfers, and burning of tokens. We will leverage Redis's advanced features such as atomic operations, Pub/Sub, and data structures to maximize performance and reliability.