https://github.com/201harsh/ai-cb
EmoAI ChatBot (MERN + EndGaming AI)
https://github.com/201harsh/ai-cb
ai ai-chatbot
Last synced: 3 months ago
JSON representation
EmoAI ChatBot (MERN + EndGaming AI)
- Host: GitHub
- URL: https://github.com/201harsh/ai-cb
- Owner: 201Harsh
- Created: 2025-04-26T05:43:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-07T16:57:22.000Z (about 1 year ago)
- Last Synced: 2025-06-10T16:42:59.710Z (about 1 year ago)
- Topics: ai, ai-chatbot
- Language: JavaScript
- Homepage: https://emoaichatbot.onrender.com/
- Size: 120 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# ๐ค EmoAI ChatBot (MERN + EndGaming AI) [](https://choosealicense.com/licenses/mit/)
An AI-powered chatbot web application built using the MERN stack (MongoDB, Express.js, React.js, Node.js) integrated with the Endgaming AI API. Users can register, log in, and interact with an intelligent chatbot. The app also includes a credit-based system to limit API usage.
---

An AI-powered chatbot web application with emotional intelligence, built using the MERN stack. Features user authentication, credit-based API access, and dynamic response adaptation based on user sentiment.
[](https://react.dev/)
[](https://nodejs.org/)
[](https://www.mongodb.com/)
---
## ๐๏ธ Table of Contents
- [Key Features](#-key-features)
- [Tech Stack](#-tech-stack)
- [System Architecture](#-system-architecture)
- [Installation](#-installation)
- [Configuration](#-configuration)
- [API Integration](#-api-integration)
- [Credit System](#-credit-system)
- [Security](#-security)
- [Screenshots](#-screenshots)
- [Roadmap](#-roadmap)
- [Contributing](#-contributing)
- [License](#-license)
- [Support](#-support)
---
## ๐ Key Features
| Feature | Description |
| ------------------------- | ----------------------------------------------------------- |
| ๐ง **AI-Powered Chat** | Integration with EndGaming AI for intelligent conversations |
| ๐ **JWT Authentication** | Secure user authentication with token refresh |
| ๐ณ **Credit System** | Usage-based credit management (1 credit/request) |
| ๐ญ **Emotion Adaptation** | Dynamic responses based on detected user mood |
| ๐ **User Analytics** | Track usage patterns and credit consumption |
| โก **Real-Time UI** | Interactive chat interface with React |
### Emotion Response Matrix
| User Emotion | Response Style | Example Response |
| ------------ | ------------------------ | ------------------------------------- |
| ๐ Angry | Calm + Solution-Oriented | "Let's work through this together..." |
| ๐ Sad | Empathetic + Encouraging | "I'm here to listen..." |
| ๐ Happy | Enthusiastic + Playful | "That's fantastic! ๐..." |
## ๐ Emotional Response System
Mood Adaptation Matrix
User Emotion AI Response Pattern Sample Response
- ๐ Angry Calm + Solution-Oriented "Let's work through this..."
- ๐ Sad Empathetic + Encouraging "I'm here for you..."
- ๐ Happy Enthusiastic + Playful "That's awesome! ๐..."
## Visual
```mermaid
graph TB
A[๐ง AI-Powered Chat] --> A1[`Integration with EndGaming AI`]
B[๐ JWT Authentication] --> B1[`Secure login with token refresh`]
C[๐ณ Credit System] --> C1[`1 credit per request`]
D[๐ญ Emotion Adaptation] --> D1[`Dynamic mood-based replies`]
E[๐ User Analytics] --> E1[`Track usage & credits`]
F[โก Real-Time UI] --> F1[`React-based live chat`]
subgraph Emotion_Response_Matrix
EM1[๐ Angry] --> ER1[`Calm + Solution-Oriented: Let's work through this...`]
EM2[๐ Sad] --> ER2[`Empathetic + Encouraging: I'm here to listen...`]
EM3[๐ Happy] --> ER3[`Enthusiastic + Playful: That's fantastic! ๐...`]
end
D --> Emotion_Response_Matrix
```
---
## ๐ Tech Stack
**Frontend**



**Backend**



**Security**


---
# ๐ง Core Architecture
## ๐๏ธ System Architecture
```mermaid
flowchart TD
A[Client] -->|HTTPS| B[API Gateway]
B --> C[Auth Service]
B --> D[Chat Service]
B --> E[Credit Service]
C --> F[(MongoDB Users)]
D --> G[AI Provider]
E --> H[(MongoDB Credits)]
```
---
# ๐ Getting Started
## ๐ซ Installation
**Prerequisites**
- Node.js v18+
- MongoDB v6+
- EndGaming API Key
### 1. Clone the Repository
```bash
git clone https://github.com/201Harsh/AI-CB.git
cd ai-cb
```
### 2. Setup Backend
```bash
cd Backend
npm install
```
### 3. Setup Frontend
```bash
cd Frontend
npm install
npm run dev
```
---
# โจ Usage
- Register a new user
- Login to your account
- Each user gets initial free credits (configurable)
- Ask a question to the chatbot
- Response is generated via AI API
- Each query consumes credits
---
# โจ API Usage:
## EndGaming AI API (or you can use other AI API)
### ๐ง Configuration
### ๐ก API Integration
```javascript
// Example API call to EndGaming AI
app.post("/api/chat", async (req, res) => {
const { prompt, emotion } = req.body;
const response = await axios.post("https://api.endgaming.ai/v4/chat", {
prompt,
emotion,
apiKey: process.env.ENDG_API_KEY,
});
res.json(response.data);
});
```
---
# ๐ฆ API Integration
#### Using Google Gemini or a similar Google AI API:
- Backend makes POST requests to the API with the userโs prompt
- Response is returned to the frontend
- Credit is deducted per request
---
# ๐ณ Credit System
- New users receive 10 free credits
- Credit deduction workflow:
```mermaid
sequenceDiagram
User->>+Backend: Send Message
Backend->>Database: Check Credits
alt Credits > 0
Database->>Backend: Credit Available
Backend->>AI API: Forward Request
AI API->>Backend: Return Response
Backend->>Database: Deduct Credit
Backend->>User: Send Response
else Credits = 0
Database->>Backend: No Credits
Backend->>User: Error Response
end
```
---
# ๐งฎ Credit System (Example)
- Each user starts with 10 credits
- 1 credit = 1 chatbot question
- Credit deduction logic is handled in the backend
- Prevents queries when credits are 0
---
# ๐ TODOs
- Add UI feedback for no credits
- Add option to purchase or earn more credits
- Improve chatbot UI with typing effect
- Save chat history per user
---
# ๐ก๏ธ Security
- Passwords are hashed using bcrypt
- JWT tokens are used for authentication and route protection
- Rate-limiting (optional for production)
---
# ๐ธ Screenshots
- Screenshots Available (This is only an illustration of the application)
### Starting Page โจ

---
### Register Page ๐๏ธ
.png)
---
### Login Page ๐๏ธ
.png)
---
### Feature Page ๐
.png)
---
### Profile Page ๐งโ๐ซ
.png)
---
### Pricing Page ๐ธ
.png)
---
### Chatting Page ๐ฌ๐ฃ๏ธ
.png)
---
# ๐บ Roadmap
- ๐ธ Credit Purchase System
- ๐ Chat History Storage
- ๐ User Analytics Dashboard
- ๐ค Voice Input Support
- ๐ Multi-language Support
# ๐ License
[](https://choosealicense.com/licenses/mit/)
```text
MIT License
Copyright (c) 2025 Harsh (@201Harsh)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the โSoftwareโ), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED โAS ISโ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
---
## ๐ฌ Acknowledgments
- MongoDB (Database)
- Express (Backend)
- React (Frontend)
- Node.js (Server)
- END Gaming AI API (AI Used for Emotional Analysis)
- Google Gemini AI API (AI Used for Intelligence and General Knowledge)
---
# ๐ค Contributing
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
---
# Live Preview
- see the site live at
*https://emoaichatbot.onrender.com/*
---
## ๐ฎ Contact & Support
- Lead Developer: Harsh (@201Harsh)
- GitHub : [201Harsh](https://github.com/201Harsh) | Instagram : [201harshs](https://www.instagram.com/201harshs/)
- Support Portal: support@endgamingai2@gmail.com
---
## Made With โค๏ธ by Harsh