Skip to content

Repository files navigation

NexusLedger 🚀

Build Status License: MIT .NET Aspire

NexusLedger is a next-generation, high-performance payment ledger system designed for the fintech sector. Engineered for exactly-once processing and absolute data integrity, it leverages a distributed microservices architecture to handle high-throughput financial transactions with ease.


🏗️ Architectural Highlights

NexusLedger is built as a greenfield project showcasing modern software engineering patterns:

  • Microservices Architecture: Decomposed into domain-centric services (Gateway, Settlement, Reconciliation).
  • Event-Driven Choreography: Asynchronous communication via Apache Kafka ensures loose coupling and scalability.
  • Data Integrity:
    • Idempotency: Redis-backed barriers in the Payment Gateway prevent duplicate processing.
    • Transactional Outbox: Guarantees atomic writes to the Ledger and message dispatching, eliminating "dual-write" issues.
  • Resilience: Integrated Polly policies for circuit breaking and exponential backoff strategies.
  • Observability: Full tracing with OpenTelemetry and Jaeger propagation across message boundaries.
  • Orchestration: Fully orchestrated local development environment using .NET Aspire.

🛠️ Technology Stack

Category Technology
Core .NET 9 / 10, C#
API ASP.NET Core Web API
Orchestration .NET Aspire
Message Broker Confluent Kafka
Database SQL Server (EF Core), Redis (Caching/Locks)
Observability OpenTelemetry, Jaeger, Prometheus
Testing xUnit, Pact.io (Contract Testing)
Containerization Docker, Docker Compose

🧩 Services Overview

  1. Payment Gateway API
    • Role: Entry point for payment initiation.
    • Features: Validates requests, enforces idempotency, and publishes PaymentInitiated events.
  2. Settlement Service
    • Role: The core ledger worker.
    • Features: Consumes events, creates ledger entries using T-SQL/EF Core, and manages the Transactional Outbox.
  3. Reconciliation Worker
    • Role: Financial health check.
    • Features: Daily comparison of internal ledger state against external bank statements.

🚀 Getting Started

Prerequisites

Running Locally

NexusLedger uses .NET Aspire to orchestrate the entire suite of services and infrastructure (Kafka, Redis, SQL Server) with a single command.

  1. Clone the repository

    git clone https://github.com/junaid109/Nexus-Ledger.git
    cd Nexus-Ledger
  2. Run with Aspire

    dotnet run --project NexusLedger.AppHost
  3. Explore the Dashboard The console output will provide a link to the Aspire Dashboard (typically https://localhost:18888), where you can view logs, traces, and metrics for all running services.


🧪 Testing

Run unit and integration tests:

dotnet test

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

NexusLedger is a next-generation, high-performance payment ledger system designed for the fintech sector.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages