Skip to main content

id: flowcharts

SophiChain FinanceHub - Architecture Flowcharts

This document contains comprehensive flowcharts for understanding the FinanceHub module architecture and key workflows.


id: flowcharts

Table of Contents


id: flowcharts

1. Module Architecture Overview


id: flowcharts

2. Payment Flow (Complete)


id: flowcharts

3. Invoice Creation & Payment


id: flowcharts

4. Wallet Operations


id: flowcharts

5. Currency Conversion Flow

Multi-Hop Conversion Example:

  • Converting 100 USD to EUR
  • Path: USD → BTC → EUR
  • Step 1: 100 USD = 0.0025 BTC
  • Step 2: 0.0025 BTC = 85 EUR
  • Effective Rate: 1 USD = 0.85 EUR

id: flowcharts

6. Exchange Rate Update Flow


id: flowcharts

7. Event-Driven Architecture

Event Processing Guarantees:

  • ✓ Events never lost (stored in outbox table)
  • ✓ At-least-once delivery (automatic retries)
  • ✓ Eventual consistency (handled asynchronously)
  • ✓ Automatic retries on failure
  • ✓ Idempotency (same event processed once)

id: flowcharts

8. Pluggable Provider Architecture

Key Benefits:

  • ✓ Zero source code changes needed to add providers
  • ✓ Add providers via NuGet packages
  • ✓ Auto-discovery through ABP DI
  • ✓ Easy testing with mock providers
  • ✓ Third-party extensibility for developers

id: flowcharts

9. DeFi Treasury Auto-Conversion


id: flowcharts

10. Gamification Reward Flow

Rule Engine Features:

  • ✓ Conditional evaluation (check multiple conditions)
  • ✓ Multiple rewards per event
  • ✓ Multipliers for VIP users
  • ✓ Caps per rule and per user
  • ✓ Time-based rules (daily, weekly, monthly)
  • ✓ Complete audit trail

id: flowcharts

Additional Diagrams

Entity Relationship Overview


id: flowcharts

Permission Hierarchy


id: flowcharts

Summary

These flowcharts illustrate:

  1. Layered Architecture - Clear separation between UI, Application, Domain, and Infrastructure
  2. Event-Driven Design - Outbox pattern ensures reliable event processing
  3. Pluggable Providers - NuGet packages extend functionality without source changes
  4. Complex Workflows - Payment, conversion, and treasury operations
  5. Domain Services - Orchestration of business logic across aggregates
  6. ABP Integration - Leveraging ABP's built-in features for UnitOfWork, events, DI

All flows follow ABP Framework best practices and implement Domain-Driven Design principles.


id: flowcharts