A modern AI-powered chat application with real-time messaging, voice input, and image analysis capabilities. NOTABOT presents itself as a friendly, human-like conversational partner powered by OpenAI's GPT models.
- Real-time Chat: Instant messaging with WebSocket support
- Voice Input: Speech-to-text functionality for hands-free interaction
- Image Analysis: AI-powered image scanning and description using GPT-4 Vision
- User Authentication: Secure signup/login with JWT tokens
- Dark/Light Theme: Toggle between themes with persistent storage
- Responsive Design: Works seamlessly across desktop and mobile devices
- Message History: Persistent chat history with ability to clear conversations
- Node.js & Express.js - Server framework
- MongoDB with Mongoose - Database and ODM
- Socket.io - Real-time communication
- OpenAI API - AI chat completions and image analysis
- JWT - Authentication
- bcryptjs - Password hashing
- React with TypeScript - UI framework
- Vite - Build tool
- Tailwind CSS - Styling
- Zustand - State management
- React Router - Navigation
- Axios - HTTP client
- Socket.io Client - Real-time communication
- React Markdown - Markdown rendering
- Framer Motion - Animations
- React Hot Toast - Notifications
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas)
git clone https://github.com/Mil9nn/chatbot
cd chatbot
cd backend
npm install
Create a .env
file in the backend
directory with the following variables:
# Server Configuration
PORT=5000
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/notabot
# OR for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:[email protected]/notabot
# JWT Secret
JWT_SECRET=your-super-secret-jwt-key-here
# OpenAI Configuration
OPENAI_API_KEY=your-openai-api-key-here
# Cloudinary Configuration (for image uploads)
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret
npm run dev
The backend server will start on http://localhost:5000
cd frontend
npm install
Create a .env
file in the frontend
directory:
VITE_API_URL=http://localhost:5000/api
npm run dev
The frontend will start on http://localhost:3000
- Visit OpenAI Platform
- Sign up/login to your account
- Navigate to API Keys section
- Create a new secret key
- Copy and paste it into your
.env
file
- Visit Cloudinary
- Sign up for a free account
- Go to your Dashboard
- Copy your Cloud Name, API Key, and API Secret
- Add them to your
.env
file
Option 1: Local MongoDB
- Install MongoDB locally
- Start MongoDB service
- Use connection string:
mongodb://localhost:27017/notabot
Option 2: MongoDB Atlas (Recommended)
- Visit MongoDB Atlas
- Create a free cluster
- Get your connection string
- Replace
<username>
,<password>
, and database name
notabot/
βββ backend/
β βββ src/
β β βββ controllers/
β β β βββ auth.controller.js
β β β βββ message.controller.js
β β βββ models/
β β β βββ user.model.js
β β β βββ message.model.js
β β βββ routes/
β β β βββ auth.route.js
β β β βββ message.route.js
β β βββ middlewares/
β β β βββ auth.middleware.js
β β βββ lib/
β β β βββ db.js
β β β βββ jwt.js
β β β βββ openai.js
β β β βββ cloudinary.js
β β βββ index.js
β βββ package.json
β βββ .env
βββ frontend/
β βββ src/
β β βββ components/
β β βββ pages/
β β βββ store/
β β βββ lib/
β β βββ types/
β βββ public/
β β βββ screenshots/
β β βββ login.png
β β βββ mainlayout.png
β β βββ imageAnalysis.png
β βββ package.json
β βββ .env
βββ README.md
POST /api/auth/signup
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutGET /api/auth/check
- Check authentication statusPUT /api/auth/update-profile
- Update user profile
POST /api/messages/send
- Send a messageGET /api/messages/all/:userId
- Get all messages for a userDELETE /api/messages/delete/:userId
- Delete all messages for a userPOST /api/messages/analyze-image
- Analyze an image with AI
- Sign up/Login: Create an account or login with existing credentials
- Chat: Start conversing with NOTABOT using text or voice input
- Voice Input: Click the microphone icon to use speech-to-text
- Image Analysis: Navigate to "Scan Image" to analyze images with AI
- Theme Toggle: Switch between light and dark themes
Happy Chatting with NOTABOT! π€β¨