Skip to content

"AI Reply by Roch" is an open source solution that helps you respond to emails faster and with more confidence. With just one click inside Gmail, this extension analyzes your email and generates AI-powered reply suggestions tailored to the tone you choose (friendly, professional, concise, etc.).

Notifications You must be signed in to change notification settings

rapetoh/EmailReplyGenerator

Repository files navigation

πŸ€– AI Email Reply Generator

Design sans titre (11)

Chrome Extension Spring Boot AI Powered License

Intelligent Gmail integration that generates contextual email replies using AI

πŸš€ Quick-Start β€’ πŸ“– Features β€’ πŸ› οΈ Tech Stack β€’ πŸ“Έ Demo β€’ πŸ”§ Installation


🎯 Overview

Transform your Gmail experience with AI-powered email replies. This project combines a Chrome Extension with a Spring Boot backend to provide intelligent, context-aware email responses directly within Gmail's interface.

✨ What Makes This Special

  • 🎨 Seamless Gmail Integration - Appears naturally in Gmail's compose interface
  • 🧠 AI-Powered Intelligence - Uses Google's Gemini API for contextual responses
  • πŸŽ›οΈ Customizable Tones - Professional, Friendly, Formal, Casual, or Polite
  • πŸ“± Smart UI Design - Draggable, expandable button with intuitive controls
  • πŸ”„ Fallback System - Works even when backend is unavailable
  • ⚑ Real-time Processing - Instant AI generation with loading states

πŸš€ Quick Start

Prerequisites

  • Chrome Browser (or Chromium-based)
  • Java 17+ and Maven
  • Google Gemini API Key

1️⃣ Clone & Setup Backend

git clone https://github.com/yourusername/Email_Reply_Generator.git
cd Email_Reply_Generator/Email_Reply_Generator

# Set environment variables
export GEMINI_URL="your_gemini_api_url"
export GEMINI_KEY="your_gemini_api_key"

# Start the backend
./mvnw spring-boot:run

2️⃣ Install Chrome Extension

  1. Open Chrome β†’ chrome://extensions/
  2. Enable Developer mode
  3. Click Load unpacked β†’ Select Email_Reply_Generator_Ext/ folder
  4. Extension is now active! πŸŽ‰

3️⃣ Test It Out

  1. Open Gmail in Chrome
  2. Click Reply on any email
  3. Look for the purple "AI Reply by Roch" button
  4. Select your preferred tone and click to generate!

πŸ“– Features

🎨 Intelligent UI Design

  • Drag Handle - Dedicated area for repositioning (no accidental clicks)
  • Expand/Collapse - Minimize to icon-only mode to save space
  • Tone Selector - 5 different response styles
  • Visual Feedback - Loading spinners, success/error states

🧠 AI-Powered Responses

  • Context Awareness - Analyzes original email content
  • Tone Customization - Professional, Friendly, Formal, Casual, Polite
  • Signature Preservation - Keeps your email signature intact
  • Smart Formatting - Proper line breaks and email structure

πŸ”§ Developer-Friendly

  • RESTful API - Clean Spring Boot backend
  • CORS Configured - Ready for production deployment
  • Error Handling - Graceful fallbacks and user feedback
  • Modular Architecture - Easy to extend and customize

πŸ› οΈ Tech Stack

Frontend (Chrome Extension)

  • JavaScript ES6+ - Modern async/await patterns
  • DOM Manipulation - Gmail interface integration
  • MutationObserver - Dynamic UI detection
  • CSS3 - Responsive design with animations

Backend (Spring Boot)

  • Spring Boot 3.x - RESTful API framework
  • Maven - Dependency management
  • Google Gemini API - AI text generation
  • CORS Support - Cross-origin request handling

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    HTTP POST    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    API Call    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Gmail Web     β”‚ ──────────────► β”‚  Spring Boot     β”‚ ──────────────► β”‚   Gemini    β”‚
β”‚   (Extension)   β”‚                 β”‚   Backend        β”‚                 β”‚     AI      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Έ Demo

Gmail Integration

Gmail Integration

Tone Selection

Tone Selection

Drag & Drop Interface

Drag Interface


πŸ”§ Installation

Option 1: Local Development

# Backend
git clone https://github.com/yourusername/Email_Reply_Generator.git
cd Email_Reply_Generator/Email_Reply_Generator
./mvnw spring-boot:run

# Extension
# Load Email_Reply_Generator_Ext/ in Chrome extensions

Option 2: Docker (Coming Soon)

docker-compose up -d

**Option 3: Chrome Web Store **

  • Professional distribution
  • Automatic updates
  • Enterprise deployment

πŸ“ Project Structure

Email_Reply_Generator/
β”œβ”€β”€ πŸ“ Email_Reply_Generator/          # Spring Boot Backend
β”‚   β”œβ”€β”€ πŸ“ src/main/java/             # Java source code
β”‚   β”œβ”€β”€ πŸ“ src/main/resources/        # Configuration files
β”‚   β”œβ”€β”€ πŸ“„ pom.xml                    # Maven dependencies
β”‚   └── πŸ“„ Dockerfile                 # Container configuration
β”œβ”€β”€ πŸ“ Email_Reply_Generator_Ext/      # Chrome Extension
β”‚   β”œβ”€β”€ πŸ“„ manifest.json              # Extension configuration
β”‚   β”œβ”€β”€ πŸ“„ content.js                 # Main extension logic
β”‚   β”œβ”€β”€ πŸ“„ content.css                # Styling
β”‚   β”œβ”€β”€ πŸ“„ Aireply.png                # Extension icon
β”‚   └── πŸ“„ README.md                  # Extension documentation
β”œβ”€β”€ πŸ“ Email_Reply_Generator_React/    # React Frontend (Unused)
β”‚   β”œβ”€β”€ πŸ“ src/                       # React source code
β”‚   β”œβ”€β”€ πŸ“ public/                    # Static assets
β”‚   β”œβ”€β”€ πŸ“„ package.json               # Node.js dependencies
β”‚   β”œβ”€β”€ πŸ“„ vite.config.js             # Vite configuration
β”‚   └── πŸ“„ README.md                  # React app documentation
β”œβ”€β”€ πŸ“„ .gitignore                     # Git ignore rules
β”œβ”€β”€ πŸ“„ mvnw                           # Maven wrapper (Unix)
β”œβ”€β”€ πŸ“„ mvnw.cmd                       # Maven wrapper (Windows)
β”œβ”€β”€ πŸ“„ pom.xml                        # Root Maven configuration
└── πŸ“„ README.md                      # This file

πŸš€ API Documentation

Generate Email Reply

POST /api/email/generate
Content-Type: application/json

{
  "emailContent": "Original email content here...",
  "tone": "professional"
}

Response:

{
  "reply": "Generated AI reply with proper formatting..."
}

Tone Options:

  • professional - Business-appropriate language
  • friendly - Warm and approachable
  • formal - Traditional business correspondence
  • casual - Relaxed and conversational
  • polite - Courteous and respectful

πŸ§ͺ Testing

Backend Testing

# Unit tests
./mvnw test

# Integration tests
./mvnw verify

# API testing with Postman
# Import the provided Postman collection

Extension Testing

  1. Load extension in Chrome
  2. Open Gmail
  3. Test reply generation
  4. Verify tone selection
  5. Test drag & drop functionality

πŸ”’ Security & Privacy

  • No Data Storage - Emails are processed in real-time only
  • Local Processing - Your data stays on your machine
  • API Key Security - Environment variable configuration
  • CORS Protection - Configured for specific origins

πŸ›£οΈ Roadmap

Phase 1: Core Features βœ…

  • Gmail integration
  • AI reply generation
  • Tone selection
  • Drag & drop interface

Phase 2: Enhancement 🚧

  • Custom prompt templates
  • Reply history and favorites
  • Multi-language support
  • Advanced tone customization

Phase 3: Distribution πŸ“‹

  • Chrome Web Store publication
  • Enterprise deployment options
  • Mobile app integration
  • API rate limiting and monitoring

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# Fork the repository
git clone https://github.com/yourusername/Email_Reply_Generator.git

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and test
./mvnw test

# Commit and push
git commit -m "Add amazing feature"
git push origin feature/amazing-feature

# Open Pull Request

πŸ“„ License

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


πŸ™ Acknowledgments

  • Google Gemini - AI text generation
  • Spring Boot - Backend framework
  • Chrome Extensions API - Browser integration
  • Gmail - Email platform integration

⭐ Star this repository if you found it helpful!

πŸ” Back to Top

About

"AI Reply by Roch" is an open source solution that helps you respond to emails faster and with more confidence. With just one click inside Gmail, this extension analyzes your email and generates AI-powered reply suggestions tailored to the tone you choose (friendly, professional, concise, etc.).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published