Advanced AI chat platform with cryptocurrency payments and Telegram authentication
- Accept BTC, ETH, USDC, USDT, DAI, and more via Coinbase Commerce
- Two pricing tiers: 7 Days ($30) and 30 Days ($80)
- Secure payment verification with webhook signatures
- Real-time payment status tracking
- One-click login with Telegram OAuth
- Secure identity verification
- No email/password required
- Privacy-preserving (only Telegram ID stored)
- Powered by X.AI Grok
- Markdown rendering with syntax highlighting
- Code block copy functionality
- Conversation history persistence
- Modern glassmorphism design
- Neon glow effects and animations
- Fully mobile-responsive
- Dark cyberpunk aesthetic
Frontend (HTML/CSS/JS)
โ
Vercel Serverless Functions
โ
External APIs:
โโ Coinbase Commerce (Payments)
โโ Telegram Bot API (Authentication)
โโ X.AI Grok (Chat AI)
See ARCHITECTURE.md for detailed flow diagrams
- Vercel account
- Coinbase Commerce account
- Telegram bot token
- X.AI API key
-
Clone and Deploy
git clone <your-repo> cd futuchat vercel
-
Configure Services (see QUICK_START.md)
- Set up Coinbase Commerce
- Create Telegram bot
- Add environment variables
-
Update Configuration
- Edit
app.jsline 381 with your bot username - Deploy changes
- Edit
-
Test Payment Flow
- Visit your deployed site
- Test with small payment amount
- Verify Telegram login works
๐ Detailed instructions: QUICK_START.md
Add these in Vercel Dashboard โ Settings โ Environment Variables:
# AI Chat (existing)
XAI_API_KEY=your_xai_key
SYSTEM_PROMPT=your_custom_prompt
# Crypto Payments (new)
COINBASE_COMMERCE_API_KEY=your_coinbase_key
COINBASE_WEBHOOK_SECRET=your_webhook_secret
# Telegram Auth (new)
TELEGRAM_BOT_TOKEN=1234567890:ABC...
TELEGRAM_BOT_USERNAME=your_bot_username๐ Setup guide: PAYMENT_SETUP_GUIDE.md
/workspace
โโโ index.html # Main UI
โโโ app.js # Frontend logic
โโโ styles.css # Styling
โโโ logo.svg # Brand logo
โ
โโโ api/
โ โโโ chat.js # X.AI Grok integration
โ โโโ create-charge.js # Create payment charge
โ โโโ webhook.js # Payment webhooks
โ โโโ verify-payment.js # Verify payment status
โ โโโ activate-telegram.js # Telegram auth & activation
โ
โโโ docs/
โโโ QUICK_START.md # Fast setup guide
โโโ PAYMENT_SETUP_GUIDE.md # Detailed payment setup
โโโ ARCHITECTURE.md # Technical architecture
โโโ IMPLEMENTATION_SUMMARY.md # What was built
- User visits site โ Sees pricing plans with "Buy with Crypto" buttons
- Clicks buy โ Redirects to Coinbase Commerce payment page
- Pays with crypto โ BTC, ETH, USDC, or other supported coins
- Payment confirms โ Returns to app with success screen
- Logs in via Telegram โ One-click OAuth authentication
- Auto-activation โ Access key generated and activated
- Access granted โ Can now use AI chat interface
See ARCHITECTURE.md for detailed flow diagrams
- โ Payment Verification: Webhook HMAC-SHA256 signature validation
- โ Identity Verification: Telegram auth hash cryptographic verification
- โ Access Control: SHA-256 hashed access keys with time-based expiration
- โ API Protection: Environment variables, HTTPS-only, sanitized errors
- No sensitive data in client code
- All secrets in environment variables
- Signature verification on all webhooks
- Auth timestamp expiration checks
- Hashed key storage (not plaintext)
# 1. Create test charge
curl -X POST https://your-domain.vercel.app/api/create-charge \
-H "Content-Type: application/json" \
-d '{"plan":"7-day","amount":30,"duration":7}'
# 2. Verify payment (after paying)
curl "https://your-domain.vercel.app/api/verify-payment?chargeCode=ABC123"- Click "Buy with Crypto" button
- Complete small test payment ($1-2)
- Return to app after payment
- Login with Telegram
- Verify auto-activation works
- Test chat functionality
| Endpoint | Method | Purpose |
|---|---|---|
/api/create-charge |
POST | Create Coinbase payment charge |
/api/webhook |
POST | Receive payment confirmations |
/api/verify-payment |
GET | Check payment status |
/api/activate-telegram |
POST | Verify Telegram & activate access |
/api/chat |
POST | AI chat endpoint (existing) |
See ARCHITECTURE.md for detailed API documentation
- QUICK_START.md - Fast setup in 20 minutes
- PAYMENT_SETUP_GUIDE.md - Complete payment setup
- ARCHITECTURE.md - Technical architecture & flows
- IMPLEMENTATION_SUMMARY.md - What was built
- VERCEL_ENV_SETUP.md - Environment variables
Beautiful pricing cards with "Buy with Crypto" buttons, neon glow effects, and "Most Popular" badge.
Animated success screen with Telegram login widget integration.
Modern dark theme with markdown rendering, code highlighting, and smooth animations.
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Backend: Vercel Serverless Functions (Node.js)
- Payments: Coinbase Commerce API
- Authentication: Telegram Bot API OAuth
- AI: X.AI Grok API
- Deployment: Vercel
- Storage: localStorage (client-side)
- Database: Vercel KV, Upstash Redis, or Supabase
- Monitoring: Sentry, LogRocket
- Analytics: Vercel Analytics, PostHog
- Crypto payment integration
- Telegram authentication
- Auto-activation flow
- Payment webhooks
- Beautiful UI/UX
- Mobile responsive design
- Comprehensive documentation
- Database integration for persistence
- User dashboard for subscription management
- Email notifications
- Admin panel
- Usage analytics
- Rate limiting
- Automated testing
- Team/organization plans
- Referral system
- Multiple pricing tiers
- API access tiers
- Mobile app
- White-label options
- "Payment system not configured" โ Add
COINBASE_COMMERCE_API_KEYto Vercel - "Invalid webhook signature" โ Check
COINBASE_WEBHOOK_SECRETmatches - Payment not confirming โ Wait for blockchain confirmation (can take 10-60 min for BTC)
- Login button not showing โ Update bot username in
app.js - "Telegram bot not configured" โ Register domain with @BotFather using
/setdomain - Auth failing โ Verify
TELEGRAM_BOT_TOKENis correct
- Check Vercel function logs for errors
- Verify all environment variables are set
- Test each API endpoint individually
- Clear browser cache and localStorage
See PAYMENT_SETUP_GUIDE.md for detailed troubleshooting
- Documentation: See docs/ folder
- Coinbase Commerce: https://commerce.coinbase.com/docs
- Telegram Bots: https://core.telegram.org/bots
- Vercel: https://vercel.com/docs
[Your License Here]
- Coinbase Commerce - Crypto payment infrastructure
- Telegram - Authentication platform
- X.AI - Grok AI model
- Vercel - Serverless deployment platform
- Read QUICK_START.md
- Set up Coinbase Commerce & Telegram bot
- Configure environment variables
- Deploy and test!
You'll be accepting crypto payments in 20 minutes! ๐
Built with โค๏ธ for the cybersecurity community