Skip to content

AdityaLF/ChatBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatbot with Node.js & OpenRouter API

A simple and interactive chatbot, powered by a Node.js backend to securely handle API requests to the OpenRouter AI service.


✨ Features

  • 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.

🚀 Tech Stack

  • 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

📁 Folder Structure

├── public/        
│   ├── index.html
│   └── script.js
├── server.js           # Main server
├── .env                # Environment variables
├── package.json
└── README.md

Prerequisites

You need to have Node.js and npm installed on your system.

Installation

  1. Clone the Repository

    git clone https://github.com/AdityaLF/ChatBot.git
    cd ChatBot
  2. Install NPM Packages

    npm install
  3. 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
  4. Run the Server Start the backend server.

    node server.js
  5. Open in Browser Navigate to http://localhost:3000 in your web browser to see the application live.


👤 Author


📄 License

This project is licensed under the MIT License.

About

A chatbot powered by the OpenRouter free API with a toggleable chat window.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published