Skip to content

moksha622/AI-ChatBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– AI ChatBot

An AI-powered chatbot built using React.js, Node.js, Express.js, MongoDB Atlas, and the Groq API. The chatbot supports AI conversations, voice input, document uploads, OCR-based image text extraction, and persistent chat history.


🌐 Live Demo

Frontend (Vercel)

πŸ‘‰ https://ai-chat-bot-beryl-two.vercel.app/

Backend API (Railway)

πŸ‘‰ https://ai-chatbot-production-9b90.up.railway.app


πŸš€ Features

πŸ’¬ AI Chat

  • Real-time AI conversations using Groq API
  • Fast and intelligent responses
  • Context-aware responses
  • Conversation history stored in MongoDB Atlas

🎀 Voice Input

  • Speech-to-text support
  • Microphone-based message input
  • Built using React Speech Recognition

🧠 Chat Memory

  • Stores previous conversations
  • MongoDB Atlas integration
  • Persistent chat history

πŸ“„ Document Processing

Supports:

  • PDF files
  • DOCX files
  • TXT files

Users can upload documents and ask questions about their contents.

πŸ–ΌοΈ OCR Image Text Extraction

Supports:

  • JPG
  • JPEG
  • PNG

The chatbot can extract text from images using OCR and answer questions about the extracted content.

πŸ—‘οΈ Clear Chat

  • Clears current conversation
  • Resets voice transcript
  • Fresh chat experience

πŸ› οΈ Tech Stack

Frontend

  • React.js
  • Vite
  • Axios
  • React Speech Recognition

Backend

  • Node.js
  • Express.js

Database

  • MongoDB Atlas
  • Mongoose

AI

  • Groq API
  • Llama 3.3 70B Versatile

File Processing

  • Multer
  • PDF Parse
  • Mammoth
  • Tesseract OCR

Deployment

  • Vercel (Frontend Hosting)
  • Railway (Backend Hosting)
  • GitHub (Version Control)

πŸ“ Project Structure

AI-ChatBot/
β”‚
β”œβ”€β”€ client/
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ uploads/
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ .gitignore
└── README.md

βš™οΈ Local Installation

1. Clone Repository

git clone https://github.com/moksha622/AI-ChatBot.git

2. Enter Project

cd AI-ChatBot

Frontend Setup

cd client
npm install
npm run dev

Frontend:

http://localhost:5173

Backend Setup

Open a new terminal:

cd server
npm install
npm run dev

Backend:

http://localhost:5000

Environment Variables

Server (.env)

Create a .env file inside the server folder:

PORT=5000

MONGO_URI=your_mongodb_connection_string

GROQ_API_KEY=your_groq_api_key

Client (.env)

Create a .env file inside the client folder:

VITE_API_URL=http://localhost:5000

For production:

VITE_API_URL=https://ai-chatbot-production-9b90.up.railway.app

Database Setup

  1. Create a MongoDB Atlas cluster
  2. Create a database user
  3. Add IP access in Network Access
  4. Copy the MongoDB connection string
  5. Add it to .env

Groq API Setup

  1. Create a Groq account
  2. Generate an API key
  3. Add the key to .env
  4. Restart the backend

Deployment Guide

Frontend Deployment (Vercel)

  1. Push code to GitHub
  2. Import repository into Vercel
  3. Set Root Directory:
client
  1. Add Environment Variable:
VITE_API_URL=https://ai-chatbot-production-9b90.up.railway.app
  1. Deploy

Backend Deployment (Railway)

  1. Import GitHub repository into Railway
  2. Set Root Directory:
server
  1. Add Variables:
MONGO_URI=your_mongodb_connection_string

GROQ_API_KEY=your_groq_api_key

PORT=5000
  1. Deploy

Supported Upload Types

File Type Supported
PDF βœ…
DOCX βœ…
TXT βœ…
JPG βœ…
JPEG βœ…
PNG βœ…

Future Improvements

  • User Authentication
  • Multiple Chat Sessions
  • Dark Mode
  • Export Chat to PDF
  • Drag & Drop Uploads
  • Streaming AI Responses
  • Mobile App Version
  • Multi-language Support
  • Advanced Document Analysis

Author

Moksha Higgoda

GitHub: https://github.com/moksha622

License

This project is licensed under the MIT License.


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

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors