MemoChain is a decentralized application (dApp) built on the Solana blockchain that allows users to store immutable memos on-chain. With its modern, responsive UI and robust error handling, MemoChain provides a seamless user experience for interacting with blockchain technology.
- Write and store memos on Solana blockchain
- Seamless wallet integration
- Real-time transaction status updates
- Copy transaction IDs with one click
- Keyboard shortcuts for improved UX
- Character limit counter with visual feedback
- Comprehensive error handling
- Retry mechanism for failed transactions
- Responsive glassmorphic design
graph TD
subgraph Frontend ["Frontend (React + TypeScript)"]
App[App.tsx]
subgraph Components ["UI Components"]
PS[ParticlesBackground]
MI[MemoInput]
EM[ErrorMessage]
SN[SuccessNotification]
end
subgraph Hooks ["Custom Hooks"]
MC[useMemoChain]
end
subgraph Constants ["Configuration"]
CO[constants.ts]
end
end
subgraph Blockchain ["Blockchain Integration"]
WA[Wallet Adapter]
AP[Anchor Provider]
MP[Memo Program]
end
subgraph Network ["Solana Network"]
DN[Devnet]
MM[Memo Program Contract]
end
%% Component Relationships
App --> PS
App --> MI
App --> EM
App --> SN
App --> MC
%% Hook Dependencies
MC --> WA
MC --> AP
MC --> MP
%% Data Flow
WA --> DN
AP --> DN
MP --> MM
MM --> DN
style Frontend fill:#f9f,stroke:#333,stroke-width:2px
style Blockchain fill:#bbf,stroke:#333,stroke-width:2px
style Network fill:#bfb,stroke:#333,stroke-width:2px
App
├── ParticlesBackground
├── WalletMultiButton (from @solana/wallet-adapter-react-ui)
├── ErrorMessage
├── MemoInput
├── SuccessNotification
└── useMemoChain (Custom Hook)
- React 19.1: Core UI framework
- TypeScript 5.8: Type-safe development
- Vite 7.0: Build tool
- @solana/wallet-adapter: Wallet integration
- @coral-xyz/anchor: Solana program interaction
- Anchor Framework: Solana program development
- Solana Program Library (SPL): Memo program integration
User Input → MemoInput
↓
useMemoChain Hook
↓
Wallet Adapter/Provider
↓
Solana Blockchain
↓
Transaction Result
↓
UI Updates (Success/Error)
src/
├── components/
│ ├── ErrorMessage.tsx
│ ├── MemoInput.tsx
│ ├── ParticlesBackground.tsx
│ └── SuccessNotification.tsx
├── hooks/
│ └── useMemoChain.ts
├── CONSTANTS/
│ └── constants.ts
├── types/
│ └── types.ts
├── idl/
│ ├── anchor_spl_memo.json
│ └── anchor_spl_memo.ts
├── App.tsx
└── main.tsx
1. User initiates transaction
2. Wallet signs transaction
3. Transaction sent to Solana
4. Wait for confirmation
5. Update UI with result
-
Transaction Optimization
- Efficient memo program calls
- Minimized blockchain interactions
- Optimized transaction confirmation flow
-
UI Performance
- Debounced input handling
- Efficient state management
- Optimized re-renders
- Smooth animations with CSS transforms
-
Error Handling
- Graceful degradation
- Quick recovery from failures
- Clear user feedback
-
Wallet Security
- Secure wallet connection handling
- Transaction signing confirmation
- Automatic wallet disconnection handling
-
Transaction Safety
- Input validation and sanitization
- Double-submission prevention
- Clear transaction feedback
-
Error Prevention
- Comprehensive input validation
- Clear error messages
- User action confirmation
- Rate limiting for transactions
-
Data Safety
- No sensitive data storage
- Secure clipboard operations
- Safe external link handling
- Clean state initialization
- Atomic state updates
- Proper cleanup on unmount
- Persistent state handling
-
Transaction Errors
- Insufficient funds
- User rejections
- Network timeouts
- Unknown errors
-
Input Validation
- Empty memo prevention
- Character limit enforcement
- Special character handling
- Responsive design
- Loading states
- Success animations
- Error indicators
- Keyboard shortcuts
- Tooltips and hints
-
Feature Enhancements
- Memo history viewer
- Multiple memo types
- Rich text support
- Memo threading
- Social features (likes, replies)
-
Technical Improvements
- Caching layer for transaction history
- Offline support with queue
- Performance monitoring
- Analytics integration
- Automated testing suite
-
UI/UX Enhancements
- Dark/light theme toggle
- Custom animation settings
- Localization support
- Accessibility improvements
- Mobile-optimized views
-
Blockchain Features
- Multiple network support
- Token gating options
- DAO integration
- Cross-chain compatibility
-
Clone the repository:
git clone https://github.com/xavierScript/dev-quest.git
-
Install dependencies:
cd dev-quest cd anchor-memo-ui npm install
-
Run the development server:
npm run dev
-
Build for production:
npm run build
Create a .env file with:
VITE_RPC_URL=your_rpc_url
VITE_NETWORK=devnet # or mainnet-beta
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
- Solana Foundation
- Anchor Framework
- Solana Program Library
- React Community
- Codigo ai
Built with ❤️ by xavierScript
| Account | Description |
|---|---|
payer |
The transaction signer and payer for the memo instruction |
memo_program |
The Memo program invoked via CPI |
| Name | Description |
|---|---|
send_memo |
Sends a memo string via the Memo program (can include signers) |