An open API service indexing awesome lists of open source software.

https://github.com/triptigithub/memer


https://github.com/triptigithub/memer

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

# MemeHustle

A cutting-edge meme marketplace where users can create memes, place bids, upvote favorites, and enjoy AI-generated captions and vibes. Built with a React + Vite frontend (styled with Tailwind CSS) and a Node.js + Express backend, powered by Supabase (PostgreSQL) and Socket.IO for real-time updates. AI caption and vibe features are stubbed with fallback logic, ready for full API integration.

[![Node.js](https://img.shields.io/badge/Node.js-16%2B-43853D?logo=node.js&logoColor=white)](https://nodejs.org/)
[![React](https://img.shields.io/badge/React-18.2.0-61DAFB?logo=react&logoColor=white)](https://reactjs.org/)
[![Vite](https://img.shields.io/badge/Vite-4.x-646CFF?logo=vite&logoColor=white)](https://vitejs.dev/)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-3.x-38B2AC?logo=tailwind-css&logoColor=white)](https://tailwindcss.com/)
[![Supabase](https://img.shields.io/badge/Supabase-PostgreSQL-3ECF8E?logo=supabase&logoColor=white)](https://supabase.com/)
[![Socket.IO](https://img.shields.io/badge/Socket.IO-realtime-010101?logo=socket.io&logoColor=white)](https://socket.io/)

---

## โœจ Features

- **๐Ÿ“ Meme Creation**:Easily add memes by submitting a title, image URL, and tags.
- **โšก Real-Time Bidding**: Place live bids on memes with instant updates showing the highest bid.
- **๐Ÿ‘ Upvote/Downvote & Leaderboard**: Upvote or downvote memes and explore the top-ranked submissions Generate clever captions and vibe descriptions (currently stubbed, replaceable with real AI API).Generate witty captions and โ€œvibeโ€ descriptions (stubbed with fallback; replace with real API if available).
- **๐Ÿ” Search & Grid View**: Search memes by title or tags with a clean, always-grid layout.
- **๐Ÿ”’ Mock Authentication**: User sessions identified by random UUIDs stored in localStorage.
- **๐ŸŽจ Modern UI**: Responsive design featuring clean cards, a search bar, and smooth loading states.
---

## ๐Ÿ› ๏ธ Tech Stack

- **Frontend**: React, Vite, Tailwind CSS, lucide-react icons, Axios, Socket.IO client.
- **Backend**: Node.js, Express, Socket.IO, @supabase/supabase-js, Axios (for AI stubs), dotenv.
- **Database**: Supabase (PostgreSQL). Tables: `memes`, `bids`; RPC for upvote increments.
- **Deployment**:
- Backend: Render.
- Frontend: Vercel.
- **AI Integration**: Stubbed calls with random fallback; replace in `backend/src/services/aiService.js` if you have a key/spec.

---

## ๐Ÿ”ง Prerequisites

- Node.js (v16+), npm
- Supabase project (hosted) with URL and Service Role Key
- (Optional) AI API key for real integration; otherwise stub/fallback is used

---

## Environment Variables

### Backend (`backend/.env`)

Copy `backend/.env.example` and fill:
```env
SUPABASE_URL=https://.supabase.co
SUPABASE_SERVICE_KEY=
GOOGLE_GEMINI_API_KEY=
PORT=5000
```
### Frontend (frontend/.env)
```env
VITE_API_URL=https:///api
VITE_SOCKET_URL=https://
```
## Supabase Schema
In Supabase Dashboard โ†’ SQL Editor, run:

1. **Enable UUID extension** (if needed):
```sql
create extension if not exists "uuid-ossp";
```
2. **Create memes table**:
```sql
create table if not exists memes (
id uuid primary key default uuid_generate_v4(),
title text not null,
image_url text not null,
tags text[] not null,
upvotes integer not null default 0,
owner_id text not null,
caption text,
vibe text,
created_at timestamp with time zone default now()
);
create index if not exists idx_memes_tags on memes using gin (tags);
```
3. **Create bids table**:
```sql
create table if not exists bids (
id uuid primary key default uuid_generate_v4(),
meme_id uuid references memes(id) on delete cascade,
user_id text not null,
credits integer not null,
created_at timestamp with time zone default now()
);
create index if not exists idx_bids_meme_id on bids(meme_id);
```
4. **Create RPC to increment upvotes**:
```sql
create or replace function increment_upvotes(p_meme_id uuid, p_delta int)
returns void language plpgsql as $$
begin
update memes
set upvotes = coalesce(upvotes, 0) + p_delta
where id = p_meme_id;
end;
$$;
```
Confirm tables and function in Table Editor.

## Local Development
### Backend
```bash
cd backend
npm install
cp .env.example .env
# Edit .env with your Supabase details
npm run dev
```
### Frontend
```bash
cd frontend
npm install
# (Optional) create .env with VITE_API_URL/VITE_SOCKET_URL if needed
npm run dev
```
## Deployment
### Backend on Render
- Root Directory:
```bash
backend
```
- Build Command:
```bash
npm install
```

- Start Command:
```bash
npm start
```

- Set environment variables in Render: SUPABASE_URL, SUPABASE_SERVICE_KEY, GOOGLE_GEMINI_API_KEY, etc.

- Ensure CORS allows your frontend domain.

## Frontend on Vercel
- Connect repo to Vercel.

- Build Command:
```bash
npm run build
```

- Output Directory:
```bash
dist
```

- Set environment variables:
```env
VITE_API_URL=https:///api

VITE_SOCKET_URL=https://
```
- Deploy and verify live site.

## Usage
- **Home**: Browse memes in a responsive grid.

- **Search**: Filter by title or tags.

- **Create**: Click โ€œCreateโ€, fill title, image URL, tags.

- **Bid**: Enter bid amount on a meme card; highest bid updates live.

- **Vote**: Upvote or Downvote; leaderboard reflects votes.

- **AI Buttons**: โ€œCaptionโ€ / โ€œVibeโ€ show fallback or real API result if configured.