This project consists of an admin portal and a chatbot widget. The admin portal allows users to upload their information and generate a chatbot widget, which can be integrated into any existing ReactJS project. The chatbot widget can be used to interact with users and respond to their queries based on the uploaded information. Access frontend code here
- User authentication (signup and login)
- File upload (PDF, DOCX)
- Chatbot widget generation
- Chatbot interaction with text and audio responses
- JavaScript
- Node.JS
- Express.JS
- ChatGPT-4-Turbo
- Archiver
-
Download the
chatbot-widget.zip
file generated from the admin portal. -
Extract the contents of the
chatbot-widget.zip
file. It should containChatBotWidget.js
,ChatBot.js
,widget-code.html
, andREADME.md
. -
Copy
ChatBotWidget.js
andChatBot.js
to a suitable location in your React project (e.g.,src/components
). -
Add the following HTML to your
public/index.html
or any HTML file that is rendered as part of your React application:<div id="chatbot-button" style="position:fixed; bottom:20px; right:20px; cursor:pointer; background-color:#5a00ff; color:white; padding:10px; border-radius:50%; z-index:1000;"> Chat </div> <div id="chatbot-container" style="position:fixed; bottom:70px; right:20px; z-index:1000;"></div> <script src="%PUBLIC_URL%/components/ChatBotWidget.js"></script> <script> document.getElementById("chatbot-button").onclick = function() { if (!document.getElementById("chatbot-widget")) { renderChatBotWidget('chatbot-container'); } } </script>
-
Make sure to replace
%PUBLIC_URL%
with the correct path to where you placed theChatBotWidget.js
file. -
If you are uploading info and generating widget from https://happy-flower-0c7eb4a00.5.azurestaticapps.net/ to use in your website project for dev purposes, contact me for more info on CORS enablement.
-
Clone the repository:
git clone https://github.com/amalina-hashim/chatbot_BE.git
-
Install dependencies:
npm install
-
Start the backend server:
npm start
-
Start the frontend development server:
npm run start:frontend
-
Access the admin portal at
https://localhost:3000
.