A simple and interactive chatbot, powered by a Node.js backend to securely handle API requests to the OpenRouter AI service.
- Toggleable Chat Window: Show or hide the chatbot interface with a click.
- AI Responses: Send messages and receive replies instantly via the OpenRouter API.
- Secure API Handling: Uses a Node.js and Express server to protect the API Key, ensuring it is never exposed on the client-side.
- Markdown Support: The chatbot can respond with styled text, lists, and even code blocks.
- Frontend: HTML, CSS, JavaScript
- Backend: Node.js, Express.js
- API: OpenRouter.ai (using the DeepSeek: R1 (free) Model)
- Libraries:
dotenv
For managing environment variables.marked.js
To render markdown in chat responses
├── public/
│ ├── index.html
│ └── script.js
├── server.js # Main server
├── .env # Environment variables
├── package.json
└── README.md
You need to have Node.js and npm
installed on your system.
-
Clone the Repository
git clone https://github.com/AdityaLF/ChatBot.git cd ChatBot
-
Install NPM Packages
npm install
-
Set Up Environment Variables
- Open the template file,
.env.example
- Fill it out by replacing
API_KEY_HERE
with your actual API KEY. - Save your changes, then rename the file from
.env.example
to.env
- Open the template file,
-
Run the Server Start the backend server.
node server.js
-
Open in Browser Navigate to
http://localhost:3000
in your web browser to see the application live.
- GitHub: @AdityaLF
- Discord: @05.07am
- Support Me: ko-fi.com/adityaf
This project is licensed under the MIT License.