Skip to content

EricSun0218/MemeGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

136 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MemeGenerator · 热梗表情包生成器

Make the exact meme in your head, in 5 seconds.

A consumer SaaS that turns "I want a meme of a cat looking at a laptop crying with the caption '今天的 deadline'" into a finished, shareable image. Powered by Gemini, gated by Stripe, deployed on Vercel.

React 19 TypeScript Gemini Stripe Firebase

简体中文


TL;DR

User opens the app, types a one-line description ("a corporate cat in a suit clapping politely at a meeting, caption: 又是 OKR 季"), gets back a generated meme they can share to WeChat / iMessage / Slack in one tap.

The full product is shipped:

  • ✅ User auth (Firebase email + Google)
  • ✅ AI generation (Gemini)
  • ✅ Credit packs / paid tiers (Stripe)
  • ✅ Admin console (pricing, user mgmt, analytics)
  • ✅ Multi-payment-method support
  • ✅ Vercel serverless deployment

Not a prototype. Real users, real payments, real product.


The Insight

Memes are the lingua franca of the Chinese internet. WeChat groups, microblogs, comment sections — every social space runs on them.

But meme creation is broken:

  • Searching "the right meme" rarely works — the perfect one in your head doesn't exist on disk.
  • Making one in 美图秀秀 / Photoshop takes 5 minutes per attempt.
  • Generic AI image tools (Midjourney, SD) generate beautiful art — not memes. Memes need crap quality on purpose, the right cultural beat, and the punchline format.

The bottleneck isn't generation quality. It's getting a generic image model to produce something meme-shaped — fast, cheap, and culturally aware.

MemeGenerator is purpose-built for this single output format. The prompts are tuned, the post-processing knows meme aspect ratios, the caption layout is handled. The user types one line; the product does the rest.


Real-World Scenarios

1. WeChat group fights ("斗图"). Someone says something silly in a 50-person group chat. You want a perfectly cutting reply meme in 10 seconds. Searching is too slow; existing reaction packs don't cover this exact moment. MemeGenerator does.

2. Office Slack / Lark. A new product launch is happening. You want a celebratory team meme that doesn't suck. Generic stock images won't land; a custom one with the project codename will.

3. Content creators ("段子手") batch-producing. A microblog account that posts 5 memes a day. Each requires a unique image. Manually that's 25 minutes; here it's 1 minute and the credit cost is well under the engagement value.


How It Works

User types one line:
  "a tired panda holding a coffee mug, caption: 周一早上的我"
        │
        ▼
┌────────────────────────────────────┐
│ Frontend (React + Vite)            │
│  • Auth check (Firebase)           │
│  • Credit check                    │
└────────────────────────────────────┘
        │
        ▼
┌────────────────────────────────────┐
│ Vercel serverless API              │
│  • Validate session                │
│  • Decrement credit                │
│  • Call Gemini with meme-tuned     │
│    prompt template                 │
└────────────────────────────────────┘
        │
        ▼
┌────────────────────────────────────┐
│ Gemini generates image             │
│ Caption layout applied             │
│ Image returned to client           │
└────────────────────────────────────┘
        │
        ▼
User downloads / shares to WeChat / Slack

When the user runs out of credits → Stripe checkout for more credits → Firebase updates balance → user is back generating.


Key Design Decisions

1. Paid from day one (Stripe), not freemium-then-monetize. The temptation in any AI consumer app is to give it away free, gather users, monetize later. We rejected that. Generation costs real money (Gemini API calls aren't free), and freemium without monetization is a path to bleeding cash. Charging a small amount filters for users who actually want the product, not users who'll churn the moment a free tier is removed. Healthier signal, healthier unit economics.

2. Credit packs, not subscriptions. Subscriptions assume regular usage. Meme creation is spiky — a user might generate 20 memes during a viral moment and 0 for the next two weeks. Credit packs match the actual usage shape: pay for what you use, no commitment. Higher conversion, less churn, less pricing friction.

3. Firebase for auth, Vercel for serverless. The temptation in a payment-handling product is to build a "real" backend (Express + Postgres + auth tables). For an MVP-stage consumer app, this is over-engineering. Firebase auth + Firestore + Vercel serverless functions = zero ops, scales to 100k users, and lets us focus on the actual product (the AI prompt, the UX, the meme quality).

4. Multiple payment methods (Stripe primary, others configurable). The Chinese consumer market doesn't fully run on credit cards. The codebase has explicit configuration for multiple payment methods (PAYMENT_METHODS_SETUP.md), letting us add WeChat Pay or Alipay without restructuring. The flexibility doesn't cost much upfront; the lock-in cost of Stripe-only would have been brutal.

5. Admin console as a first-class feature. A consumer SaaS without an admin console is a consumer SaaS where the founder ships a code change every time pricing needs to be tweaked. The admin panel (ADMIN_CONFIG.md, PRICE_CONFIG.md) lets non-engineers adjust pricing, manage users, and watch analytics. Building it on day one is a 1-day cost; deferring it is months of context-switch pain.

6. Tuned for memes, not "general AI image gen". We could have shipped "AI image generation, but for memes" — a thin wrapper. We didn't. The prompts include meme-format conventions, the output enforces meme aspect ratios, the caption rendering uses meme typography. Generic models with thin wrappers lose to purpose-built; this product is purpose-built.


Get Started

git clone https://github.com/EricSun0218/MemeGenerator.git
cd MemeGenerator
npm install
cp env.example .env.local
# Fill in: GEMINI_API_KEY, FIREBASE_*, STRIPE_*
npm run dev

Setup guides for the integrations:


Roadmap

The vision: any human, any internet moment, gets the exact meme in their head out the door in 5 seconds.

Status Feature
✅ shipped Text-to-meme via Gemini
✅ shipped Firebase auth + credit system
✅ shipped Stripe payments + admin console
✅ shipped Vercel serverless deployment
🚧 next WeChat Pay + Alipay integration
🚧 next Meme template library — start from a known meme, customize
🚧 next One-click share to WeChat / 小红书 / Lark
🔭 future Group meme — multiple people contribute prompts to one collaborative meme
🔭 future Meme history + remix (your past memes, plus public ones, all remixable)
🔭 future Browser extension — generate from any text on any page

Related Work

What it does How MemeGenerator differs
美图秀秀 / Canva templates Manual editing on a template Requires the user to find the right template + do the edit. We generate from one line.
Existing meme search engines (e.g. 表情包搜索) Search a library of existing memes The perfect meme in your head usually doesn't exist on disk. We make it.
Midjourney / Stable Diffusion General AI image generation Generates beautiful art — not memes. Wrong output format, wrong aspect ratio, wrong cultural beat.
ChatGPT image gen Generic generation in chat No meme-tuned prompting, no caption layout, no payment-aware UX, no shareable export.

Tech Stack

  • Frontend — React 19 · TypeScript · Vite
  • AI — Google Gemini (@google/generative-ai)
  • Auth — Firebase Auth (email + Google)
  • Database — Firestore
  • Payments — Stripe (with extensible payment method config)
  • Deployment — Vercel serverless (api/ directory)
  • Image processing — Sharp

License

Private. Not for redistribution.

About

表情包生成

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors