A simplified demo application for converting between stablecoins and fiat currencies using Dynamic wallet integration.
- Wallet Connection: Connect using Dynamic wallet integration
- KYC Verification: Complete KYC verification
- Payment Methods: Add bank accounts and blockchain wallets
- Conversions: Convert between stablecoins (USDB) and fiat (USD)
- Real-time Rates: Get live exchange rates and quotes
src/
├── app/ # Next.js app router
│ ├── api/ # API routes for integration
│ ├── layout.tsx # Root layout with providers
│ └── page.tsx # Main application page
├── components/ # Reusable UI components
│ ├── ConversionCard.tsx # Currency conversion interface
│ ├── SelectionModal.tsx # Payment method selection modal
│ ├── SetupProgress.tsx # User setup progress indicator
│ └── ... # Other UI components
├── lib/ # Core functionality
│ ├── config.ts # Application configuration
│ ├── services/ # Business logic services
│ │ ├── conversionService.ts # Conversion operations
│ │ └── paymentMethodsService.ts # Payment methods management
│ ├── hooks/ # Custom React hooks
│ │ ├── useConversion.ts # Conversion state management
│ │ ├── useKYCStatus.ts # KYC status management
│ │ └── usePaymentMethods.ts # Payment methods state
│ └── ... # Other utilities
└── types/ # TypeScript type definitions
- Simplified Architecture: Broke down the monolithic main page into focused components
- Custom Hooks: Extracted business logic into reusable hooks
- Service Layer: Created service classes for API operations
- Component Reusability: Built reusable components like SelectionModal
- Cleaner State Management: Simplified state handling and removed complex logic
- Better Error Handling: Improved error messages and user feedback
- Removed Hardcoding: Eliminated hardcoded values and fallbacks
-
Install dependencies:
bun install
-
Set up environment variables:
BLINDPAY_INSTANCE_ID=your_instance_id BLINDPAY_API_KEY=your_api_key NEXT_PUBLIC_DYNAMIC_ENVIRONMENT_ID=your_dynamic_env_id
-
Run the development server:
bun run dev
- Connect your wallet using the Dynamic integration
- Complete KYC verification
- Add payment methods (bank account or blockchain wallet)
- Start converting between currencies
- Next.js 15: React framework with app router
- Dynamic: Wallet connection and user management
- Wagmi: Ethereum interactions
- Tailwind CSS: Styling
- TypeScript: Type safety
This application is designed as a demo to showcase:
- Clean, maintainable code structure
- Proper separation of concerns
- Reusable components and hooks
- Simplified state management
- Production-ready patterns without over-engineering