A React application that transforms your photos into the viral "Heads in Freezers" meme (241543903) using Google's Gemini AI. The API key is securely stored on the backend so anyone can use the app without entering credentials.
- Upload your photo
- Generate a meme using Google Gemini AI (API key protected on backend)
- Download your generated meme
- Beautiful, modern UI with Tailwind CSS
- Secure backend API proxy
- Install dependencies:
npm install-
Get your Google Gemini API key:
- Visit Google AI Studio
- Create a free API key
-
Create a
.envfile in the root directory:
GEMINI_API_KEY=your_api_key_here
PORT=3000
FRONTEND_URL=http://localhost:5173- Start the backend server (in one terminal):
npm run server- Start the frontend dev server (in another terminal):
npm run dev- Open your browser and navigate to
http://localhost:5173
See DEPLOYMENT.md for detailed step-by-step instructions.
Quick Summary:
- Deploy backend to Render with
GEMINI_API_KEYandFRONTEND_URLenvironment variables - Build frontend with
VITE_API_URLpointing to your Render backend - Upload built files to Namecheap
-
Push your code to GitHub
-
Import your repository on Vercel
-
Add environment variable:
- Go to Project Settings → Environment Variables
- Add
GEMINI_API_KEYwith your API key value
-
Deploy! Vercel will automatically:
- Build your frontend
- Deploy the serverless function from
api/generate-meme.js
-
Push your code to GitHub
-
Import your repository on Netlify
-
Build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
-
Add environment variable:
- Go to Site Settings → Environment Variables
- Add
GEMINI_API_KEYwith your API key value
-
Deploy! Netlify will use the serverless function from
netlify/functions/generate-meme.js
npm run buildThe built files will be in the dist directory.
✅ Secure: The API key is stored as an environment variable on the backend/serverless function, so it's never exposed to users.
❌ Insecure: Never hardcode your API key in frontend code - it will be visible to anyone who views the page source.
- React 18
- Vite
- Tailwind CSS
- Lucide React (icons)
- Express.js (backend server)
- Google Gemini API