CiscoChemicals-B2BManufacturingPlatform
A B2B procurement platform featuring RAG-powered AI assistance, automated RFQ workflows, dynamic PDF invoicing, and Stripe-secured checkout. Built with Next.js 15, Payload CMS 3.0, and PostgreSQL (NeonDB).

The Challenge
The core challenge was bridging the gap between static content and dynamic AI interactions. Implementing a RAG-based AI assistant that accurately retrieves real-time product specs from PayloadCMS was complex. Additionally, orchestrating the 'Quote-to-Invoice' workflowβwhere approved quotes automatically trigger PDF generation and email dispatch via Server Actionsβrequired precise state management to prevent data inconsistencies.
TECHNOLOGIES USED
π¨ Frontend
βοΈ Backend
ποΈ Database
π DevOps
The Solution
β Next.js 15 + PayloadCMS 3.0 + Neon DB for a robust, type-safe architecture. β Google Gemini 1.5 Flash (RAG) for AI-driven live inventory intelligence. β Stripe + Payload Hooks + Resend for automated quoting and invoicing workflows.
Type Safety
Email Automation
Core Integrations
System Architecture & Security
src/βββ app/ # Next.js App Routerβ βββ (app)/ # Client routes (Cart, Checkout, Profile)β β βββ (home)/ # Public homepage & pricingβ β βββ checkout/ # Client checkout UIβ β βββ quick-order/ # Bulk ordering routeβ βββ (payload)/ # CMS admin dashboard routerβ βββ api/chat/ # RAG streaming endpointβββ collections/ # Payload CMS schemasβ βββ Products.ts # Inventory & filtersβ βββ Quotes.ts # RFQ workflow + email hooksβ βββ Orders.ts # Order recordsβ βββ Users.ts # Auth + RBAC schemaβββ modules/ # Domain logic (auth, checkout, dashboard)βββ providers/ # Global state (Currency, Theme, Query)Security Model
Role-Based Access Control
Full system access, including database records and the Executive Analytics Dashboard.
Add/update products and categories, approve and modify bulk quote pricing.
Browse products, manage profile, submit orders and RFQ (Request for Quote) submissions.
Secured via Payload CMS access control and collection-level field permissions.
Key Decisions
Why PayloadCMS over WordPress?
Needed a developer-first, headless CMS that seamlessly integrates with a modern Next.js stack while providing strong typing via TypeScript.
Why RAG for the AI?
LLMs hallucinate. By using Retrieval-Augmented Generation, we forced the AI to only answer using the exact stock data from our database.
Why React PDF?
We needed pixel-perfect, automated invoice generation. React PDF allowed us to build invoices using the same component logic we use for the web.
What I Learned
Hardest Part
Orchestrating the post-purchase webhook lifecycle where Stripe confirms payment, triggers Payload hooks, generates a PDF, and emails the client via Resend.
Biggest Insight
Serverless databases (Neon) are incredible for scaling, but managing connection pooling in serverless functions is critical to prevent cold start timeouts.
Do Differently
I would introduce a queueing system like Upstash/Redis for the email processing to ensure the checkout UI resolves instantly regardless of third-party API delays.
Key Highlights
B2B RFQ System
Complete 'Request for Quote' workflow allowing admins to approve custom prices & quantities.
AI Product Assistant
RAG-based Chatbot using Gemini 1.5 Flash that answers queries based on live inventory data.
Dynamic Invoicing
Automated generation of downloadable PDF invoices with unique transaction IDs post-payment.
Admin Analytics
Visual dashboard using Recharts to track monthly sales, quote conversion rates, and inventory.
Next Project