- Modern Chat Interface - Sleek, professional design with smooth animations
- Color Theme - Matches PocketGuard's coral/peach theme (#E66D57)
- Message Bubbles - Distinct styles for user and AI responses
- Typing Indicator - Shows when AI is thinking
- Welcome Message - Greets users with helpful suggestions
- Quick Actions - Pre-configured questions for easy start
- Smooth Scrolling - Auto-scrolls to latest messages
- Loading States - Visual feedback during API calls
- AI-Powered Responses - Uses Google Gemini API for intelligent answers
- Context-Aware - Accesses your financial data for personalized advice
- Chat History - Maintains conversation across sessions
- Reset Function - Clear chat and start fresh anytime
- Error Handling - Graceful fallbacks for network issues
- Mobile Responsive - Works perfectly on all screen sizes
1. Visit: https://makersuite.google.com/app/apikey
2. Sign in with Google
3. Click "Get API Key"
4. Copy your key
# Copy the example file
cp .env.example .env
# Edit .env and add your key
GEMINI_API_KEY=your_api_key_here# Install dependencies (if not done)
npm install
# Start development server
npm run dev
# Open browser to http://localhost:3000
# Login: demo@pocketguard.test / demo123
# Click "Buddy" in navigationβ
public/css/buddy.css - Complete chatbot styling
β
.env.example - Environment configuration template
β
CHATBOT_SETUP.md - Detailed setup guide
β
QUICKSTART.md - This file
β
views/buddy.ejs - Enhanced UI with new elements
β
public/js/buddy.js - Improved client-side logic
β
README.md - Added chatbot documentation link
β
src/routes/api.js - Already configured (no changes needed)
β
src/utils/gemini_sdk.js - Already configured (no changes needed)
β
server.js - Already configured (no changes needed)
- Title with icon
- Status Badge (AI Active / Demo Mode)
- New Chat Button to reset conversation
- Shows financial health score
- Provides quick feedback
- Header Bar with AI avatar and typing indicator
- Message Log with scrollable chat history
- Input Field with placeholder text
- Send Button with icon
- Pre-configured questions
- Click to instantly send
- Hover effects and animations
Primary: rgb(230, 109, 87) /* Coral */
Secondary: rgb(255, 224, 191) /* Peach */
Background: #F8F8F8 /* Light gray */
Cards: #FFFFFF /* White */
Border: #E0E0E0 /* Light border */
Text: #333333 /* Dark gray */- Full width chat interface (max 900px)
- 3-column quick start cards
- Spacious padding
- Optimized for touch
- Single column layout
- Larger touch targets
- Bottom navigation aware
# In .env file
GEMINI_MODEL=gemini-2.0-flashEdit public/css/buddy.css:
.buddy .bubble.ai {
background: your-color-here;
}Edit views/buddy.ejs:
<div class="card">
<span class="material-icons-round">icon_name</span>
<div>Your question</div>
</div>Edit public/js/buddy.js:
addBubble('Your custom welcome message', true);Fix: Add GEMINI_API_KEY to .env and restart server
Fix: Check internet connection and API key validity
Fix: Try faster model or check API quota
Fix: Clear browser cache and hard reload (Ctrl+Shift+R)
- Response Time: 2-5 seconds typical
- Timeout: 18 seconds maximum
- History: Last 20 messages stored
- Context: Last 8 turns sent to AI
- β API key stored server-side only
- β Rate limiting enabled
- β Authentication required
- β Input validation
- β Session-based history
- Be Specific - Ask detailed questions for better answers
- Use Context - The AI knows your financial data
- Try Quick Starts - Click pre-configured questions
- Reset When Needed - Clear chat for new topics
- Check Status Badge - Ensure AI is active
β
"How much can I save this month?"
β
"What are my top spending categories?"
β
"Should I invest in mutual funds or stocks?"
β
"Help me create a budget for dining out"
β
"What's my safe-to-spend amount?"
β
"Suggest some index funds for long-term investment"
- Full Setup Guide: See
CHATBOT_SETUP.md - Main README: See
README.md - API Documentation: See code comments in
src/routes/api.js
Before going live, verify:
- API key is configured
- Status badge shows "AI Active"
- Welcome message appears
- Can send and receive messages
- Chat history persists
- Reset button works
- Quick start cards are clickable
- Mobile layout looks good
- Typing indicator shows
- Errors are handled gracefully
Ready to chat! π Navigate to /buddy and start exploring your Finance Buddy!