# DBIS Portal **Status**: 🚧 **Placeholder - Under Planning** **Monorepo Structure**: This project will be integrated as a submodule in the `dbis_monorepo` monorepository (when implemented) under `apps/dbis-portal`. **Note**: `dbis_monorepo` is currently a placeholder. Integration will occur when the monorepo is implemented. --- ## Overview DBIS Portal is a comprehensive web-based portal application that provides user interfaces for DBIS services, member bank operations, administrative functions, and public-facing information. It serves as the primary interface for users interacting with the DBIS ecosystem. --- ## Purpose The DBIS Portal provides: - **Member Bank Portal**: Banking operations interface for member institutions - **Administrative Portal**: System administration and management interfaces - **Public Portal**: Public-facing information and documentation - **Service Management**: Service provisioning and management UI - **Integration Hub**: Unified interface for all DBIS services --- ## Target Users ### Member Banks (Sovereign Central Banks) - Account management - Payment initiation and tracking - FX trading interface - CBDC wallet management - Transaction history and reporting - Compliance reporting ### System Administrators - User and role management - System configuration - Monitoring dashboards - Compliance monitoring - Risk management interfaces - Audit log access ### Public Users - Service information - Documentation access - API documentation - System status pages - Registration and onboarding --- ## Architecture (Planned) ### Frontend Architecture ``` ┌─────────────────────────────────────────────────────┐ │ DBIS Portal Application │ ├─────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌───────────┐ │ │ │ Public │ │ Member │ │ Admin │ │ │ │ Portal │ │ Portal │ │ Portal │ │ │ └──────┬───────┘ └──────┬───────┘ └─────┬─────┘ │ │ │ │ │ │ │ └─────────────────┼─────────────────┘ │ │ │ │ │ ┌────────────▼────────────┐ │ │ │ Shared Components │ │ │ │ - Layout │ │ │ │ - Navigation │ │ │ │ - Auth │ │ │ │ - API Clients │ │ │ └────────────┬────────────┘ │ │ │ │ │ ┌────────────▼────────────┐ │ │ │ API Integration Layer │ │ │ │ - dbis_core API │ │ │ │ - Blockchain API │ │ │ │ - Documentation API │ │ │ └─────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────┘ ``` --- ## Technology Stack (Planned) ### Frontend Framework - **Next.js 14+** (React + TypeScript) - **App Router**: Next.js App Router for modern routing - **Server Components**: For optimal performance - **Server Actions**: For form handling and mutations ### UI Framework - **TailwindCSS**: Utility-first CSS framework - **shadcn/ui**: High-quality React components - **Radix UI**: Accessible component primitives - **Framer Motion**: Animations and transitions ### State Management - **TanStack Query (React Query)**: Server state management - **Zustand**: Client state management (if needed) - **React Context**: Theme and global state ### Data Fetching - **GraphQL**: For dbis_core GraphQL API - **REST API**: For other services - **WebSockets**: For real-time updates - **Server Actions**: For mutations ### Authentication & Authorization - **NextAuth.js**: Authentication framework - **JWT**: Token-based authentication - **RBAC**: Role-based access control - **Integration**: With dbis_core auth system ### Form Handling - **React Hook Form**: Form state management - **Zod**: Schema validation - **Server Actions**: Form submissions --- ## Project Structure (Planned) ``` dbis_portal/ ├── src/ │ ├── app/ # Next.js App Router │ │ ├── (public)/ # Public routes │ │ │ ├── page.tsx # Landing page │ │ │ ├── docs/ # Documentation │ │ │ ├── api-docs/ # API documentation │ │ │ └── status/ # Status page │ │ ├── (member)/ # Member bank portal │ │ │ ├── dashboard/ # Member dashboard │ │ │ ├── accounts/ # Account management │ │ │ ├── payments/ # Payment operations │ │ │ ├── fx/ # FX trading │ │ │ ├── cbdc/ # CBDC wallet │ │ │ └── reports/ # Reports and analytics │ │ ├── (admin)/ # Administrative portal │ │ │ ├── dashboard/ # Admin dashboard │ │ │ ├── users/ # User management │ │ │ ├── monitoring/ # System monitoring │ │ │ ├── compliance/ # Compliance monitoring │ │ │ └── settings/ # System settings │ │ ├── api/ # API routes │ │ │ ├── auth/ # Authentication routes │ │ │ └── webhook/ # Webhook handlers │ │ ├── layout.tsx # Root layout │ │ └── page.tsx # Home page │ ├── components/ # React components │ │ ├── ui/ # UI components (shadcn/ui) │ │ ├── layout/ # Layout components │ │ ├── member/ # Member portal components │ │ ├── admin/ # Admin portal components │ │ ├── public/ # Public portal components │ │ └── shared/ # Shared components │ ├── lib/ # Utilities and helpers │ │ ├── api/ # API client functions │ │ ├── auth/ # Authentication utilities │ │ ├── utils/ # Utility functions │ │ └── validations/ # Validation schemas (Zod) │ ├── hooks/ # Custom React hooks │ ├── types/ # TypeScript types │ ├── styles/ # Global styles │ └── config/ # Configuration ├── public/ # Static assets │ ├── images/ │ ├── icons/ │ └── fonts/ ├── docs/ # Documentation │ ├── architecture/ # Architecture docs │ ├── development/ # Development guides │ └── deployment/ # Deployment guides ├── tests/ # Tests │ ├── unit/ # Unit tests │ ├── integration/ # Integration tests │ └── e2e/ # E2E tests (Playwright) ├── .env.example # Environment variables template ├── next.config.js # Next.js configuration ├── tailwind.config.js # TailwindCSS configuration ├── tsconfig.json # TypeScript configuration └── package.json # Dependencies ``` --- ## Features (Planned) ### Public Portal Features - ✅ Landing page with service information - ✅ Documentation browser - ✅ API documentation (interactive) - ✅ System status dashboard - ✅ Registration and onboarding flow - ✅ Contact and support information ### Member Bank Portal Features - ✅ **Dashboard**: Overview of accounts, recent transactions, alerts - ✅ **Account Management**: - Multi-asset account views - Account balances and history - Account configuration - ✅ **Payment Operations**: - Payment initiation - Payment tracking - Payment history - Bulk payment processing - ✅ **FX Trading**: - Real-time FX rates - FX trade execution - Trade history - Position management - ✅ **CBDC Wallet**: - CBDC balance management - Transfer operations - Transaction history - Wallet configuration - ✅ **Reports & Analytics**: - Transaction reports - Compliance reports - Financial statements - Custom report builder ### Administrative Portal Features - ✅ **User Management**: - User creation and management - Role assignment - Permission management - Audit trail - ✅ **System Monitoring**: - System health dashboards - Performance metrics - Error tracking - Service status - ✅ **Compliance Monitoring**: - Compliance dashboard - Alert management - Regulatory reporting - Audit logs - ✅ **Risk Management**: - Risk dashboard - Risk metrics - Alert configuration - Risk reports - ✅ **Configuration**: - System settings - Feature flags - Integration configuration - Notification settings --- ## API Integration ### dbis_core Integration ```typescript // API client for dbis_core import { DBISCoreClient } from '@dbis/api-client/core'; const client = new DBISCoreClient({ baseUrl: process.env.NEXT_PUBLIC_DBIS_CORE_API_URL, authToken: await getAuthToken() }); // Fetch accounts const accounts = await client.accounts.list(); // Initiate payment const payment = await client.payments.create({ from: 'account-123', to: 'account-456', amount: 1000, currency: 'USD' }); ``` ### Blockchain Integration ```typescript // API client for blockchain (smom-dbis-138) import { BlockchainClient } from '@dbis/api-client/blockchain'; const blockchain = new BlockchainClient({ rpcUrl: process.env.NEXT_PUBLIC_BLOCKCHAIN_RPC_URL, chainId: 138 }); // Get transaction status const tx = await blockchain.getTransaction(txHash); // Get account balance const balance = await blockchain.getBalance(address); ``` ### Real-Time Updates ```typescript // WebSocket connection for real-time updates import { useDBISWebSocket } from '@/hooks/use-dbis-websocket'; function PaymentTracker({ paymentId }) { const { payment, status } = useDBISWebSocket(`payments/${paymentId}`); return