A modern Chrome extension built with React, Vite, and Tailwind CSS for browsing history management and AI-powered chat assistance.
- Modern React UI: Built with React 18 and Vite for fast development and optimized builds
- Tailwind CSS: Beautiful, responsive design with modern styling
- History Management: View and interact with your browsing history across different time ranges
- AI Chat Assistant: Intelligent conversation about your browsing patterns
- Clickable URLs: All URLs open in new tabs when clicked
- Real-time Analysis: Get insights about your browsing habits
- Clean Architecture: Component-based structure with custom hooks
- Frontend: React 18 + Vite
- Styling: Tailwind CSS
- Icons: Lucide React
- Backend: Node.js + Express + Google Generative AI
- Build Tool: Vite with Chrome Extension optimizations
history-extension/
โโโ frontend/ # React frontend
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ Header.jsx
โ โ โ โโโ HistoryTab.jsx
โ โ โ โโโ ChatTab.jsx
โ โ โ โโโ HistoryItem.jsx
โ โ โ โโโ Message.jsx
โ โ โ โโโ Footer.jsx
โ โ โ โโโ LoadingSpinner.jsx
โ โ โโโ hooks/ # Custom React hooks
โ โ โ โโโ useHistory.jsx
โ โ โ โโโ useChat.jsx
โ โ โโโ App.jsx # Main app component
โ โ โโโ main.jsx # React entry point
โ โ โโโ index.css # Global styles
โ โโโ sidebar.html # Extension sidebar HTML
โ โโโ package.json # Frontend dependencies
โ โโโ vite.config.js # Vite configuration
โ โโโ tailwind.config.js # Tailwind configuration
โ โโโ postcss.config.cjs # PostCSS configuration
โโโ server/ # Backend API
โ โโโ index.js # Express server
โ โโโ package.json # Backend dependencies
โโโ dist/ # Built extension files
โโโ background.js # Chrome extension background script
โโโ manifest.json # Chrome extension manifest
โโโ icon.png # Extension icon
- Node.js (v16 or higher)
- npm or yarn package manager
- Google API key for Generative AI (for backend)
# Clone the repository
git clone <repository-url>
cd history-extension# Install frontend dependencies
cd frontend
npm install
# Install backend dependencies
cd ../server
npm installCreate a .env file in the server directory:
GOOGLE_API_KEY=your_google_generative_ai_api_key_hereStart the backend server:
cd server
node index.jsIn another terminal, start the frontend development server:
cd frontend
npm run devThe server will run on http://localhost:5000 and the frontend dev server will run on http://localhost:5173.
cd frontend
npm run buildThis creates optimized files in the dist/ directory.
cd frontend
npm run build- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
dist/directory that was created in step 1
For AI chat functionality to work, start the backend server:
cd server
node index.jsThe server must be running on http://localhost:5000 for the extension to communicate with the AI service.
npm run dev- Start development server with hot reloadnpm run build- Build the extension for productionnpm run preview- Preview the built application
node index.js- Start the Express server- The server runs on port 5000 by default
- App.jsx: Main application with tab management
- Header.jsx: Beautiful gradient header with branding
- HistoryTab.jsx: History viewing and AI summary functionality
- ChatTab.jsx: Interactive chat interface
- HistoryItem.jsx: Individual history item with clickable URLs
- Message.jsx: Chat message with URL parsing and formatting
- LoadingSpinner.jsx: Reusable loading indicator
- useHistory: Manages browsing history state and API calls
- useChat: Handles chat functionality and conversation state
- All URLs are properly parsed and made clickable
- URLs open in new tabs using Chrome extension APIs
- No duplicate URL display issues
- Proper URL formatting with visual indicators
- Smooth animations and transitions
- Responsive design that works in the extension popup
- Loading states and error handling
- Clean, modern aesthetic with gradients and shadows
- Context-aware responses using browsing history
- Conversation history persistence
- Real-time typing indicators
- Auto-resizing text input
The vite.config.js is optimized for Chrome extensions:
- Outputs to
../distdirectory - Configured for ES2015 target compatibility
- Optimized bundle splitting and naming
Custom theme with:
- Primary/secondary color schemes
- Custom animations (fade-in, slide-up)
- Extension-specific responsive breakpoints
- Development:
npm run dev- Hot reloading for development (frontend only) - Production:
npm run build- Optimized build for extension - Preview:
npm run preview- Preview the built application - Server:
node index.js- Start the backend API server
- Bundle Size: ~158KB (gzipped: ~51KB)
- CSS Size: ~12KB (gzipped: ~3KB)
- Load Time: Near-instant popup opening
- Memory Usage: Optimized React tree with minimal re-renders
- TypeScript: Add TypeScript for better type safety
- Testing: Unit and integration tests with React Testing Library
- Themes: Multiple color themes and dark mode
- Export: Export chat conversations and history summaries
- Offline: Offline capability with service workers
- Fork the repository
- Create a feature branch
- Make your changes in the React components
- Test the extension functionality
- Submit a pull request
- Backend Dependency: The extension requires the backend server to be running on
http://localhost:5000for AI chat features - API Key Required: Set up your Google Generative AI API key in the server's
.envfile - URL Security: URLs are handled through Chrome extension APIs for proper security
- React Optimization: Components are optimized for the extension sidebar size
- Bundle Optimization: Tailwind classes are purged for optimal bundle size
- Development: Use
npm run devin frontend for development, and runnode index.jsin server directory