GenForge Studio Logo

GenForge Studio

Services
Web DevelopmentStartup Web DevelopmentUI/UX DesignSaaS DevelopmentE-commerceTechnical SEOπŸ“ Lucknow Agency
Case StudiesAbout UsBlogsCareersCost Calculator
Website Audit
Contact

Contact

Home/Projects/SaleBuy

Case Study

SaleBuy

An AI-powered C2C classifieds marketplace where sellers upload a photo and Google Gemini writes the listing β€” reducing ad creation time from 4 minutes to 10 seconds.

Client
SaleBuy Marketplace
Industry
C2C E-commerce & Classifieds
Timeline
14 Days
Year
2026
AI Model
Gemini 1.5 Flash
Type
AI-Powered Marketplace
SaleBuy β€” Homepage with category browsing and AI-powered listing prompt
Business Challenge

Sellers drop off during listing creation

Every C2C marketplace faces the same problem: sellers sign up, browse the platform, start creating a listing... and abandon it. The listing creation form is where classifieds platforms lose most of their supply-side users.

Writing a good title, composing a description that actually sells the item, choosing the right category from a dropdown with 30+ options, and filling in condition and specifications takes 4+ minutes. For casual sellers listing a used phone or a piece of furniture, that's too much friction. They'll just post a photo on Instagram Stories instead.

SaleBuy's hypothesis was simple: what if the photo itself could write the listing? Upload a picture of a used iPhone, and the platform generates the title ("iPhone 14 Pro Max 256GB Deep Purple"), description, category (Electronics > Mobile Phones), and condition (Used - Good) automatically. The seller just sets a price and posts.

Goals

  • Reduce ad-listing time from 4+ minutes to under 15 seconds
  • Auto-populate title, description, and category from a product photo
  • Achieve 90%+ accuracy on AI-generated category mappings
  • Build seller-buyer chat for real-time negotiation
  • Secure the platform against spam bots and automated listing abuse

Constraints

  • AI output must be structured JSON β€” not freeform text
  • Image processing must be fast enough to feel 'instant' to users
  • Rate limiting must protect AI endpoints without blocking real users
  • 14-day timeline from concept to deployable MVP
Results

AI-driven marketplace metrics

Measured across the first 500 AI-generated listings after beta launch.

-95%
Listing Time
under 10 seconds
90%+
AI Accuracy
category + title mapping
0.9s
Feed LCP
optimized queries
14 Days
Build Time
concept to MVP
Solution

The Gemini vision pipeline

Client-Side Image Compression

Camera photos are 3-5MB. Sending raw files to Gemini wastes bandwidth and increases response time. We compress images client-side using HTML5 Canvas resampling β€” reducing file size to under 1MB without visible quality loss. This cut API latency by 50% and makes the feature usable on mobile data connections.

Structured Prompt Engineering

The Gemini prompt explicitly requests raw JSON with specific field names (title, description, category, condition) β€” no markdown, no commentary. We tested 15+ prompt variations to find the format that produces consistent, parseable output. The server-side parser has fallbacks for the 10% of cases where the model wraps output in code fences or adds explanatory text.

Form Pre-Population Flow

The parsed JSON is immediately injected into the React form state. The seller sees a completed draft in under 10 seconds β€” title, description, category all filled in. They review, adjust if needed, set a price, and post. The cognitive load drops from 'write a listing from scratch' to 'verify and price.'

Seller-Buyer Real-Time Chat

Once a listing is live, interested buyers can open a chat thread directly on the product page. Messages are stored in MongoDB with user references. The chat interface shows online status and supports multiple concurrent conversations per listing.

Gallery

Marketplace screens

SaleBuy β€” Search results with filters, category tags, and location-based sorting
SaleBuy β€” Search results with filters, category tags, and location-based sorting
SaleBuy β€” Product detail page with seller chat, AI-generated description, and image gallery
SaleBuy β€” Product detail page with seller chat, AI-generated description, and image gallery
SaleBuy β€” Next-Auth authentication with social login and email signup
SaleBuy β€” Next-Auth authentication with social login and email signup
Technology Stack

Why we chose each tool

N

Next.js 16

Server-side rendering for marketplace listing pages (critical for SEO β€” every product listing needs to be indexable). API routes handle Gemini integration and chat endpoints.

G

Google Gemini 1.5 Flash

The vision model analyzes product photos and returns structured JSON with title, description, category, and condition. Flash (not Pro) because latency matters more than depth for form pre-population.

M

MongoDB + Mongoose

User-generated marketplace data is inherently unstructured. Document databases handle variable product attributes across 30+ categories without rigid schema constraints.

N

Next-Auth

Pre-built authentication with social login support. Users can sign up with Google, reducing friction compared to email/password registration for a marketplace where trust matters.

C

Canvas Image Compression

Client-side image resampling before sending to Gemini API. Reduces 5MB camera photos to under 1MB without visible quality loss β€” cuts API latency by 50%.

e

express-rate-limit + Helmet

AI listing endpoints are expensive (each call costs API credits). Rate limiting prevents bot abuse. Helmet security headers protect against XSS and content injection in user-generated listings.

Process

14-day sprint to MVP

01

Database & Auth Setup

Days 1–3

Designed MongoDB schemas for users, listings, and chat threads. Integrated Next-Auth with social login providers and session management.

02

Marketplace UI Build

Days 4–7

Built responsive search with category filters, product detail pages with image galleries, and the seller dashboard for managing active listings.

03

Gemini Vision Pipeline

Days 8–11

Developed the image compression layer, prompt engineering for structured JSON output, server-side response parsing, and form pre-population flow.

04

Security & Launch

Days 12–14

Configured rate limiting on AI endpoints, Helmet security headers, spam detection on listings, and deployed the production build.

Engineering Challenges

Problems we solved

Parsing Non-Deterministic AI Output

LLM outputs aren't consistent. Gemini sometimes wraps JSON in markdown code fences, sometimes adds explanatory text before the JSON, and occasionally uses different field names than requested.

Solution: A multi-layer parser: (1) strip markdown code fences with regex, (2) find the first valid JSON object using bracket matching, (3) normalize field names to our schema, (4) apply defaults for any missing fields. The user always sees a complete form β€” the parser handles the AI's inconsistencies silently.

AI Endpoint Cost Protection

Each Gemini API call costs money. A bot creating thousands of fake listings could drain the API budget in hours.

Solution: Three protection layers: (1) Next-Auth session requirement β€” you must be logged in to create listings, (2) per-IP rate limiting β€” max 20 AI calls per hour, (3) file type validation β€” only JPEG/PNG/WebP are accepted. Combined, these prevent both automated abuse and accidental over-use.

"

The AI listing feature is genuinely magical from a user perspective. You upload a photo of a used guitar, and in 10 seconds the form is filled with 'Yamaha FG800 Acoustic Guitar β€” Natural Finish, Used - Good Condition.' The seller just sets the price. That's the kind of UX that makes people tell their friends.

SaleBuy Product Team
SaleBuy Marketplace
FAQ

Questions about this project

How does the AI auto-listing feature work?+
The seller uploads a photo of their item. The image is compressed client-side (canvas resampling to under 1MB), then sent to the Gemini 1.5 Flash vision model with a structured prompt requesting JSON output: title, description, category, and condition. The backend parses the response and pre-populates the listing form. The seller reviews, sets a price, and posts β€” the entire process takes under 10 seconds instead of the typical 4+ minutes of manual typing.
Why Gemini 1.5 Flash instead of GPT-4 Vision or Claude?+
For form pre-population, latency matters more than reasoning depth. Flash returns structured responses in 1-2 seconds β€” fast enough that the user perceives the form as 'instant.' GPT-4 Vision and Claude are more capable for complex analysis, but their higher latency would make the listing flow feel sluggish. Flash also has lower per-call costs, which matters when every listing triggers an API call.
How do you handle AI output inconsistencies?+
LLM outputs aren't deterministic. Sometimes Gemini wraps JSON in markdown code blocks, sometimes it adds commentary before the JSON, sometimes field names vary. We handle this with: (1) explicit system prompts requesting raw JSON without markdown, (2) server-side sanitization that strips code fences and finds the first valid JSON object, and (3) fallback defaults for any missing fields. The user always sees a complete form β€” worst case, one field might say 'Untitled' and they correct it.
What security measures protect the marketplace from spam?+
Three layers: (1) Next-Auth CSRF tokens on all form submissions prevent cross-site request forgery, (2) express-rate-limit caps AI endpoint calls per IP per hour (prevents one user from burning through API credits), and (3) Helmet security headers protect against XSS in user-generated listing descriptions. We also validate image file types server-side before sending to Gemini.
Can you build a similar AI-integrated marketplace for us?+
Yes. SaleBuy took 14 days. We need: your marketplace category structure, your preferred AI model (we can integrate Gemini, GPT-4, or Claude), your authentication requirements, and your monetization model (listing fees, featured placements, etc.). We handle the full-stack development including AI pipeline, chat system, and deployment.
Related Services

How we can help you

SaaS Development

AI-integrated platforms, auth systems, and subscription billing

Custom Web Development

Full-stack applications with Next.js, React, and MongoDB

E-commerce Development

Marketplaces, product catalogs, and checkout systems

Related Work

Similar projects

Forces Express

Full-stack logistics portal with shipping calculator and live tracking.

Full-StackMongoDBCalculator
View case study

KaamConnekt

Job portal with AI-powered matching and multi-role dashboards.

MarketplaceAIFull-Stack
View case study

Online Planet

E-commerce platform with admin dashboard and order management.

E-commerceDashboardNext.js
View case study

Want to build an AI-powered marketplace?

We integrate Gemini, GPT-4, and Claude into production applications β€” not demos.

Start a Project Estimate Cost
← All ProjectsNext: Forces Express β†’
GenForge Studio Logo
GenForge Studio

GenForge Studio is a digital agency based in Lucknow, India. We build high-performance websites, apps, and digital products for businesses ready to grow.

Services

  • All Services
  • Web Development
  • UI/UX Design
  • SaaS Development
  • E-commerce Development
  • Startup Web Development
  • Technical SEO
  • Web Agency Lucknow

Company

  • Projects
  • Clients & Results
  • About Us
  • Our Team
  • Careers
  • Read Blogs
  • Privacy Policy
  • Terms of Service
  • Cookies Settings

Get in touch

Have a project in mind? Let’s build something remarkable together.

hello@genforgestudio.com+91 72338 11034+91 73908 03067

Lucknow, IndiaUttar Pradesh

Schedule a call
Locations Served:LucknowNoidaDelhiBangaloreMumbaiPuneHyderabad

Β© 2026 GenForge Studio. All rights reserved.

PrivacyTermsRefund PolicyCookies

GenForge Studio