MARKETPLACE INTELLIGENCE & AI CASE STUDY

MarketFlow Platform

Full-stack marketplace decision platform helping product teams analyze demand, diagnose cancellations, and simulate operational changes with Gemini AI.

Role
Developer & System ArchitectDirect Ownership
Timeline
2026 – PresentActive Lifecycle
Stack
Next.js 15TypeScriptPostgreSQLPrismaGemini AITailwind CSS
Status
DeployedProduction Verified
From Problem to Product
FROM NEED TO PRODUCTION
INPUTS
Sudden GMV drop-offs
Peak cancellation spikes
Siloed buyer & rider datasets
CORE SYSTEM
Next.js 15
TypeScript
PostgreSQL
Prisma ORM
Gemini AI
Scenario Engine
OUTPUTS
Marketplace Health Overview
Gemini Causal Root-Cause Engine
What-If Margin Simulator
1. INGEST & MODEL
2. CAUSAL INFERENCE
3. DECIDE & EXECUTE
02 / PRODUCT SHOWCASE

Web Platform & Mobile Interface

Production Builds
MarketFlow Web Platform
Live Platform · marketflow-ub.vercel.app
marketflow-ub.vercel.app/overview
MarketFlow Product Interface
Marketplace Health Overview · Core Decision Metrics & Operations Dashboard
marketflow-ub.vercel.app/intelligence/investigate
MarketFlow Interface Details
AI Decision Investigation · Gemini Causal Database Queries & Root-Cause Analysis
Problem vs. Resolution Matrix
FRICTION ANALYSIS
Friction 01

Black-Box Metric Drops

Standard dashboards show conversion dropped, but can't explain if rider shortages, kitchen delays, or pricing caused it.

Resolution

Gemini inspects underlying PostgreSQL transaction records to identify exact root causes.

Friction 02

Fragmented Data Silos

Buyer conversion, restaurant capacity, and rider ETAs live in disconnected systems with no cross-correlation.

Resolution

Unified overview synchronizing demand, supply, and fulfillment in real time.

Friction 03

Blind Operational Changes

Testing delivery fee tweaks or promotions in production risks margin collapse without prior impact modeling.

Resolution

What-If Simulator forecasting contribution margin and order volume before rolling changes live.

Scope Discipline: Features Killed
WHAT WE SAID NO TO
Unconstrained Chatbot
Why Rejected

Open-ended LLM chats hallucinate numbers and give non-reproducible answers that cannot be trusted in decisions.

Shipped Instead

Schema-grounded prompts where Gemini queries verified PostgreSQL records directly.

Static CSV Dumps
Why Rejected

Raw spreadsheets detach data from operational context and require manual formulas.

Shipped Instead

Interactive What-If simulation engine & marketplace equilibrium tree.

Client-Side Heavy Aggregations
Why Rejected

Running complex calculations in the browser causes memory lag and crashes.

Shipped Instead

Server-side optimized PostgreSQL indexing with Prisma aggregations.

Aggressive 1-Second Polling
Why Rejected

Exhausts database connection limits and wastes serverless compute.

Shipped Instead

Event-driven revalidation with cached summary views and on-demand AI deep analysis.

Engineering & Architecture Ownership
LEADERSHIP & EXECUTION
End-to-End System Development: Engineered the full platform from scratch using Next.js 15 App Router, TypeScript, Prisma, and PostgreSQL.
Relational Database Modeling: Designed the normalized PostgreSQL schema to index and aggregate 500,000+ order records, cancellation states, and restaurant nodes.
Gemini AI Investigation Engine: Implemented structured prompt grounding and database evidence retrieval pipelines so Gemini conducts fact-based causal analyses without hallucinations.
Simulation & Equilibrium Logic: Built deterministic what-if mathematical models to evaluate contribution margin elasticity against rider shortages and discount promotions.

Architectural Trade-offs

Schema-grounded SQL retrieval for Gemini instead of unconstrained LLM chat

Why: Prevents AI hallucinations on critical financial metrics (GMV, cancellation rate) by feeding strictly verified PostgreSQL aggregates into prompt context.

Trade-off: Demanded rigid API route schemas with deterministic Zod validation.

Server-side Prisma aggregations over client-side data crunching

Why: Delivering real-time overview health across 500,000+ orders requires zero-lag database-level indexing to prevent browser memory exhaustion.

Trade-off: Required custom PostgreSQL index tuning on composite order timestamp and city partition columns.

Shipped Deliverables

Marketplace Health Overview tracking GMV, delivered orders, and active customer volume.
AI Decision Investigation powered by Gemini querying PostgreSQL database evidence.
What-If Simulator & Equilibrium Tree modeling supply vs. demand balance.
Incident Center tracking delivery partner shortages and operational anomalies across cities.
● Deployed live on Vercel at marketflow-ub.vercel.app with full-stack Next.js 15, PostgreSQL, Prisma, and Gemini AI.