Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

marvelxcodes/Cringe

Repository files navigation

AI Meme Generator 🎨✨

A full-stack, AI-powered meme generator built with Next.js 15, Fabric.js, Supabase, and Google's Gemini AI.

πŸš€ Features

  • AI-Powered Generation: Use Google's Gemini AI to generate witty meme captions
  • Interactive Editor: Full-featured Fabric.js canvas editor with:
    • Text manipulation (add, edit, move, resize, rotate)
    • Undo/Redo functionality
    • Keyboard shortcuts
    • Real-time preview
  • Template Library: Browse and filter meme templates by category
  • Cloud Storage: Save and manage your memes with Supabase
  • Modern UI: Beautiful glassy UI with smooth animations
  • TypeScript: Fully typed for better developer experience

πŸ› οΈ Tech Stack

  • Frontend: Next.js 15 (App Router), React 19, TypeScript
  • Styling: Tailwind CSS v4 (CSS-first configuration)
  • Canvas Editor: Fabric.js
  • AI: Google Gemini API
  • Backend: Supabase (Database + Storage)
  • Package Manager: Bun

πŸ“‹ Prerequisites

Before you begin, ensure you have:

  • Node.js 18+ or Bun installed
  • A Supabase account and project
  • A Google AI Studio API key (for Gemini)

πŸ”§ Quick Start

1. Install Dependencies

# From the monorepo root
bun install

2. Set Up Environment Variables

Copy .env.example to .env.local and fill in your credentials:

cp .env.example .env.local

Required variables:

  • NEXT_PUBLIC_SUPABASE_URL - Your Supabase project URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY - Your Supabase anonymous key
  • GEMINI_API_KEY - Your Google Gemini API key

3. Set Up Database

Follow the instructions in /docs/DATABASE_SETUP.md to:

  • Create Supabase tables
  • Set up storage bucket
  • Seed sample templates

4. Run the Development Server

# From the monorepo root
bun run dev --filter=web
# The app will be available at http://localhost:3000

πŸ“– Documentation

🎯 Usage

  1. Select a Template: Browse the home page and click on a meme template
  2. Enter a Prompt: Describe your meme idea (e.g., "Make this about Monday mornings")
  3. AI Generation: Gemini will suggest meme text
  4. Edit in Canvas: Use the Fabric.js editor to customize
  5. Save or Download: Save to Supabase or download locally

Editor Shortcuts

  • Add Text: Click "Add Text" button
  • Undo: Ctrl/Cmd + Z
  • Redo: Ctrl/Cmd + Y
  • Delete: Delete or Backspace key
  • Edit Text: Double-click text objects

πŸ“ Project Structure

apps/web/
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ api/ # API routes (Gemini & Supabase)
β”‚ β”œβ”€β”€ generate/ # Meme generation page
β”‚ β”œβ”€β”€ gallery/ # Saved memes gallery
β”‚ └── page.tsx # Home page (templates)
β”œβ”€β”€ components/ # React components
β”œβ”€β”€ lib/ # Utilities and helpers
β”œβ”€β”€ types/ # TypeScript type definitions
└── README.md

πŸ”Œ API Endpoints

  • GET /api/templates - Fetch all meme templates
  • POST /api/generate-meme - Generate meme text with AI
  • POST /api/save-meme - Save meme to Supabase
  • GET /api/memes - Fetch all saved memes

πŸ› Troubleshooting

Server Won't Start

# Clear Next.js cache
rm -rf .next
# Reinstall dependencies
bun install

Tailwind Styles Not Working

See Tailwind v4 Setup Guide for configuration details.

Supabase Connection Issues

  • Verify environment variables are set correctly
  • Check Supabase RLS policies allow access
  • Ensure storage bucket is public

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“ License

This project is open source and available under the MIT License.


Built with ❀️ using Next.js, Fabric.js, Supabase, and Gemini AI

About

Resources

Stars

Watchers

Forks

Releases

No releases published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /