Skip to content

ShuangyiHu/MailMind

Repository files navigation

MailMind - AI Email Assistant

Transform your Gmail experience with cutting-edge AI powered by Chrome's built-in AI APIs

🎯 What Can This Tool Do?

MailMind is an intelligent Chrome extension that supercharges your Gmail workflow with AI-powered automation:

  • 📊 Smart Email Analytics: Get comprehensive insights into your email patterns, response times, and productivity metrics
  • 🤖 Intelligent Email Processing: Automatically categorize, prioritize, and suggest actions for incoming emails
  • ✨ AI-Powered Composition: Generate professional emails, replies, and summaries with Chrome's local AI
  • 📅 Seamless Calendar Integration: Convert emails to calendar events with one click
  • ⚡ Bulk Operations: Smart starring, archiving, and organizing based on AI analysis
  • 🎨 Beautiful Interface: Clean, accessible design that integrates seamlessly with Gmail

🌟 Key Highlights

🔒 Privacy-First AI

  • Local Processing: Uses Chrome's built-in AI - your data never leaves your device
  • No External Dependencies: Works offline without sending data to third-party AI services
  • Secure Authentication: OAuth2 integration with Google for trusted access

Lightning Fast

  • Instant AI Responses: Local processing eliminates network latency
  • Smart Caching: Intelligent data management for faster load times
  • Optimized Performance: Minimal resource usage with maximum functionality

🎨 Seamless Integration

  • Native Gmail Experience: Floating action button and compose window integration
  • Cross-Platform Sync: Works across all your devices
  • Accessibility First: WCAG compliant design for all users

🚀 How to Use It

Quick Setup (5 minutes)

# 1. Clone and install dependencies
git clone <repository-url>
cd MailMind
cd server && npm install
cd ../client && npm install

# 2. Configure Google OAuth
cp server/.env.example server/.env
# Add your Google OAuth credentials to server/.env

# 3. Start the application
cd server && npm run dev          # Start API server
cd ../client && npm run build:extension  # Build extension

# 4. Load in Chrome
# Go to chrome://extensions/ → Enable Developer mode → Load unpacked → Select client/build/

Using MailMind

  1. Open Gmail - Look for the MailMind floating button (📧) in the bottom right
  2. Click the FAB - Opens the AI dashboard with email insights and analytics
  3. Compose Emails - Click "Compose" to open Gmail's compose window with AI assistance
  4. Generate Content - Describe what you want to write, and AI creates professional emails
  5. Manage Tasks - View AI-generated todo items from your emails with priority sorting

Chrome AI Setup (Chrome 127+)

  1. Go to chrome://flags/
  2. Enable these flags:
    • #optimization-guide-on-device-model
    • #prompt-api-for-gemini-nano
    • #writer-api-for-gemini-nano
  3. Restart Chrome and wait for AI model download

🏗️ Code Structure

MailMind/
├── 📁 client/                    # Frontend & Chrome Extension
│   ├── src/
│   │   ├── components/           # React UI components
│   │   │   ├── AIEmailGenerator.tsx    # AI email composition
│   │   │   ├── EmailDigest.tsx          # Email analytics dashboard
│   │   │   ├── OverviewDashboard.tsx    # Main dashboard
│   │   │   └── ui/                      # Reusable UI components
│   │   ├── services/             # API and AI services
│   │   │   ├── chromeWriterService.ts   # Chrome AI integration
│   │   │   ├── email/                   # Gmail API services
│   │   │   └── calendar/                # Google Calendar integration
│   │   ├── types/                # TypeScript definitions
│   │   │   └── chrome-ai.d.ts           # Chrome AI type definitions
│   │   ├── content.js            # Chrome extension content script
│   │   └── background.js         # Chrome extension background script
│   └── public/
│       └── manifest.json         # Chrome extension manifest
│
├── 📁 server/                    # Backend API
│   ├── routes/                   # Express.js API routes
│   │   ├── aiRoutes.js          # AI processing endpoints
│   │   ├── authRoutes.js        # Google OAuth authentication
│   │   ├── mailRoutes.js        # Gmail API integration
│   │   └── calendarRoutes.js    # Calendar API integration
│   ├── utils/                   # Utility functions
│   │   ├── googleAuth.js        # Google OAuth configuration
│   │   └── emailHelpers.js      # Email processing utilities
│   └── tests/                   # API tests and examples
│
└── 📄 Documentation
    ├── README.md                # This file
    ├── DEVELOPER_GUIDE.md       # Complete development guide
    └── TROUBLESHOOTING.md       # Debugging and solutions

🛠️ Technologies Used

Frontend & Extension

  • React 18 - Modern UI framework with hooks and context
  • TypeScript - Type-safe JavaScript for better development experience
  • Tailwind CSS - Utility-first CSS framework for rapid styling
  • Vite - Fast build tool and development server
  • Chrome Extensions API - Manifest V3 for modern extension development

AI & Machine Learning

  • Chrome Prompt API - Local language model for email analysis and generation
  • Chrome Writer API - On-device writing assistance with tone control
  • Gemini API - Fallback AI service for broader compatibility

Backend & APIs

  • Node.js - JavaScript runtime for server-side development
  • Express.js - Web framework for RESTful API development
  • Google APIs - Gmail API, Calendar API, OAuth2 authentication
  • Session Management - Secure user session handling

Development & Build Tools

  • npm - Package management and script running
  • ESLint - Code linting and style enforcement
  • PostCSS - CSS processing and optimization
  • Chrome DevTools - Extension debugging and development

Authentication & Security

  • OAuth2 - Secure Google account authentication
  • CORS - Cross-origin resource sharing configuration
  • Session Cookies - Secure session management
  • Content Security Policy - XSS protection for extension

📖 Documentation

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details on:

  • Setting up the development environment
  • Code style and standards
  • Submitting pull requests
  • Reporting issues

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🚀 Ready to revolutionize your email workflow? Get started with the DEVELOPER_GUIDE.md!

About

MailMind is an intelligent Chrome extension that supercharges your Gmail workflow with AI-powered automation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors