Skip to content

Devengoyal885/Mail-IQ

ย 
ย 

Repository files navigation


Mail-IQ 2.0

Mail-IQ 2.0

AI-Powered Email Intelligence Platform

Transform your inbox from passive storage into intelligent productivity infrastructure.


React Vite TypeScript Tailwind CSS Supabase License PRs Welcome


๐Ÿš€ Live Demo ยท ๐Ÿ“– Docs ยท ๐Ÿ› Report Bug ยท โœจ Request Feature




๐ŸŽฏ Overview

Mail-IQ is a production-grade AI Email Intelligence SaaS platform that transforms how you interact with your inbox. Unlike traditional email clients that simply display messages chronologically, Mail-IQ uses advanced AI to:

  • ๐Ÿ” Analyze every email for priority, sentiment, and key data
  • ๐Ÿ“… Extract deadlines, meetings, and action items automatically
  • ๐Ÿค– Generate smart replies, summaries, and labels using LLMs
  • ๐Ÿ“Š Visualize your email patterns with a rich analytics dashboard
  • โœ… Convert emails into actionable tasks on a Kanban board
  • ๐Ÿ”” Alert you proactively before critical deadlines are missed

"Never Miss What Truly Matters" โ€” Mail-IQ acts as your personal AI email chief-of-staff.


โœจ Feature Showcase

๐Ÿ“ฌ Intelligent Inbox

  • Smart 3-panel layout (folder/list/reader)
  • Priority-based email classification
  • Sentiment analysis per email
  • AI deadline extraction with alerts
  • Custom labels with auto-labeling
  • Star, archive, trash with animations

๐Ÿค– AI Intelligence Panel

  • Email Summarization (short/medium/detailed)
  • Smart Reply Generator (professional/friendly/formal)
  • Action Item Extraction with 1-click task creation
  • Language Translation (8+ languages)
  • Confidence scoring for AI predictions
  • Powered by Gemini 1.5 Pro / GPT-4o

๐Ÿ“Š Analytics Dashboard

  • Weekly/monthly email activity charts
  • Category & priority breakdowns
  • Sentiment analysis visualization
  • Productivity score tracking
  • High-priority email spotlight
  • Built with Recharts

โœ… Task Board (Kanban)

  • Auto-extracted tasks from emails
  • 3-column drag-friendly board (Todo / In Progress / Done)
  • Priority tags and deadline badges
  • Email-linked task context
  • One-click status updates

๐Ÿ” Advanced Search

  • Natural language search queries
  • Multi-filter search (sender, priority, attachments, date)
  • Quick search shortcuts
  • AI-enhanced result summaries

๐Ÿ’ฌ AI Chat Assistant

  • Chat with your entire inbox
  • Ask: "Show urgent emails this week"
  • Ask: "Find interview emails from Google"
  • Ask: "What deadlines do I have?"
  • Context-aware, inbox-grounded responses

๐Ÿ“จ Smart Compose

  • AI-assisted email composition
  • Reply with context pre-filled
  • Attachment support
  • Template-based smart starts

โš™๏ธ Settings & Customization

  • Dark / Light / System theme
  • AI model preference (Gemini / GPT-4)
  • Summary length control
  • Font size adjustment
  • Notification preferences

๐Ÿ—๏ธ Architecture

graph TB
    subgraph Frontend["Frontend (React + Vite + TypeScript)"]
        UI[UI Components<br/>Tailwind + Framer Motion]
        Hooks[Custom Hooks<br/>useMailIQ / useAI / useGmail]
        Store[State Management<br/>React State + Context]
    end

    subgraph AI["AI Layer"]
        Gemini[Google Gemini 1.5 Pro]
        GPT[OpenAI GPT-4o]
        ONNX[ONNX Runtime<br/>On-device inference]
    end

    subgraph Backend["Backend (Supabase BaaS)"]
        Auth[Supabase Auth<br/>Google OAuth]
        DB[(PostgreSQL<br/>Neon)]
        RT[Realtime<br/>WebSockets]
        Storage[File Storage]
    end

    subgraph Gmail["Gmail Integration"]
        OAuth[Gmail OAuth 2.0]
        API[Gmail API v1]
    end

    UI --> Hooks
    Hooks --> Store
    Hooks --> AI
    Hooks --> Backend
    Hooks --> Gmail
    Gmail --> OAuth
    Gmail --> API
    AI --> Gemini
    AI --> GPT
    AI --> ONNX
    Backend --> Auth
    Backend --> DB
    Backend --> RT
    Backend --> Storage
Loading

๐Ÿ—„๏ธ Database Schema

erDiagram
    USERS {
        uuid id PK
        string email
        string name
        string avatar_url
        string gmail_token
        string preferred_ai_model
        timestamp created_at
    }

    EMAILS {
        uuid id PK
        uuid user_id FK
        string gmail_message_id
        string subject
        string sender
        string sender_email
        text body
        text preview
        string folder
        boolean read
        boolean starred
        string category
        string priority
        string sentiment
        timestamp email_timestamp
        timestamp created_at
    }

    TASKS {
        uuid id PK
        uuid user_id FK
        uuid email_id FK
        string title
        text description
        string status
        string priority
        date due_date
        timestamp created_at
    }

    LABELS {
        uuid id PK
        uuid user_id FK
        string name
        string color
    }

    NOTIFICATIONS {
        uuid id PK
        uuid user_id FK
        uuid email_id FK
        string title
        text message
        string category
        boolean read
        timestamp created_at
    }

    AI_ACTIVITY {
        uuid id PK
        uuid user_id FK
        uuid email_id FK
        string action_type
        jsonb result
        timestamp created_at
    }

    USERS ||--o{ EMAILS : "has"
    USERS ||--o{ TASKS : "has"
    USERS ||--o{ LABELS : "creates"
    USERS ||--o{ NOTIFICATIONS : "receives"
    EMAILS ||--o{ TASKS : "generates"
    EMAILS ||--o{ AI_ACTIVITY : "triggers"
Loading

๐Ÿ“ Project Structure

Mail-IQ/
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ models/              # ONNX models for on-device inference
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ Sidebar.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ ProtectedRoute.jsx
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ””โ”€โ”€ AuthContext.jsx  # Firebase/Supabase auth context
โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ”‚   โ”œโ”€โ”€ useEmails.js
โ”‚   โ”‚   โ”œโ”€โ”€ useAI.js
โ”‚   โ”‚   โ””โ”€โ”€ useGmail.js
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ supabase.js      # Supabase client
โ”‚   โ”‚   โ””โ”€โ”€ gemini.js        # AI client
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ LoginPage.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ DashboardPage.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ UploadPage.jsx
โ”‚   โ”‚   โ””โ”€โ”€ SavedProjectsPage.jsx
โ”‚   โ”œโ”€โ”€ styles/
โ”‚   โ”‚   โ””โ”€โ”€ index.css
โ”‚   โ”œโ”€โ”€ workers/
โ”‚   โ”‚   โ””โ”€โ”€ emailWorker.js   # Web worker for background processing
โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ””โ”€โ”€ main.jsx
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ vite.config.js
โ””โ”€โ”€ README.md

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or pnpm
  • Supabase account (free tier works)
  • Google Cloud Console project (for Gmail OAuth)
  • Gemini API key (optional, for AI features)

Installation

# 1. Clone the repository
git clone https://github.com/Devengoyal885/Mail-IQ.git
cd Mail-IQ

# 2. Install dependencies
npm install

# 3. Set up environment variables
cp .env.example .env
# Edit .env with your credentials (see Environment Variables section)

# 4. Start development server
npm run dev

Visit http://localhost:5173 ๐ŸŽ‰


๐Ÿ”ง Environment Variables

Create a .env file based on .env.example:

# โ”€โ”€ Supabase โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

# โ”€โ”€ Gmail OAuth โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
VITE_GMAIL_CLIENT_ID=your_google_oauth_client_id.apps.googleusercontent.com
VITE_GMAIL_REDIRECT_URI=http://localhost:5173/auth/callback

# โ”€โ”€ AI APIs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
VITE_GEMINI_API_KEY=your_gemini_api_key
VITE_OPENAI_API_KEY=your_openai_api_key          # Optional

# โ”€โ”€ App Config โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
VITE_APP_URL=http://localhost:5173
VITE_APP_NAME=Mail-IQ

Caution

Never commit your .env file to version control! The .gitignore is configured to exclude it. Always use .env.example as the template.


๐Ÿ“ก API Documentation

Gmail Integration

Mail-IQ uses Gmail API v1 with OAuth 2.0 scopes:

  • gmail.readonly โ€” Read emails
  • gmail.modify โ€” Archive, label, mark read
  • gmail.compose โ€” Send and reply

AI Endpoints

Feature Model Avg Latency
Email Summary Gemini 1.5 Flash ~800ms
Smart Reply Gemini 1.5 Pro ~1.2s
Priority Detection On-device ONNX ~50ms
Deadline Extraction Gemini 1.5 Flash ~600ms
Sentiment Analysis On-device ONNX ~30ms
Translation Gemini 1.5 Pro ~1.5s

Supabase Real-time

// Subscribe to new emails
const channel = supabase
  .channel('emails')
  .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'emails' }, (payload) => {
    // Handle new email
  })
  .subscribe();

๐Ÿšข Deployment

Vercel (Recommended)

npm install -g vercel
vercel --prod

Set environment variables in Vercel Dashboard โ†’ Project Settings โ†’ Environment Variables.

Netlify

npm run build
# Upload dist/ folder to Netlify, or connect GitHub repo

Railway / Render

# Build command
npm run build

# Start command  
npm run preview

Neon PostgreSQL Setup

-- Run in Neon SQL editor
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email TEXT UNIQUE NOT NULL,
  name TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE emails (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES users(id) ON DELETE CASCADE,
  subject TEXT NOT NULL,
  sender TEXT,
  sender_email TEXT,
  body TEXT,
  folder TEXT DEFAULT 'inbox',
  read BOOLEAN DEFAULT FALSE,
  starred BOOLEAN DEFAULT FALSE,
  priority TEXT,
  sentiment TEXT,
  email_timestamp TIMESTAMPTZ,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Enable Row Level Security
ALTER TABLE emails ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can only see their own emails" ON emails
  FOR ALL USING (auth.uid() = user_id);

๐Ÿ”’ Security

Mail-IQ follows security-first architecture:

Layer Implementation
Authentication Supabase Auth + Google OAuth 2.0
Authorization Row Level Security (RLS) on all tables
API Security Rate limiting + input validation
Data Privacy User-isolated data, no cross-user access
Secrets Environment variables only, never in code
XSS Protection React's built-in escaping + CSP headers
SQL Injection Parameterized queries via Supabase client

๐Ÿ—บ๏ธ Roadmap

โœ… Phase 1 โ€” Foundation (Current)

  • Gmail OAuth integration
  • AI email summarization
  • Deadline extraction & alerts
  • Priority detection
  • Task extraction
  • Kanban board
  • Analytics dashboard
  • AI chat assistant
  • Smart compose
  • Dark/light theme

๐Ÿšง Phase 2 โ€” Expansion (Q3 2024)

  • Outlook / Microsoft 365 integration
  • Mobile app (React Native)
  • Voice commands (Web Speech API)
  • PWA with offline support
  • Real-time WebSocket sync
  • Collaborative inbox (team accounts)

๐Ÿ”ฎ Phase 3 โ€” Enterprise (Q4 2024)

  • Team management dashboard
  • Custom AI fine-tuning
  • SSO (SAML 2.0)
  • Admin analytics panel
  • Workflow automation
  • Zapier / Make integration

๐ŸŒŸ Phase 4 โ€” AI Agent (2025)

  • Fully autonomous email agent
  • Auto-response with approval flow
  • Meeting scheduling via email
  • Multi-inbox management
  • Personal AI email assistant

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guide and Code of Conduct.

# Fork the repository, then:
git checkout -b feat/your-amazing-feature
git commit -m 'feat: add amazing feature'
git push origin feat/your-amazing-feature
# Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.


๐Ÿ“ธ Screen Desription

View Description
Inbox Three-panel layout with AI extraction chips
Dashboard Analytics with Recharts visualizations
AI Panel Summary, smart reply, task extraction, translation
Tasks Kanban board from email action items
Search Natural language search with filters
AI Chat Conversational inbox assistant

๐Ÿš€ Project Status & Repository Structure

Production Version (This Repository)

This repository contains the actual MailIQ source code, architecture, backend integrations, AI workflows, and production-ready implementation currently under active development.

MailIQ was designed as a real-world AI-powered email intelligence platform with features such as:

  • AI Email Categorization
  • Smart Priority Detection
  • Deadline & Action Item Extraction
  • Email Summarization
  • Unified Communication Intelligence
  • User Authentication & Personalization
  • Analytics Dashboard
  • Productivity Insights

Why Isn't It Publicly Deployed?

Deploying MailIQ as a fully functional SaaS product requires ongoing infrastructure and operational costs, including:

  • AI Model API Usage
  • Authentication Services
  • Database Hosting
  • Email Processing Infrastructure
  • Cloud Storage
  • Monitoring & Security Services

As a student-built project, maintaining these production services continuously is currently not financially feasible.

Demo Version

To showcase the concept, design, workflow, and user experience of MailIQ, a separate demo prototype has been created.

๐Ÿ”— Live Demo: https://mailiq.netlify.app/

๐Ÿ”— Demo Repository: https://github.com/Devengoyal885/MailIQ-demo

The demo illustrates the intended functionality and user interface but does not include all production integrations and paid infrastructure required for real-world deployment.

Future Roadmap

The goal is to launch MailIQ as a fully hosted platform once sufficient resources, sponsorship, partnerships, or funding become available.

Until then, this repository serves as the primary development repository containing the actual implementation and ongoing research behind the project.


๐Ÿ‘จโ€๐Ÿ’ป Author


Deven Goyal
Full Stack AI Engineer
๐ŸŒ Portfolio ยท ๐Ÿ’ป GitHub ยท ๐Ÿ’ผ LinkedIn

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see LICENSE for details.

MIT License โ€” Copyright (c) 2024 Deven Goyal
Permission is hereby granted, free of charge, to any person obtaining a copy...

Made with โค๏ธ by Deven Goyal

โญ Star this project if it helped you!


Mail-IQ โ€” Never Miss What Truly Matters

About

About MailIQ is an AI-powered email intelligence platform that prioritizes important emails, reduces notification overload, and helps users focus on high-value communication through smart categorization, insights, and productivity-driven workflows.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 58.6%
  • JavaScript 28.4%
  • CSS 12.0%
  • HTML 1.0%