A smart Gmail assistant that scans your inbox, identifies subscriptions, and helps you bulk unsubscribe or delete emails with a single click.
๐ข Live at: https://mailsweep.xyz
MailSweep is a full-stack productivity app that gives users control over a cluttered inbox by detecting subscriptions and enabling instant clean-up.
- Gmail inboxes are often flooded with unwanted marketing emails and subscriptions
- Unsubscribing manually is slow and inconsistent across different senders
- Gmail doesn't provide a good interface to bulk unsubscribe by sender
-
Sender Clustering: Groups emails by sender to simplify decisions
-
Smart Scan Engine: Detects and tracks subscriptions automatically
-
Bulk Delete API: Instantly removes all emails from selected senders
-
Safe Unsubscribe: Marks sender as unsubscribed without triggering links
-
Session Persistence: Resumes scans where you left off
"From: Amazon Deals" โ 340 emails found โ Bulk Delete or Unsubscribe
"From: Newsletter Weekly" โ Unsubscribe link detectedBatch 1: 100 threads
Batch 2: 100 threads
...- Fetches Gmail threads in batches to avoid rate limits
{
"lastScanTimestamp": "1750614941"
}- Stored as Unix timestamp for simplicity, easy comparison, and timezone consistency (always UTC)
- React.js - Component-based UI with state hooks
- Bootstrap - Responsive layout with prebuilt components
- Axios โ Handles Gmail API calls and backend communication
- Express.js - Lightweight, fast server framework
- Passport.js - Secure Google OAuth2 authentication
- Gmail API โ Email reading, deletion, and metadata fetching
- Supabase โ PostgreSQL storage with RESTful access
public/ # Static assets like images
src/
โโโ components/ # React components (buttons, cards, modals, etc.)
โโโ css/ # Stylesheets and custom CSS files
โโโ App.jsx # Main React app component with routing
โโโ Home.jsx # Homepage UI and inbox summary
โโโ Login.jsx # Login page with Google OAuth
โโโ main.jsx # React entry point and render logic
โโโ PrivacyPolicy.jsx # Privacy policy page component
โโโ TermsOfService.jsx # Terms of service page component
config/ # Configuration files (e.g., DB, OAuth)
routes/
โโโ auth.js # Authentication routes and logic
โโโ gmail.js # Gmail API integration and inbox scanning
โโโ mailcounter.js # Counting emails per sender and tracking stats
โโโ picture.js # Handling sender favicon or image fetching
โโโ subscriptions.js # Managing subscription detection and unsubscribes
utils/
โโโ index.js # Utility functions used throughout backend
Click โLogin with Googleโ
โ
Authorize read/delete access to Gmail
โ
Redirect to main page with Cookie
Fetches email threads using Gmail API
โ
Extracts sender metadata and unsubscribe links
โ
Updates visual dashboard in real time
Click โUnsubscribeโ โ updates DB to ignore future emails
โ
Click โDelete Allโ โ uses Gmail batchDelete API
โ
Optionally rescan inbox anytime to fetch new emails since last full scan.GET /auth/google
// Redirect to Google login
GET /gmail
// Triggers Gmail inbox scan
PATCH /unsub
// Mark sender as unsubscribed in DB
DELETE /delete
// Bulk delete threads by senderrouter.patch('/unsub', async (req, res) => {
const email_id = req.body.email_id;
await db.query(`UPDATE subscriptions SET is_unsubscribed = $1 WHERE id = $2`,
[true, email_id]
);
res.status(200).json("Successfully updated is_unsubscribed")
});- Pagination & Lazy Loading โ Improve performance by loading emails in chunks with page navigation instead of rendering all at once (low priority for now)
- Show users total megabytes of inbox space saved
- Number of emails deleted
- Number of subscriptions cancelled
- Show when the sender first started emailing (e.g., โFirst seen in 2024โ)
- Display the date of the most recent email from that sender
- Add category tags (e.g., Social Media, Food, Education, etc.)
- Show how many times the user has starred this senderโs emails