Turn your trading PnL screenshots into viral memes instantly! HyperMeme uses OCR to detect your profit/loss, automatically selects the perfect meme based on sentiment, and lets you share your trading wins (or losses) with style.
- πΈ Easy Upload - Drag and drop your PnL screenshot
- π€ Smart OCR - Automatically detects profit/loss percentages using Tesseract.js
- π Sentiment Analysis - Classifies your PnL as positive, negative, or neutral
- π¨ Auto Meme Selection - Fetches relevant memes from Tenor API based on sentiment
- πΌοΈ Image Composition - Overlays memes on your screenshot with randomized positioning
- π± Share to X (Twitter) - One-click sharing with pre-filled text
- β¬οΈ Download - Save your meme as PNG
- π Shuffle - Don't like the meme? Generate a new one!
- Node.js 18+ (Note: create-next-app requires Node 20+, but the app itself works with 18+)
- npm or yarn
-
Clone the repository
cd HyperMeme -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# Optional: Get your Tenor API key from https://developers.google.com/tenor/guides/quickstart # The app works with a demo key, but you may hit rate limits NEXT_PUBLIC_TENOR_API_KEY=your_tenor_api_key_here # Optional: Use Giphy instead (https://developers.giphy.com/) # NEXT_PUBLIC_GIPHY_API_KEY=your_giphy_api_key_here
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
HyperMeme/
βββ app/
β βββ page.tsx # Main application page
β βββ layout.tsx # Root layout
β βββ globals.css # Global styles
βββ components/
β βββ UploadZone.tsx # Drag-and-drop upload component
β βββ PnLDisplay.tsx # PnL detection display
β βββ MemePreview.tsx # Meme preview component
β βββ ShareButtons.tsx # Download and share buttons
βββ lib/
β βββ types.ts # TypeScript type definitions
β βββ ocr.ts # OCR and PnL extraction logic
β βββ memeFetcher.ts # Tenor/Giphy API integration
β βββ imageComposer.ts # Canvas-based image composition
βββ public/ # Static assets
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router) + React 18 |
| Styling | Tailwind CSS |
| Language | TypeScript |
| OCR | Tesseract.js |
| Meme API | Tenor (primary) / Giphy (fallback) |
| Image Processing | HTML Canvas API |
| Deployment | Vercel-ready |
- Upload - User uploads a PnL screenshot (PNG/JPG)
- OCR Analysis - Tesseract.js extracts text and finds PnL percentage using regex
- Sentiment Classification:
PnL > 2%β Positive (celebration memes)PnL < -2%β Negative (crying memes)|PnL| < 2%β Neutral (coping memes)
- Meme Fetching - Tenor API fetches relevant memes based on sentiment
- Image Composition - Canvas API overlays meme on screenshot
- Share/Download - User can download or share to X (Twitter)
Edit lib/memeFetcher.ts:
const SEARCH_QUERIES: Record<PnLSentiment, string[]> = {
positive: ['celebration meme', 'dancing meme', 'we are so back meme'],
negative: ['crying meme', 'bro is cooked meme', 'disaster meme'],
neutral: ['barely surviving meme', 'coping meme', 'we are okay meme'],
};Edit lib/imageComposer.ts:
const composed = await composeImages({
pnlImage: imageUrl,
memeImage: meme.url,
memeSize: 35, // Percentage of image width (adjust this)
memePosition: 'random', // 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'random'
});- Push your code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
The app is a standard Next.js application and can be deployed to:
- Netlify
- Railway
- Cloudflare Pages
- AWS Amplify
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_TENOR_API_KEY |
No | Tenor API key (falls back to demo key) |
NEXT_PUBLIC_GIPHY_API_KEY |
No | Giphy API key (optional fallback) |
- Visit Google Tenor API
- Create a project in Google Cloud Console
- Enable Tenor API
- Create credentials and copy API key
- Visit Giphy Developers
- Create an app
- Copy API key
Note: The app works out of the box with Tenor's demo key, but you may hit rate limits with heavy usage.
- Ensure the screenshot has clear, readable text
- Try images with higher resolution
- Make sure the PnL percentage is visible and not obscured
- Check your internet connection
- Verify API keys are set correctly
- Check browser console for CORS errors
- Make sure you're using Node.js 18+
- Delete
node_modulesand.nextfolders, then runnpm installagain - Check that all dependencies are installed
- Hyperliquid API integration for live PnL fetching
- Video/GIF export support
- Meme curation dashboard
- User meme history/gallery
- Social leaderboard ("Top memes of the week")
- Custom meme upload option
- Multi-position overlay with multiple memes
- Text overlay customization
Contributions are welcome! 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
MIT License - feel free to use this project however you'd like!
- Hyperliquid - The inspiration for this project
- Tesseract.js - OCR engine
- Tenor - GIF API
- Next.js - React framework
Having issues? Open an issue on GitHub or reach out to the community.
Made with π₯ for the trading community | Join Hyperliquid