A modern, feature-rich chatbot powered by Google's Gemini AI with a beautiful, responsive interface and advanced chat management capabilities.
- π€ AI-Powered Conversations: Integrated with Google Gemini AI for intelligent responses
- π¬ Real-time Streaming: Messages appear character by character for natural conversation flow
- π± Fully Responsive: Optimized for desktop, tablet, and mobile devices
- π¨ Modern UI/UX: Clean, professional interface with smooth animations
- π Dark/Light Theme: Toggle between dark and light modes with persistent preferences
- π Multi-Chat Sessions: Create, manage, and switch between multiple chat conversations
- π Message Management: Copy individual messages with one click
- β° Message Timestamps: Track when each message was sent
- ποΈ Chat History: Persistent chat storage with session management
- ποΈ Smart Cleanup: Clear individual chats or all chat history
- π Session Persistence: Your conversations are saved locally and restored on return
- π± Mobile Optimized: Touch-friendly interface with mobile-specific optimizations
- β‘ Fast Performance: Optimized loading and responsive interactions
- π― Intuitive Navigation: Easy-to-use sidebar and dropdown menus
- Node.js (v16 or higher)
- Google Gemini AI API key
- Vercel CLI (for deployment)
-
Clone the repository
git clone <your-repo-url> cd chatbot
-
Install dependencies
npm install @google/generative-ai
-
Set up environment variables Create a
.envfile in the root directory:GEMINI_API_KEY=your_google_gemini_api_key_here
-
Run locally
vercel dev --listen 3001
-
Open in browser Navigate to
http://localhost:3001
chatbot/
βββ api/
β βββ chat.js # Serverless API endpoint for AI chat
βββ public/
β βββ index.html # Main HTML structure
β βββ styles.css # Complete styling and themes
β βββ script.js # Frontend JavaScript logic
βββ .env # Environment variables (not in repo)
βββ vercel.json # Vercel deployment configuration
βββ README.md # This file
The chatbot uses Google's Gemini AI API. Configure your API key in the .env file:
GEMINI_API_KEY=your_actual_api_key_here- Modify CSS variables in
styles.cssto customize colors - Themes are automatically saved in localStorage
- Adjust AI parameters in
api/chat.js - Modify system prompts and response handling
- Enable/disable features by modifying the JavaScript in
script.js - Customize UI elements in
index.html
- New Chat (β): Start a fresh conversation
- Chat History (β): View and manage all chat sessions
- Theme Toggle (π/βοΈ): Switch between dark and light modes
- Menu (β―): Access additional options
- Multi-Session Support: Each chat gets a unique ID and title
- Session Switching: Click any chat in history to load it
- Auto-Naming: Chats are automatically titled based on first message
- Deletion Options: Remove individual chats or clear all history
- Responsive Design: Optimized layout for small screens
- Touch-Friendly: Larger buttons and improved touch targets
- Mobile Sidebar: Slide-out chat history with overlay
- Visible Controls: Delete buttons always visible on mobile
- Vanilla JavaScript: No frameworks, pure performance
- CSS3: Modern styling with variables and animations
- HTML5: Semantic, accessible markup
- Local Storage: Client-side data persistence
- Vercel Serverless: Functions for API handling
- Google Gemini AI: Advanced language model integration
- Streaming Responses: Real-time message delivery
- Lazy Loading: Efficient resource management
- Debounced Inputs: Optimized user interaction handling
- Cached Responses: Smart caching for better performance
- Minified Assets: Optimized file sizes
-
Install Vercel CLI
npm install -g vercel
-
Deploy
vercel --prod
-
Set Environment Variables In your Vercel dashboard, add your
GEMINI_API_KEY
- Netlify: Compatible with serverless functions
- Railway: Full-stack deployment option
- Heroku: Traditional hosting with custom setup
- Local Storage: All chat data is stored locally in your browser
- No Data Collection: No personal information is sent to external servers
- API Security: Environment variables protect your API keys
- Secure Communications: HTTPS encryption for all API calls
Contributions are welcome! Please feel free to submit pull requests or open issues for:
- Bug fixes
- Feature enhancements
- UI/UX improvements
- Documentation updates
- Performance optimizations
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for providing the powerful language model
- Vercel for excellent serverless deployment platform
- Contributors who helped improve this project
If you encounter any issues or have questions:
- Check the Issues page for existing solutions
- Create a new issue with detailed information
- Review the documentation above
- β Multi-chat session management
- β Real-time streaming responses
- β Dark/light theme toggle
- β Message timestamps and copying
- β Responsive mobile design
- β Chat history with persistent storage
Made with β€οΈ by Arhum | Powered by Google Gemini AI