π Technical Terminologies
Understanding these technical concepts is essential for developing with the Rahat platform. Each section below explains a key technical component of the system architecture.
ποΈ System Architectureβ
Core Componentsβ
- βοΈ Microservices Architecture
Distributed system design using NestJS with Redis transport for inter-service communication
- π Event-Driven Architecture
Bull queues and event emitters for asynchronous processing and job management
- ποΈ Multi-Database Setup
PostgreSQL with Prisma ORM supporting separate databases for core, triggers, and AA services
- π Monorepo Structure
Nx workspace with pnpm package manager for efficient development and build management
βοΈ Blockchain Infrastructureβ
Smart Contract Architectureβ
- π Solidity Contracts
ERC-20 token standards, multi-signature wallets, and custom business logic on EVM chains
- π¦ Soroban Contracts
Rust-based smart contracts for Stellar network with native asset management
- π Multi-Signature (Multisig)
Safe/Gnosis protocol integration for secure fund management and transaction approval
- π― Meta-Transactions
Gasless transaction support enabling users to interact without holding native tokens
Blockchain Networksβ
- π Stellar Network
Primary blockchain with 3-5 second finality and ~0.00001 XLM transaction costs
- π EVM-Compatible Chains
Support for Polygon, Arbitrum, Base Sepolia with Solidity smart contracts
- π The Graph Protocol
Decentralized indexing for efficient blockchain data querying via GraphQL APIs
π§ Development Stackβ
Backend Technologiesβ
- π’ NestJS Framework
Progressive Node.js framework with dependency injection and modular architecture
- π· TypeScript
Type-safe development across the entire stack with strict type checking
- ποΈ Prisma ORM
Type-safe database access with automatic migrations and schema management
- π Redis
In-memory data store for caching, session management, and message queuing
Frontend & Integrationβ
- βοΈ React Ecosystem
Next.js with Shadcn UI components and Zustand state management
- π Web3 Integration
Wagmi, Viem, and Ethers.js for blockchain interaction and wallet connectivity
- π± Ionic Framework
Cross-platform mobile development with native blockchain features
- π React Query
TanStack Query for efficient data fetching and state synchronization
π Security & Authenticationβ
Identity Managementβ
- π Role-Based Access Control (RBAC)
Multi-level permission system for platform and project-level access
- π JWT Authentication
JSON Web Tokens for secure API authentication and session management
- π± OTP Verification
One-Time Password system for claim processing and beneficiary authentication
Cryptographic Securityβ
- π Private Key Management
Secure handling of cryptographic keys for transaction signing
- π± Seed Phrase Recovery
BIP-39 mnemonic phrases for wallet backup and recovery
- π‘οΈ Multi-Signature Security
Multi-party approval requirements for critical financial operations
π° Token Economicsβ
Token Standardsβ
- πͺ ERC-20 Tokens
Fungible token standard for aid distribution with transfer and approval mechanisms
- π¨ Non-Fungible Tokens (NFTs)
Unique token representations for specific goods or services
- π Stablecoins
USDC/USDT integration for predictable value in aid distribution
- π Token Lifecycle
Minting, distribution, redemption, and burning operations
Financial Operationsβ
- πΈ Offramping Services
Cryptocurrency to local currency conversion for beneficiary access
- π¦ Treasury Management
Centralized fund management with multi-signature security
- π³ Point-of-Service (POS)
Vendor applications for token acceptance and transaction processing
- π Settlement Processing
Automated conversion of redeemed tokens to fiat currency
π Data Managementβ
Database Architectureβ
- ποΈ PostgreSQL
Primary relational database with ACID compliance and advanced features
- π Prisma Schema
Type-safe database schema definition with automatic migrations
- π Data Indexing
The Graph subgraph for efficient blockchain event querying
- π Caching Strategy
Redis-based caching for performance optimization and session storage
API Designβ
- π REST APIs
HTTP-based APIs for beneficiary management, vendor operations, and blockchain interactions
- π GraphQL APIs
Flexible query language for complex data retrieval from blockchain and database
- π OpenAPI/Swagger
API documentation and interactive testing interfaces
- π Webhook Integration
Event-driven notifications for external system integration
π Deployment & DevOpsβ
Infrastructureβ
- π³ Docker Containerization
Containerized deployment for consistent environment management
- βΈοΈ Kubernetes Orchestration
Container orchestration for scalable and resilient deployments
- π CI/CD Pipelines
Automated testing, building, and deployment workflows
- π Monitoring & Logging
Application performance monitoring and centralized logging
Development Toolsβ
- π¨ Hardhat Framework
Ethereum development environment for smart contract compilation and testing
- π§ͺ Testing Frameworks
Jest for unit testing, integration testing, and end-to-end validation
- π Code Quality
ESLint, Prettier, and TypeScript strict mode for code consistency
- π Documentation
Docusaurus for comprehensive documentation with versioning support
π Integration Patternsβ
External Servicesβ
- π€οΈ Environmental APIs
DHM and GLOFAS integration for climate data and forecasting
- π¬ Communication Platform
@rumsan/connect for SMS, IVR, and voice messaging services
- π³ Payment Providers
Integration with local and international payment gateways
- π± Mobile Money
Local mobile money service integration for cash-out operations
Inter-Service Communicationβ
- π Message Queues
Bull/BullMQ for background job processing and task management
- π‘ Event Emitters
Internal service event handling for decoupled communication
- π Service Discovery
Dynamic service registration and discovery in microservices architecture
- π Health Checks
Service health monitoring and load balancing support
Understanding these technical concepts and their implementation in Rahat is crucial for effective development, debugging, and extension of the platform. Each component is designed to work together in a scalable, secure, and maintainable architecture.