Skip to content

aryxnz/Gmail-Copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✉️ Gmail Copilot — AI Email Reply Assistant

An AI-powered Chrome Extension integrated with Spring Boot backend that intelligently generates professional email replies directly inside Gmail.
The project combines Natural Language Generation (via Gemini API), Java Spring Boot REST API, and a custom Gmail-integrated frontend to create a seamless smart email assistant experience.


🚀 Features

  • 🤖 Auto-generates context-aware replies based on incoming emails
  • 🧠 Supports tone customization (Professional, Friendly, Casual)
  • 💬 Integrates directly into Gmail’s compose window
  • ⚙️ Real-time backend connection with Spring Boot REST API
  • 🔒 Runs locally with secure localhost:8080 API calls
  • 🧩 Modern UI with Gmail-themed design for natural blending

⚙️ Technologies Used

Layer Technology
Backend Java Spring Boot
Frontend HTML, CSS, JavaScript
Extension Chrome Manifest V3
API Gemini API (for email text generation)
Tools IntelliJ IDEA, Postman, GitHub
Hosting Localhost (Port 8080)

🧠 How It Works

  1. Extension Injection

    • The Chrome extension detects Gmail’s compose window using a MutationObserver.
    • It automatically adds the “AI Reply” button and tone selector dropdown beside the send button.
  2. Email Content Extraction

    • When the user clicks “AI Reply”, the extension grabs the email thread content using DOM selectors.
  3. Backend Communication

    • The content and tone are sent to the Spring Boot backend via a POST request to
      http://localhost:8080/api/email/generate.
  4. Gemini API Integration

    • The backend processes the text and calls the Gemini API to generate a meaningful, tone-specific reply.
  5. Smart Reply Insertion

    • The generated reply is automatically inserted into Gmail’s compose box, ready to be sent.

🧩 Core Concepts Explained

  • MutationObserver → Detects Gmail’s dynamic compose window.
  • Manifest V3 → Defines permissions and scripts for Chrome extension.
  • Fetch API (POST) → Sends email content and tone to backend.
  • Spring Boot REST Controller → Handles /api/email/generate endpoint.
  • Gemini API → Generates contextual and tone-adjusted replies.

⚡ How to Run Locally

🧩 1. Run Backend

cd backend
mvn spring-boot:run

🌐 2. Load Extension

Open Chrome → chrome://extensions/

Turn on Developer Mode

Click Load Unpacked → Select your /extension folder

Open Gmail and click Compose

You’ll see your AI Reply button appear inside Gmail’s toolbar.

💡 Future Enhancements

🌍 Deploy backend on Render or AWS

🧍 Add user authentication (OAuth2 for Gmail)

📩 Enable email thread understanding for deeper context

💾 Store email histories and reply logs

👨‍💻 Author

Aryan Srivastava B.Tech CSE | Chandigarh University Role: Full Stack Developer & Chrome Extension Architect

📫 Email: software.aryann@gmail.com

About

An AI enabled email writer using spring boot and API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors