Polyjuice is a beautiful, modern web application that provides a search engine-like interface for discovering and interacting with Farcaster users. Built with Rust and WebAssembly, it offers lightning-fast performance and a seamless user experience.
- π Smart Search: Search users by FID or username with instant results
- π¬ AI Chat: Interactive chat sessions with users powered by SnapRAG
- π Social Analytics: Deep insights into user behavior and social circles
- π³ Web3 Payments: Integrated x402 payment system for premium features
- π± Responsive Design: Perfect experience on desktop and mobile
- β‘ Lightning Fast: Built with Rust WebAssembly for optimal performance
- π¨ Modern UI: Clean, Google-inspired interface with smooth animations
Visit polyjuice.0xbase.ai to try Polyjuice right now!
- Frontend: Yew (Rust WebAssembly framework)
- Build Tool: Trunk
- Styling: Pure CSS with modern design principles
- API: RESTful integration with SnapRAG backend
- Payments: x402 protocol for Web3 payments
- Deployment: GitHub Pages with GitHub Actions
- Enter a FID: Type any Farcaster ID (e.g., 1, 2, 3, 100, 1000) in the search box
- Search: Click the search button or press Enter
- View Results: See detailed user information including:
- Profile picture and display name
- Username and FID
- Bio/description
- Social analytics and influence scores
- Social circles and interaction patterns
- Search for a user to load their profile
- Click the chat button π to start an AI-powered conversation
- Ask questions about the user's activity, interests, or opinions
- Get contextual responses based on their Farcaster history
- Connect MetaMask wallet for premium features
- Automatic payment prompts for paid API calls
- Secure EIP-712 signatures for payment authorization
- Transparent pricing with x402 protocol
- Rust (nightly toolchain)
- Trunk (Rust WASM build tool)
- Node.js (for JavaScript wallet integration)
- Clone the repository:
git clone https://github.com/RyanKung/polyjuice.git
cd polyjuice- Install Trunk:
cargo install trunk- Start development server:
make serve- Open your browser to
http://localhost:8080
# Development
make serve # Start dev server on port 8080
make serve-dev # Start dev server on port 8081
make watch # Watch for changes and rebuild
# Building
make build # Build WebAssembly application
make build-prod # Build for production
make build-deploy # Build for deployment (uses snaprag.0xbase.ai)
# Code Quality
make check # Check code without building
make fmt # Format code
make clippy # Run clippy linter
# Deployment
make deploy # Deploy to GitHub Pages
make clean # Clean build artifacts
make help # Show all commandsConfigure the API server URL using one of two methods:
Set environment variable during build:
# Development with custom API URL
SNAPRAG_API_URL=http://192.168.1.100:3000 make serve
# Production build with custom API URL
SNAPRAG_API_URL=https://api.yourdomain.com make build-prod- Create
.envfile (if it doesn't exist):
touch .env- Edit
.envto set your configuration:
SNAPRAG_API_URL=http://127.0.0.1:3000
# Optional: API Authentication
# Generate tokens using: snaprag auth generate --name your_token_name
AUTH_TOKEN=your_token_name
AUTH_SECRET=hex_encoded_secret_key_here- Run:
make serveNote: The .env file is automatically loaded when running make serve or make build-prod.
If your SnapRAG API server has authentication enabled, you can configure authentication tokens in the .env file:
- Generate a token on the server:
snaprag auth generate --name production_client- Add to
.env:
AUTH_TOKEN=production_client
AUTH_SECRET=a1b2c3d4e5f6... # The hex-encoded secret from step 1- Rebuild the application:
make serve # or make build-prodAll API requests will automatically include authentication headers (X-Token, X-Timestamp, X-Signature) when these environment variables are set.
Polyjuice is automatically deployed to GitHub Pages at polyjuice.0xbase.ai when changes are pushed to the master branch.
# Deploy to production
make deployThis will:
- Build the application with production API URL (
https://snaprag.0xbase.ai/) - Commit changes to git
- Push to master branch
- Trigger GitHub Actions deployment
The deployment process includes:
- Rust + Trunk build with WASM optimization
- Automatic API configuration for production
- GitHub Pages deployment with custom domain
- Caching for faster builds
Polyjuice integrates with the SnapRAG API to fetch user data:
- Base URL:
https://snaprag.0xbase.ai/(production) - Endpoints: Multiple RESTful endpoints for profiles, social data, and chat
- Authentication: x402 payment protocol for premium features
- Response Format: JSON with comprehensive user data
/api/health- Health check/api/profiles/{fid}- User profile data/api/social/{fid}- Social analytics/api/search/profiles- Semantic profile search/api/search/casts- Semantic cast search/api/rag/query- AI-powered RAG queries/api/chat/create- Create chat sessions/api/chat/message- Send chat messages
Polyjuice embodies modern web design principles:
- Minimalism: Clean, uncluttered interface focusing on essential elements
- Performance: Rust WebAssembly for lightning-fast user experience
- Accessibility: Responsive design that works on all devices
- User-Centric: Intuitive navigation and clear information hierarchy
Try searching for these popular Farcaster users:
- @vitalik.eth - Ethereum founder
- @jesse.base.eth - Base protocol lead
- @ryankung.base.eth - Developer and builder
- FID 1, 2, 3 - Early Farcaster users
We welcome contributions! Please ensure all code follows our standards:
- Written in Rust with proper error handling
- Fully documented with clear comments
- Security-focused with input validation
- Performance-optimized for WebAssembly
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Live Demo: polyjuice.0xbase.ai
- SnapRAG API: snaprag.0xbase.ai
- GitHub Repository: github.com/RyanKung/polyjuice
- Deployment Status: GitHub Actions
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ and Rust by the 0xbase.ai team
Part of the SnapRAG ecosystem
