Likable is a Web3-native AI trading companion platform where users pay for AI services using a Solana SPL token. It features dynamic USD-based pricing, 50/50 burn/treasury tokenomics, and multi-wallet support.
- Voice-First Companion: Primary interface is a voice AI companion with real-time WebSocket audio streaming
- Dual Visualization Modes: Toggle between animated character avatar or responsive audio waveform visualization
- Token-Gated AI Services: Pay for chat and voice AI using Solana tokens
- Dynamic Pricing: USD-based pricing that automatically converts to tokens using TWAP
- 50/50 Tokenomics: Half of tokens burned (deflationary), half to treasury (operations)
- Multi-Wallet Support: Phantom, Solflare, Backpack, and more
- Real-Time Balance: Live token balance and usage tracking
- Text Chat (Secondary): Text chat available as a slide-out drawer for convenience
- Transparent Economics: Public burn stats and treasury visibility
-
Total Supply: 100,000,000 tokens
-
Decimals: 6 (matches USDC)
-
Distribution:
- 20% Initial Liquidity (Raydium)
- 30% Treasury (Operations)
- 50% Ecosystem/Future
-
Pricing:
- Chat: $0.02 per request (text-based)
- Voice: $0.10 per 3-minute session (Grok Voice Agent)
- Dynamic conversion based on market price
-
Burn Mechanism:
- 50% of usage tokens burned
- 50% to treasury
- Batch settlement for efficiency
- Node.js 18+
- pnpm
- MongoDB
- Solana wallet (Phantom recommended)
- Clone the repository
git clone <your-repo>
cd "Likable-frontend"- Install dependencies
# Frontend
cd frontend
pnpm install- Configure environment variables
Frontend (.env.local):
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com- Run the application
# Frontend
cd frontend
pnpm devVisit http://localhost:3000
- Next.js 16 with App Router
- Solana Wallet Adapter for wallet connections
- Tailwind CSS for styling
- WebSocket for real-time voice streaming
- React Hooks for state management
- Voice-First: Voice interaction is the primary and default interface
- Companion Experience: Intimate, personal, always-available companion feel
- Text as Add-On: Text chat available but secondary (drawer/sidebar)
- Professional Design: Clean, modern, polished UI with attention to detail
- Minimal Distractions: Focus on the conversation, not UI chrome
-
CompanionInterface.tsx- Main voice-first interface component- Central voice visualization (character or waves)
- Voice control button
- Real-time conversation transcript
- Header with token balance and controls
-
VoiceCompanion.tsx- Custom hook for voice WebSocket management- WebSocket connection handling
- Audio streaming (send/receive)
- Real-time transcript tracking
- Audio level detection for visualization
- Session lifecycle management
-
VoiceVisualization.tsx- Container component with toggle- Switches between character and wave modes
- Smooth transitions
- State-based animations
-
CharacterAvatar.tsx- Animated character visualization- State-based expressions (idle, listening, processing, speaking, error)
- Placeholder image support (replaceable)
- Smooth animations and transitions
- Visual feedback indicators
-
AudioWaveform.tsx- Responsive audio wave visualization- Real-time waveform that reacts to audio levels
- State-based patterns (idle, listening, processing, speaking, error)
- Smooth animations and color gradients
-
VisualizationToggle.tsx- Toggle button for switching modes- Character/Waves mode switcher
- Preference saved to localStorage
-
ConversationTranscript.tsx- Real-time transcript display- Scrollable conversation history
- User/assistant message distinction
- Timestamp display
-
TextChatDrawer.tsx- Secondary text chat interface- Slide-out drawer design
- Conversation history
- Message input with send button
- Can be completely hidden
-
TokenBalance.tsx- Minimal header balance display- Compact design for header integration
- Real-time balance updates
- USD value conversion
-
WalletButton.tsx- Wallet connection button -
WalletProvider.tsx- Solana wallet adapter setup
Character Mode:
- Animated character avatar in the center
- Character expressions change based on state
- Subtle animations (breathing, blinking, gestures)
- Placeholder image that can be replaced with custom character
- More personal, companion-like feel
Waves Mode:
- Dynamic waveform visualization that responds to voice input/output
- Smooth wave animations that react to audio levels
- Color gradients that pulse with voice activity
- Modern, abstract aesthetic
- More technical, futuristic feel
Toggle Control:
- Settings button/icon in header or near voice visualization
- Smooth transition animation when switching modes
- User preference saved to localStorage
- Default to Character mode (more companion-like)
-
Idle:
- Character: Subtle breathing animation, ready to interact
- Waves: Gentle pulsing, low amplitude
-
Listening:
- Character: Leaning forward, attentive pose, microphone indicator
- Waves: Pulses inward, active visualization
-
Processing:
- Character: Thinking pose, gentle animation
- Waves: Processing pattern, mid-level activity
-
Speaking:
- Character: Speaking animation, mouth movement
- Waves: Pulses outward, high amplitude, reactive to audio
-
Error:
- Character: Error expression, red tint
- Waves: Red pulse, error pattern
Create Voice Session:
POST /api/voice/session
{
"walletAddress": "string",
"userId": "string (optional)",
"voice": "Ara" | "Rex" | "Sal" | "Eve" | "Leo",
"model": "string (optional)",
"systemInstructions": "string (optional)",
"temperature": "number (optional)"
}Response:
{
"sessionId": "grok-voice-1234567890-abc123",
"message": "Voice session created. Connect via WebSocket",
"wsUrl": "/api/voice/ws/grok-voice-1234567890-abc123",
"maxDuration": 180,
"estimatedCost": 0.10
}WebSocket Connection:
- Connect to:
ws://your-domain/api/voice/ws/:sessionId - Send audio:
{"type": "audio", "data": "base64-encoded-audio"} - Send text:
{"type": "text", "text": "your text"} - Receive audio:
{"type": "audio", "data": "base64-encoded-audio"} - Receive transcript:
{"type": "transcript", "text": "transcribed text"} - Receive response done:
{"type": "response_done"}
Get Voice Cost:
GET /api/voice/costSend Chat Message:
POST /api/chat/message
{
"message": "string",
"walletAddress": "string",
"userTier": "free" | "paid",
"conversationHistory": [{"role": "user" | "assistant", "content": "string"}],
"userId": "string (optional)"
}Get Chat Cost:
GET /api/chat/cost?userTier=free|paidGet Token Balance:
GET /api/token/balance/:walletAddressGet Token Price:
GET /api/token/price- Connect Wallet: User connects Solana wallet
- Start Voice Session: Click "Connect Voice" button
- Grant Microphone Permission: Browser requests microphone access
- Session Created: Backend creates Grok Voice Agent session
- WebSocket Connected: Real-time bidirectional audio streaming
- Start Talking: Click "Start Talking" to begin recording
- Real-Time Processing:
- Audio sent to backend via WebSocket
- Grok Voice Agent processes (STT, LLM, TTS)
- Audio response streamed back
- Transcripts displayed in real-time
- Stop Listening: Click "Stop Listening" when done
- Session Ends: Tokens deducted, session closed
- Open Drawer: Click message icon in header
- Type Message: Enter text in input field
- Send: Message sent with conversation history
- Receive Response: AI response displayed
- Close Drawer: Click X or outside drawer to close
frontend/src/
βββ components/
β βββ CompanionInterface.tsx [Main voice-first interface]
β βββ VoiceCompanion.tsx [Voice WebSocket hook]
β βββ VoiceVisualization.tsx [Container with toggle]
β βββ CharacterAvatar.tsx [Character visualization]
β βββ AudioWaveform.tsx [Wave visualization]
β βββ VisualizationToggle.tsx [Mode toggle button]
β βββ ConversationTranscript.tsx [Real-time transcript]
β βββ TextChatDrawer.tsx [Secondary text chat]
β βββ TokenBalance.tsx [Header balance display]
β βββ WalletButton.tsx [Wallet connection]
β βββ WalletProvider.tsx [Wallet adapter setup]
βββ app/
β βββ page.tsx [Main page - uses CompanionInterface]
β βββ layout.tsx [Root layout]
βββ lib/
βββ api.ts [API client with all endpoints]
Replace Character Image:
- Place your character image in
/public/placeholder-character.png - Or update the
imageUrlprop inCharacterAvatar.tsx
Styling:
- Uses CSS variables defined in
globals.css - Supports light/dark mode via
data-themeattribute - Glassmorphism effects throughout
- Smooth animations and transitions
Visualization Mode:
- Default: Character mode
- Toggle saved to localStorage
- Smooth transitions between modes
- Voice Service: Requires Grok Voice Agent API key configured in backend
- WebSocket: Real-time voice streaming requires WebSocket support
- Microphone: Browser will request microphone permission
- Token Balance: Must have sufficient tokens for voice sessions
- Session Duration: Voice sessions limited to 3 minutes
- Placeholder Images: Replace placeholder character image with your own
- Consistent Icon Alignment: All icons now properly centered using flexbox (
flex items-center justify-center) - Text Alignment: Fixed text baseline alignment issues across all components
- Button Alignment: Voice control buttons and all interactive elements now have proper icon-text alignment
- Header Components: Token balance, message button, and wallet button are vertically aligned
- Message Bubbles: Avatar icons align with the first line of text in conversation transcripts
- Form Elements: Input fields and buttons are vertically aligned in all forms
- Navigation Items: Sidebar navigation icons and text are consistently spaced and aligned
- Error Messages: User-friendly error display with auto-dismiss functionality
- Voice Service Errors: Clear error messages when voice service is not configured (503 errors)
- MongoDB Graceful Degradation: Application continues to function with default values when MongoDB is unavailable
- User-Visible Errors: Error messages displayed in UI with auto-clear functionality
- Error Recovery: Errors automatically clear when user retries or successfully connects
- MongoDB Connection Handling: Graceful fallback to default values when database is unavailable
- No Timeouts: Balance requests return immediately with default values instead of 10-second timeouts
- Error Messages: Clear, actionable error messages for all failure scenarios
- TWAP Pricing: Prevents flash pump/dump exploitation
- Burn Floor/Ceiling: Limits extreme price volatility impact
- Rate Limiting: Prevents infrastructure abuse
- No Custody: Users maintain full control of tokens
- Transparent Settlement: All burns are publicly verifiable
- Wallet Verification: All requests require wallet authentication
- Mobile: Full-screen voice circle, transcript below
- Tablet: Larger circle, optimized spacing
- Desktop: Optimal spacing, enhanced visual effects
- Touch-Friendly: All controls meet minimum touch target sizes
This is a private project. For questions or issues, contact the development team.
Proprietary - All rights reserved