Case Study
SaleBuy
A modern full-stack C2C classifieds marketplace built with Next.js and MongoDB β featuring an innovative Google Gemini AI auto-listing engine to reduce user friction.

Automating Classifieds Listing via Multimodal AI
SaleBuy is a classifieds marketplace platform. Traditional marketplace flows suffer from high post-registration churn. Sellers drop off during the ad creation phase because typing descriptive details, choosing subcategories, and formatting titles is time-consuming.
We solved this by developing a custom Next.js full-stack system integrated with the Gemini 1.5 Flash model. When sellers upload a photo of their item, the backend analyzes its visual traits, maps it to category indexes, and auto-populates the fields in under 10 seconds.
Goals
- Eliminate ad-listing friction for marketplace sellers.
- Auto-populate title, description, and category fields directly from an uploaded product photo.
- Deliver a secure, rate-limited classified ads engine with live chat functionalities.
Challenges
- Parsing raw unstructured AI output streams into consistent, valid JSON formats.
- Transmitting large, high-res photos to Gemini API endpoints without increasing network latency.
- Securing B2C marketplace listings from spam injection bots and automated crawl scripts.
Gemini 1.5 Flash Vision Pipeline
1. Image Compression
To prevent network lag and cut API execution latency, uploaded files are parsed and resized client-side using a canvas resampling pipeline before transmitting to the backend.
2. Strict JSON Prompts
The backend directs the Gemini vision model using explicit parameters, requesting title, description, and category tags formatted in clean, parseable JSON keys without markdown markers.
3. Form Pre-Population
The returned JSON is parsed and immediately fed into the frontend form hook. The user sees a fully completed draft in under 10 seconds, leaving them only to set the price and hit post.
A secure, responsive full-stack platform
- 1Modern glassmorphism interface styled with vibrant cyan and purple neon gradients.
- 2Integration of Gemini 1.5 Flash vision model to analyze product visual features.
- 3Pre-compression of images client-side using canvas resampling before API dispatch.
- 4Next-Auth wrapper for user authentication, coupled with mongoose schemas for user-item relations.
- 5Security reinforcement using express-rate-limit and Helmet protection packages.
Key Outcomes
- Achieved 90%+ AI category mapping accuracy across 30+ category groups.
- Reduced ad-listing time by 95% (from 4 minutes to under 10 seconds).
- Rendered listing feeds under 0.9s LCP via optimized static queries and indexes.
Marketplace screens & visual layouts



14-day sprint to launch
Database & Auth Setup
Days 1-3
Designed MongoDB models for users, items, and chats, and integrated Next-Auth configurations.
Marketplace UI Build
Days 4-7
Coded responsive search filters, item listings, product detail grids, and live seller-buyer chat boxes.
Gemini Vision Integration
Days 8-11
Programmed base64 image pipelines, created prompt sets, and built strict JSON return parsers.
Security & Optimization
Days 12-14
Configured rate limiters, Helmet headers, sharp compression, and compiled production code.
"By integrating the Gemini 1.5 Flash vision model, we turned a standard marketplace listing form into a 10-second magic trick. Users just upload a photo and the AI writes the rest."
Classifieds AI engineering insights
Clean structured JSON outputs
Gemini can return format inconsistencies if prompts are open. Explicit system instructions combined with client-side JSON sanitizing resolves parsing failures.
Pre-compressing files saves bandwidth
Sending raw camera photos directly to AI endpoints wastes payload size and increases response time. Resampling files to under 1MB client-side cuts API latency by 50%.
Marketplace rate limits
AI listing endpoints are highly susceptible to bot attacks. Encasing endpoints inside Next-Auth CSRF checks and rate limiters shields resources from abuse.
Explore the platform architecture
See the Next.js and MongoDB codebase in context.