← Back to projects
TotalCoin · Virtual wallet

Core API — TotalCoin virtual wallet

Development of the Core API and microservices infrastructure for TotalCoin's virtual wallet and payment gateway platform.

4
Commercial sub-wallets
-40%
Deployment time (Docker/ECS)
3
Legacy microservices migrated

The Problem

TotalCoin's virtual wallet and payment gateway platform needed a robust transactional backend: a multi-level authorization flow for sensitive operations, with different business rules per sub-wallet, and infrastructure that stopped slowing down deployments.

  • • Multi-level signer/approver flow with business rules differentiated per sub-wallet
  • • Legacy microservices on .NET Framework 4.5 with slow, coupled deployments
  • • Deployments that blocked shipping new functionality
  • • The need to separate responsibilities without over-engineering

My Process

1. Business rules discovery

Mapped the rules of the 4 commercial sub-wallets: who signs, who approves, in what order and with what amounts. Each sub-wallet had real, differentiated rules.

  • ✓ Multi-level authorization flow parameterized per sub-wallet
  • ✓ Limits and hierarchy rules documented before writing code
  • ✓ Differentiated business rules, not cosmetic ones

2. DDD and CQRS architecture

Designed the module with Domain-Driven Design, separating commands from queries so writes and reads could evolve independently.

  • ✓ CQRS, Facade and Mediator patterns for separation of responsibilities
  • ✓ Domain aggregates (wallet, signer, approver, operation)
  • ✓ Well-bounded repositories and application services

3. Migration to Docker and Amazon ECS

Migrated 3 critical legacy microservices (.NET Framework 4.5) into Docker containers deployed on Amazon ECS.

  • ✓ Architecture optimization with Docker containers
  • ✓ Amazon ECS as the microservices orchestrator
  • ✓ 40% reduction in deployment time

4. Delivery and validation

Validated the full flow against the business cases of all 4 wallets and stabilized operations in production.

  • ✓ Authorization flow tests for each business rule
  • ✓ Gradual rollout with zero monolith downtime
  • ✓ 40% deployment time reduction measured on real releases

The Solution

A modeled domain, not improvised

The authorization flow was modeled as part of the domain, with each wallet's rules as configurable policy instead of scattered conditionals.

• Signer/approver chain with levels and amounts per wallet
• Business rules isolated per wallet, reusing the common machinery
• Traceability of every authorization decision

CQRS + Mediator to grow without breaking

Commands and queries separated with the Mediator pattern (via CQRS) so adding a wallet or a rule didn't recompile the whole flow.

• Handlers per command: sign, approve, reject, cancel
• State and audit queries decoupled from writes
• Facade toward the wallet's internal clients

Microservices on Docker/ECS

The 3 most volatile microservices moved out of the monolith into containers, achieving independent deployments.

• -40% deployment time from independent releases
• Failure isolation: one service down doesn't take down the wallet
• Per-service scaling based on real load

Results & Impact

-40%
Deployment time
4
Commercial sub-wallets
99.5%
Module uptime in production
Multi-level
Signer → approver flow

Key Learnings

  • ✓ Domain first: modeling each wallet's real rules before writing code avoided a mid-project redesign.
  • ✓ CQRS is not just a pattern: separating commands from queries let audit and operational flows grow at different paces.
  • ✓ Containerizing pays off: moving to Docker/ECS wasn't cosmetic: the -40% in deployment came from removing coupling to the monolith release.

Tech Stack

Backend

• .NET Framework 4.5
• C#
• ASP.NET Web API
• Entity Framework

Architecture

• DDD
• CQRS
• Mediator
• Facade
• Microservices

Infrastructure

• Docker
• Amazon ECS
• CI/CD
• SQL Server

Got business logic that needs decoupling?

If your system outgrew its monolith and deployments or business rules are slowing you down, let's talk. Same DDD/microservices approach, measurable results.