All Work

I built the platform, backend, widget, auth flow, and AI routing system

DARPAN360

A Chatbot-as-a-Service platform where users create domain-specific bots, lock allowed domains, and embed a controlled AI widget on real websites.

DARPAN360 project visual

Project Type

Chatbot-as-a-Service AI platform

Stack

React, Vite, TailwindCSS, Framer Motion, Node.js, Express, MongoDB Atlas, Firebase Auth

AI Layer

Google Gemini, Groq Llama 3, multi-provider failover

Timeline

Built in 2026

Case Study

Engineering Notes

01

Project Overview

Darpan360 is a Chatbot-as-a-Service platform for creating domain-specific AI bots and embedding them into external websites. It is built for site owners who need a controlled support, lead-capture, or information assistant without building a fresh chatbot stack every time.

02

Problem / Motivation

Most chatbot demos look simple until they touch a real domain. You need auth, widget isolation, origin checks, session cleanup, model routing, and fallbacks. Without that control, the bot becomes a shiny iframe with commitment issues.

03

Architecture / System Design

The frontend uses React, Vite, TailwindCSS, and Framer Motion for the dashboard and widget flow. The backend runs on Node.js and Express with MongoDB Atlas for bot configuration, sessions, and domain rules. Firebase Auth handles user identity, while the AI layer routes generation through Gemini with Groq Llama 3 available as a fallback path.

The embed system checks the incoming origin against each bot's allowedDomains configuration during preflight. A Node Cron job clears abandoned sessions older than four hours so temporary conversations do not pile up forever. System hygiene, bhai, otherwise future debugging becomes archaeology.

04

Key Features

The platform focuses on deployability and control instead of just another chat box.

  • Embeddable chatbot widget for third-party websites.
  • Bot-specific domain locking through dynamic CORS validation.
  • Gemini generation with Groq Llama 3 fallback routing.
  • API key rotation for rate-limit recovery.
  • Session cleanup for abandoned conversations.

05

Technical Challenges

The hardest part was making the embed flow secure without making setup painful. The widget had to work across domains, but only for domains the owner allowed. AI provider limits also needed handling, because rate limits do not care about your launch mood.

06

Solutions / Engineering Decisions

I kept the platform split between dashboard control, widget runtime, and AI routing. Dynamic CORS was used because domain authorization belongs on the server, not inside frontend trust-me-bro logic. Provider failover and key rotation were added so a single model/API failure would not take the whole chat flow down.

07

Outcome / Final State

The final system can create bots, restrict where they run, embed them into external websites, route AI responses, and clean up stale sessions. It is a practical base for website AI assistants, with the reliability work sitting underneath the simple user flow.

AISaaSChatbotReactNode.jsMongoDB

Key Capabilities

Built an embeddable AI chatbot widget that can run on third-party websites.

Implemented Gemini generation, Groq/Llama 3 failover, and API key rotation for rate-limit recovery.

Secured embeds with dynamic CORS checks against each bot's allowedDomains configuration.

Used Node Cron to garbage-collect abandoned sessions older than four hours.

© 2026 Piyush Ratan. All Rights Reserved.