This is a simple chatbot application built using HTML, CSS, and JavaScript, with a backend server in Node.js to handle API requests securely.
- Introduction
- Features
- Installation
- Usage
- Folder Structure
- Dependencies
- Environment Variables
- Contributing
- License
This project is a chatbot application that uses the OpenAI GPT-3.5-turbo model to generate responses. The frontend is built with HTML, CSS, and JavaScript, and the backend server is built with Node.js, Express, and Axios to securely manage API requests.
- Chatbot interface with a toggler button.
- Secure backend server to handle API requests.
- User-friendly UI with a gradient background and custom fonts.
- Responsive design for different screen sizes.
To set up this project locally, follow these steps:
git clone https://github.com/your-username/chatbot-application.git
cd chatbot-application
Ensure you have Node.js and npm installed, then run:
npm install
Create a .env file in the root directory and add your OpenAI API key:
API_KEY=your_openai_api_key_here
node server.js
You can use a live server extension in VSCode or any static server to serve the HTML file.
- Click the chatbot toggler button at the bottom right to open the chatbot.
- Type your message in the input area and press Enter or click the send button to send the message.
- The chatbot will respond with a message generated using the OpenAI API.
.
├── images/
│ └── file.png
|__ chatbot.jpg
├── node_modules/
├── .env
├── index.html
├── package.json
├── script.js
├── server.js
├── style.css
└── README.md
- Express
- Axios
- Cors
- Dotenv
To install these dependencies, run:
npm install express axios cors dotenv
This project requires an environment variable for the OpenAI API key. Create a .env file in the root directory with the following content:
API_KEY=your_openai_api_key_here
Contributions are always welcome!
Please fork the repository and create a pull request with your changes. Make sure to follow the coding standards and write clear commit messages.