How emmanuelist/crossflow works
Main Components
• Backend Services:
• Bridge Service: Orchestrates the cross-chain transfer operations.
• Rate Service: Handles retrieval of exchange rates for African currencies.
• Blockchain Services: Separate modules for Ethereum and Stellar operations (found in both backend/src/services and the dedicated blockchain directories).
• USSD Service: Manages mobile money integration via Africa's Talking.
• Controllers, Routes, and Models: Organized in an MVC-like structure with directories for controllers (handling API endpoints), models (database schema for transactions/users), and routes (HTTP endpoints for Ethereum, Stellar, and rates).
• Configuration and Utilities: Directory for DB and blockchain configuration, error handling, fee calculation, transaction monitoring, and input validation.
• Frontend Components:
• Wallet Dashboard: Manages user wallet and network selection.
• Bridge Interface: UI for initiating transfers.
• Transaction Monitor: Provides real-time transaction status updates.
• Payment Forms: UI forms for deposits and withdrawals handling different payment methods.
• Supporting Libraries & Components: Next.js pages, reusable UI components (buttons, alerts, dialogs, etc.), and hooks (e.g., for wallet interactions).
• Blockchain Modules:
• Ethereum and Stellar implementations in the “blockchain” directory with separate configuration files, utilities, and transaction handling.
Relationships and Interactions
• The blockchain components (both in backend and in the standalone blockchain directory) interact with external blockchain networks (Ethereum and Stellar) using configuration parameters provided in the .env file.
• External APIs are used for fiat integration (Flutterwave for payment processing, Africa's Talking for USSD services). These should be shown as external entities interacting with the backend.
• A database component if applicable (referenced in backend/src/config/db.js) that supports persistent storage for user and transaction data.
Architectural Patterns & Important Details
• The backend appears modular and follows an MVC-like pattern (controllers, models, routes) with additional services for business logic, supporting a clean separation of concerns.
• The bridge functionality and blockchain modules indicate that the system is built with a microservice mindset within a monolith, separating blockchain interactions from fiat/payment processing.
• Security features (secure wallet management, input validation, real-time monitoring, and rate limiting) should be annotated as cross-cutting concerns across the architecture.
• The use of specialized utilities for transaction monitoring and fee calculation highlights a focus on financial accuracy and reliability.