A modern and responsive AI chatbot integration for customer support. Built with Node.js and powered by OpenRouter's AI models, this chatbot provides seamless product assistance and sustainability-focused customer service.
- Modern and responsive chat interface with sleek animations
- Floating chat orb with pulsing animation
- Powered by Claude 3.5 Sonnet through OpenRouter
- Focus on sustainability and environmental responsibility
- Customizable styling with CSS variables
- Streaming responses for real-time interaction
- Error handling and recovery
- CORS configuration for security
- Node.js (v14 or higher)
- An OpenRouter API key
- A domain for deployment (optional)
- Clone the repository:
git clone https://github.com/gambadio/Luca-Chat
- Install dependencies:
npm install- Create a
.envfile in the root directory with the following variables:
OPENROUTER_API_KEY=your_api_key_here
PORT=8080
NODE_ENV=development
ALLOWED_DOMAINS=http://localhost:8080- Start the development server:
npm run devThe server will start at http://localhost:8080
- Visit OpenRouter
- Create an account or sign in
- Navigate to the API section
- Generate a new API key
- Add the API key to your
.envfile
- Set up your hosting environment (e.g., Vercel, Heroku, etc.)
- Add the following environment variables:
OPENROUTER_API_KEYNODE_ENV=productionALLOWED_DOMAINS(comma-separated list of allowed domains)
- Deploy the project
Add the chatbot to your website by including the following code:
<script>
(function(w,d,s,o,f,js,fjs){
w['MyChat']=o;w[o]=w[o]||function(){
(w[o].q=w[o].q||[]).push(arguments)};
js=d.createElement(s),fjs=d.getElementsByTagName(s)[0];
js.id='chatbot-script';
js.src='https://your-deployment-url/chat.js';
js.async=1;
fjs.parentNode.insertBefore(js,fjs);
}(window,document,'script','ChatBot'));
</script>
<link rel="stylesheet" href="https://your-deployment-url/styles.css">You can customize the chat appearance by overriding the CSS variables in your website's stylesheet:
:root {
--primary-color: #00FF00;
--secondary-color: #006600;
--text-color: #ffffff;
--bg-color: rgba(0, 0, 0, 0.95);
--shadow: 0 2px 20px rgba(0, 255, 0, 0.2);
--font-family: 'Space Grotesk', sans-serif;
}- CORS configuration for domain protection
- Environment variable protection
- Error handling and recovery
- Rate limiting support (configurable)
This project is available under a dual license:
Free to use and modify for personal, non-commercial purposes.
For company or commercial use, please contact me.
All rights reserved.
Contributions are welcome! Please feel free to submit a Pull Request.
If you find a bug, please create an issue in the GitHub repository with:
- A clear description of the bug
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots (if applicable)