Skip to content

purvapatil11/ClyraBot

Repository files navigation

ClyraBot

AI-Powered Customer Support Chatbot for Modern Businesses
Configure once • Embed anywhere • Support customers 24/7


📌 Overview

ClyraBot is an AI-powered customer support platform that enables businesses to deploy an intelligent chatbot on their websites within minutes.

Instead of training a custom model, business owners simply provide their company information through an intuitive dashboard. ClyraBot uses Google Gemini AI to answer customer questions while restricting responses to the business-specific knowledge stored in the database.

The chatbot can be embedded into any website using a lightweight JavaScript snippet, making integration simple and developer-friendly.


Features

  • AI-powered customer support using Google Gemini
  • Secure authentication with ScaleKit
  • Business-specific knowledge base
  • Admin Dashboard for chatbot configuration
  • One-line website integration using an embed script
  • MongoDB-based persistent storage
  • Fast Next.js API architecture
  • Responsive UI built with Tailwind CSS
  • Context-aware AI responses to minimize hallucinations
  • Easy deployment and scalable architecture

🛠 Tech Stack

Frontend

  • Next.js (App Router)
  • React
  • TypeScript
  • Tailwind CSS
  • Motion

Backend

  • Next.js API Routes
  • Node.js

Database

  • MongoDB
  • Mongoose

AI

  • Google Gemini API

Authentication

  • ScaleKit

Live Demo

Application: https://clyra-bot.vercel.app/


Getting Started

Using the Live Application

  1. Open the live application.
  2. Sign in using ScaleKit Authentication.
  3. Configure your business details.
  4. Save your chatbot settings.
  5. Copy the generated embed script.
  6. Paste the script into your website.
  7. Your AI chatbot is ready to assist customers.

System Architecture

ClyraBot follows a modern multi-layer client-server architecture. Each layer is responsible for a specific task, making the application secure, scalable, and easy to maintain.

                    ┌──────────────────────┐
                    │    Business Owner    │
                    └──────────┬───────────┘
                               │
                      Login / Dashboard
                               │
                               ▼
                    ┌──────────────────────┐
                    │   Next.js Frontend   │
                    │ (React + Tailwind)   │
                    └──────────┬───────────┘
                               │
                        API Requests
                               │
                               ▼
               ┌────────────────────────────┐
               │      Next.js API Layer     │
               │                            │
               │ Authentication             │
               │ Settings API               │
               │ Chat API                   │
               └───────┬─────────┬──────────┘
                       │         │
                       │         │
                 MongoDB         │
                 Business Data   │
                       │         │
                       ▼         ▼
             ┌─────────────────────────┐
             │ Google Gemini AI        │
             │ Context-Based Response  │
             └──────────┬──────────────┘
                        │
                        ▼
              Embedded Chat Widget
                        │
                        ▼
                  Website Visitor

Architecture Explanation

1. Frontend Layer

The frontend is built using Next.js, React, TypeScript, and Tailwind CSS.

It provides:

  • Authentication interface
  • Business dashboard
  • Chatbot configuration
  • Settings management
  • Embed code generation

The frontend never communicates directly with the database or AI service. All communication passes through secure backend APIs.


2. Authentication Layer

Authentication is handled using ScaleKit.

When a user signs in:

  • Identity is verified securely.
  • A session is created.
  • Dashboard access is restricted to authenticated users.
  • Each chatbot remains linked to its respective business owner.

3. API Layer

Next.js API Routes act as the application's backend.

Responsibilities include:

  • User authentication
  • Saving chatbot settings
  • Retrieving business configuration
  • Processing chat requests
  • Communicating with MongoDB
  • Interacting with Gemini AI

This layer separates the frontend from external services and improves security.


4. Database Layer

MongoDB stores all business-related information.

Each business profile includes:

  • Business Name
  • Business Description
  • Support Email
  • Knowledge Base
  • Owner ID

Whenever a customer asks a question, the backend retrieves the corresponding business data before generating a response.


5. AI Layer

The Chat API sends requests to Google Gemini.

Workflow:

  1. Receive customer message.
  2. Fetch business knowledge from MongoDB.
  3. Construct a contextual AI prompt.
  4. Send prompt to Gemini API.
  5. Receive generated response.
  6. Return response to the website visitor.

Since Gemini receives business-specific information with every request, responses remain relevant and context-aware.


6. Embedded Chat Widget

Businesses integrate ClyraBot using a lightweight JavaScript file.

Once embedded:

  • Chat interface loads automatically.
  • Messages are sent to the backend.
  • AI-generated responses are displayed in real time.
  • No backend setup is required on the client website.

Application Workflow

Business Owner
      │
      ▼
Login
      │
      ▼
Configure Business Information
      │
      ▼
Store Data in MongoDB
      │
      ▼
Generate Embed Script
      │
      ▼
Embed on Website
      │
      ▼
Customer Opens Chat
      │
      ▼
Message Sent to API
      │
      ▼
Business Context Retrieved
      │
      ▼
Gemini Generates Response
      │
      ▼
Customer Receives Answer

📂 Project Structure

src
│
├── app
│   ├── api
│   ├── dashboard
│   ├── embed
│   └── page.tsx
│
├── components
│
├── lib
│
├── models
│
└── middleware
│
public
│
└── chatbot.js

Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a new branch.
  3. Commit your changes.
  4. Push your branch.
  5. Open a Pull Request.

⭐ Support

If you found this project useful, please consider giving it a Star ⭐ on GitHub.

About

Meet Clyrabot!!! Deploy an intelligent AI chatbot in minutes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors