A modern, interactive AI chatbot built with Gemini API, featuring personalized chat history, Firebase authentication, and a beautiful UI.
- ✨ Modern UI/UX - Beautiful, responsive design with smooth animations
- 🔐 Firebase Authentication - Secure user authentication and data storage
- 💬 Chat History - Persistent chat history stored in Firebase Firestore
- 🎯 Personalized Responses - AI uses conversation history for context-aware replies
- 📝 Markdown Support - Bot responses support markdown formatting
- ⚡ Typing Indicators - Visual feedback when the AI is thinking
- 🗑️ Clear Chat - Option to clear chat history
- 📱 Responsive Design - Works seamlessly on desktop and mobile
- Frontend: HTML, CSS, JavaScript (ES6 Modules)
- Backend: Node.js, Express
- AI: Google Gemini API
- Database: Firebase Firestore
- Authentication: Firebase Auth
- Deployment: Azure App Service ready
- Node.js (v16 or higher)
- npm or yarn
- Firebase project with Firestore enabled
- Gemini API key (Get it here)
# Install dependencies
npm install- Go to Firebase Console
- Create a new project or use an existing one
- Enable Authentication (Email/Password)
- Enable Firestore Database
- Copy your Firebase config from Project Settings
- Update
public/firebase-config.jswith your Firebase configuration
Create a .env file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
PORT=3000You can copy from .env.example:
cp .env.example .env
# Then edit .env and add your API key# Development mode (with auto-reload)
npm run dev
# Production mode
npm startThe app will be available at http://localhost:3000
Make sure your Firestore security rules allow authenticated users to read/write their own data:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/messages/{messageId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}-
Create Azure App Service:
az webapp create --resource-group <resource-group> --plan <app-service-plan> --name <app-name> --runtime "NODE:18-lts"
-
Set Environment Variables:
az webapp config appsettings set --resource-group <resource-group> --name <app-name> --settings GEMINI_API_KEY="your_api_key"
-
Deploy:
# Using Azure CLI az webapp up --resource-group <resource-group> --name <app-name> # Or use VS Code Azure extension # Or use GitHub Actions / Azure DevOps
- Create a new App Service in Azure Portal
- Go to Configuration → Application Settings
- Add
GEMINI_API_KEYwith your API key value - Deploy your code using:
- GitHub Actions
- Azure DevOps
- VS Code Azure Extension
- FTP/SCM
- Azure automatically sets the
PORTenvironment variable, so your app will use it automatically - Make sure to set
GEMINI_API_KEYin Azure App Service Configuration - The app uses port 3000 by default, but Azure will override this with its own PORT
FlashBott/
├── public/
│ ├── index.html # Main HTML file
│ ├── style.css # Styles
│ ├── script.js # Frontend JavaScript
│ └── firebase-config.js # Firebase configuration
├── server.js # Express server
├── package.json # Dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore file
└── README.md # This file
- Sign Up/Login: Create an account or login with existing credentials
- Start Chatting: Type your message and press Enter or click Send
- View History: Your chat history is automatically loaded when you login
- Clear Chat: Use the "Clear Chat" button to delete all messages
- Logout: Click the logout button in the header
- All conversations are stored in Firebase Firestore
- The AI uses the last 30 messages for context
- Each user has their own isolated chat history
- Bot responses support markdown formatting
- Code blocks, lists, headers, and more are properly rendered
- Uses Marked.js library for rendering
- Shows animated typing indicator when AI is processing
- Provides visual feedback to users
- Make sure you've created a
.envfile withGEMINI_API_KEY - For Azure, ensure the environment variable is set in App Service Configuration
- Verify your Firebase config in
public/firebase-config.js - Check that Authentication and Firestore are enabled
- Verify Firestore security rules
- Change the PORT in
.envfile - Or kill the process using port 3000
MIT License - feel free to use this project for your own purposes.
For issues or questions, please open an issue on the repository.