Secure β’ Decentralized β’ Permission-Based File Transfer with Advanced Features
A modern peer-to-peer file transfer application built on the Stellar blockchain with beautiful UI, advanced permission management, token system, batch transfers, file search, and mobile PWA support.
π Getting Started β’ β¨ Features β’ π οΈ Installation β’ π Usage β’ ποΈ Architecture
- Smart Contract Permissions: Files can only be transferred between wallets with explicit blockchain permissions
- Stellar Network Integration: Built on Stellar's robust and fast blockchain infrastructure
- Wallet Authentication: Secure wallet connection using Stellar Wallets Kit
- Permission Management: Grant and revoke file transfer permissions on the blockchain
- Direct File Transfer: Files are transferred directly between peers without intermediary servers
- WebRTC Technology: Uses modern WebRTC for fast and secure peer-to-peer connections
- Real-time Communication: Instant connection status and transfer progress
- Batch Transfer Support: Send multiple files simultaneously with progress tracking
- Transfer History: Complete record of all file transfers with search and filtering
- XLM Integration: Native Stellar Lumens (XLM) support with real testnet balances
- Custom Tokens: Create and manage custom tokens on the Stellar network
- Token Balances: Real-time token balance tracking from Stellar testnet
- Payment System: Send payments in XLM and other Stellar assets
- Transaction History: Complete transaction history and tracking
- Real Network Data: All token operations use actual Stellar testnet data
- File Search System: Advanced search and filtering of transfer history
- Transfer Records: Detailed tracking of all sent and received files
- File Type Detection: Automatic file type recognition with appropriate icons
- Transfer Status: Real-time status tracking (pending, completed, failed)
- File Details: Comprehensive file information including size, type, and timestamps
- History Management: Clear individual records or entire transfer history
- Beautiful Design: Modern gradient-based UI with Stellar brand colors
- Responsive Layout: Works perfectly on desktop and mobile devices
- Intuitive UX: Simple and user-friendly interface for all skill levels
- Real-time Feedback: Live status updates and progress indicators
- Tabbed Interface: Organized sections for File Transfer, File Search, and Token System
- Passkey Authentication: Biometric security with fingerprint, face ID, or device PIN
- Smart Contract Wallet: Stellar smart contract-based wallet for enhanced security
- Traditional Wallet Support: XBULL wallet integration for familiar experience
- No Private Key Management: Secure authentication without key management complexity
- Native Mobile Experience: Install as a native mobile app
- Offline Support: Works offline with cached resources
- Push Notifications: Real-time notifications for file transfers
- Background Sync: Automatic sync when connection is restored
- Mobile Optimized: Touch-friendly interface for mobile devices
- Install Banner: Automatic PWA installation prompts
- Multiple File Selection: Select up to 10 files for simultaneous transfer
- Progress Tracking: Individual and overall progress for each file
- Status Management: Real-time status updates (pending, sending, completed, failed)
- Error Handling: Graceful handling of failed transfers
- Transfer Manager: Dedicated interface for managing batch transfers
- Statistics Dashboard: Visual representation of transfer statistics
- Chat Interface: Built-in chat system for peer communication
- Connection Status: Real-time peer connection monitoring
- File Transfer Notifications: Instant notifications for file transfers
- Peer Discovery: Easy peer ID sharing and connection establishment
- Node.js (v16 or higher)
- npm or yarn
- Stellar Wallet (XBULL, Freighter, etc.) or Passkey-enabled device
-
Clone the repository
git clone https://github.com/your-username/Stellar-P2P-File-Transfer.git cd Stellar-P2P-File-Transfer
-
Install dependencies
npm install
-
Build the file-transfer package
cd packages/file-transfer npm run build cd ../..
-
Start the development server
npm start
-
Open your browser
http://localhost:3000
- Click "Connect Stellar Wallet" button
- Select XBULL wallet from the modal
- Authorize the connection in your wallet
- Your wallet address will be displayed
- Use the Passkey Wallet section
- Click "Create Passkey Wallet" or "Connect Existing Wallet"
- Use your device's biometric authentication
- Your passkey wallet address will be displayed
- Click "Settings" button in the wallet info bar
- Grant Permissions:
- Enter the wallet address you want to grant permission to
- Click "Grant" and confirm the transaction
- Revoke Permissions:
- Enter the wallet address you want to revoke permission from
- Click "Revoke" and confirm the transaction
- Enter the recipient's wallet address and click "Check Permission"
- Enter the recipient's peer ID and click "Connect"
- Select a file using the upload area
- Click "Send File" to transfer
- Follow steps 1-2 from single file transfer
- Select multiple files (up to 10) using the upload area
- Click "Send X Files" to start batch transfer
- Monitor progress in the Batch Transfer Manager
- View individual file status and overall progress
- Share your Peer ID with the sender
- Wait for incoming connections
- Files will be automatically downloaded when received
- View transfer history in the File Search tab
- Navigate to the "File Search" tab
- Search transfers by filename, peer ID, or file type
- Filter by direction (sent/received) or status
- View transfer details by clicking the eye icon
- Download received files (if available)
- Delete records or clear entire history
- Navigate to the "Token System" tab
- View balances of XLM and other tokens
- Send payments to other Stellar addresses
- Create custom tokens on the Stellar network
- View transaction history and details
- Open the app in Chrome/Safari on your mobile device
- Look for the install banner at the top of the page
- Click "Install" to add to your home screen
- Enable notifications for file transfer alerts
- Use offline - the app works without internet
stellar-p2p-file-transfer/
βββ π¦ packages/
β βββ file-transfer/ # Stellar smart contract integration
β βββ src/
β β βββ index.ts # Contract client wrapper
β βββ package.json
βββ π public/ # Static assets & PWA files
β βββ manifest.json # PWA manifest
β βββ sw.js # Service worker
β βββ index.html # Main HTML file
β βββ icons/ # PWA icons
βββ βοΈ src/
β βββ App.tsx # Main application component
β βββ pages/
β β βββ HomePage.tsx # Main application page
β βββ components/ # React components
β β βββ PasskeyWallet.tsx # Passkey authentication
β β βββ TokenSystem.tsx # Stellar token management
β β βββ PWABanner.tsx # PWA install banner
β β βββ ChatInterface.tsx # Real-time chat
β β βββ FileSearch.tsx # File search and history
β β βββ BatchTransferManager.tsx # Batch transfer management
β βββ hooks/ # Custom React hooks
β β βββ usePWA.ts # PWA functionality
β βββ helpers/ # Utility functions
β β βββ peer.ts # WebRTC peer connection logic
β β βββ hooks.ts # Custom React hooks
β βββ store/ # Redux store
β βββ index.ts # Store configuration
β βββ hooks.ts # Redux hooks
β βββ peer/ # Peer connection state
β βββ connection/ # Connection management
β βββ transfer/ # Transfer history and search
βββ π README.md
βββ π package.json
βββ π tsconfig.json
Technology | Purpose | Version |
---|---|---|
React | Frontend Framework | ^18.2.0 |
TypeScript | Type Safety | ^4.4.2 |
Stellar SDK | Blockchain Integration | ^13.3.0 |
WebRTC | P2P Communication | Native |
Ant Design | UI Components | ^5.4.2 |
Redux Toolkit | State Management | ^1.9.5 |
PeerJS | WebRTC Abstraction | ^1.5.2 |
PWA | Mobile App Support | Native |
- Main application interface with tabbed navigation
- Wallet connection and authentication
- File transfer interface with batch support
- Connection management and peer discovery
- Biometric authentication implementation
- Smart contract wallet integration
- Secure key management without private keys
- Stellar token management interface
- Real-time balance tracking
- Payment and token creation functionality
- Transaction history display
- Advanced file search and filtering
- Transfer history management
- File details and download functionality
- History cleanup and management
- Multiple file transfer management
- Progress tracking and status updates
- Error handling and recovery
- Transfer statistics dashboard
- PWA installation prompts
- Service worker integration
- Offline functionality support
- Real-time peer communication
- Connection status monitoring
- File transfer notifications
- Peer State: WebRTC peer connection management
- Connection State: Active peer connections and selection
- Transfer State: File transfer history, search, and filtering
startPeer()
: Initialize WebRTC peerconnectPeer()
: Establish peer connectioncreateTransferRecord()
: Record new file transfercompleteTransfer()
: Mark transfer as completedfailTransfer()
: Mark transfer as failedsearchTransfers()
: Search transfer historyfilterTransfers()
: Filter transfers by criteria
The batch transfer system allows users to send multiple files simultaneously:
- File Selection: Drag and drop or click to select up to 10 files
- Progress Tracking: Individual progress bars for each file
- Status Management: Real-time status updates (pending, sending, completed, failed)
- Error Handling: Graceful handling of failed transfers with retry options
- Statistics Dashboard: Visual representation of transfer statistics
- Transfer Manager: Dedicated interface for managing batch operations
Advanced file management system with comprehensive search capabilities:
- Search Functionality: Search by filename, peer ID, or file type
- Filtering Options: Filter by direction (sent/received) or status
- File Type Detection: Automatic file type recognition with appropriate icons
- Transfer Details: Comprehensive file information and metadata
- Download Management: Download received files directly from history
- History Management: Clear individual records or entire history
The token system integrates with actual Stellar testnet:
- Real Balances: Fetch actual XLM and token balances from Stellar testnet
- Live Transactions: All payments and token operations use real network
- Transaction History: Complete transaction history from the blockchain
- Token Creation: Create custom tokens on the Stellar network
- Payment System: Send payments in XLM and other Stellar assets
Progressive Web App with native mobile capabilities:
- Install Banner: Automatic PWA installation prompts
- Service Worker: Offline functionality and background sync
- Push Notifications: Real-time notifications for file transfers
- Mobile Optimized: Touch-friendly interface and responsive design
- Offline Support: Works without internet connection
- Background Sync: Automatic synchronization when connection is restored
npm start
npm run build
The app is ready for PWA deployment with:
- Service worker for offline functionality
- Manifest file for app installation
- Optimized assets and caching
We welcome contributions! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Follow TypeScript best practices
- Use Redux Toolkit for state management
- Maintain PWA compatibility
- Test on both desktop and mobile devices
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ and β Stellar
If you found this project helpful, please give it a β!
Stellar P2P File Transfer Hub - Secure, decentralized file sharing powered by the Stellar network