Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ajshul/unsubscribe-dashboard

Repository files navigation

๐Ÿ“ฉ Unsubscribe Dashboard

A full-stack React + Node.js application that helps you view and manage all unsubscribe links from your Gmail inbox.


โšก Features

๐ŸŽฏ Core Features

  • ๐Ÿ” Google OAuth Authentication - Secure login with your Google account
  • ๐Ÿ“ง Enhanced Gmail API Integration - Comprehensive email discovery with advanced search patterns
  • ๐Ÿ“Š Real-time Analytics Dashboard - Live statistics with automatic updates
  • ๐Ÿ” Advanced Search & Filtering - Find specific senders, sort by date/sender, show unsubscribed emails
  • ๐Ÿ“ฑ Mobile Responsive Design - Works perfectly on all device sizes

โšก Power User Features

  • โŒจ๏ธ Command Palette - Quick actions with keyboard shortcuts (โŒ˜K/Ctrl+K)
  • ๐ŸŽ›๏ธ Keyboard Shortcuts - Refresh (โŒ˜R), Toggle Views (โŒ˜โ‡งV), Toggle Theme (โŒ˜โ‡งT)
  • ๐Ÿ‘๏ธ Modal Email Viewer - Full email content with sanitized HTML rendering
  • ๐Ÿ“‹ Sender Group View - Bulk operations grouped by sender for efficient management
  • ๐Ÿ—‚๏ธ Auto-Archive - Automatically archive emails after unsubscribing

๐ŸŽจ Modern UI/UX

  • ๐ŸŒ“ Dark/Light Mode Toggle - Seamless theme switching with system preference detection
  • โœจ Beautiful Animations - Smooth transitions, hover effects, and modern Material Design
  • ๐ŸŽจ Enhanced Styling - Gradient backgrounds, status-based coloring, and professional design
  • โšก Instant Feedback - Real-time updates, loading states, and visual confirmations

๐Ÿ›ก๏ธ Security & Performance

  • ๐Ÿ”’ Security First - Rate limiting, input validation, and secure token handling
  • ๐Ÿš€ Optimized Performance - Efficient API calls, pagination, and state management
  • ๐Ÿ”„ Error Handling - Comprehensive error boundaries and user-friendly error messages

๐Ÿ› ๏ธ Tech Stack

Frontend

Backend


๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ (LTS recommended)
  • pnpm (recommended) or npm
  • Google Cloud Console project with Gmail API enabled

1. Clone and Install

git clone https://github.com/ajshul/unsubscribe-dashboard.git
cd unsubscribe-dashboard
pnpm install

2. Complete Setup Guide

๐Ÿ“– For detailed setup instructions, see SETUP_GUIDE.md

The setup guide includes:

  • โœ… Step-by-step Google Cloud Console configuration
  • โœ… OAuth consent screen setup
  • โœ… JWT secret generation
  • โœ… Environment variable configuration
  • โœ… Troubleshooting common issues

Quick setup:

  1. Google OAuth: Create project โ†’ Enable Gmail API โ†’ Create credentials
  2. Environment: cp .env.example .env and fill in your credentials
  3. JWT Secret: Generate with node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"

4. Start Development

# Start both frontend and backend
pnpm dev:full

# Or start them separately:
pnpm dev:server  # Backend on port 3001
pnpm dev         # Frontend on port 5173

Visit http://localhost:5173 to see the app!


๐Ÿ“ Project Structure

unsubscribe-dashboard/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # React components
โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.tsx    # Main dashboard with global shortcuts
โ”‚   โ”‚   โ”œโ”€โ”€ Login.tsx        # OAuth login page
โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx       # App header with command palette button
โ”‚   โ”‚   โ”œโ”€โ”€ UnsubscribeTable.tsx  # Email table with dual views
โ”‚   โ”‚   โ”œโ”€โ”€ SenderGroupView.tsx   # Bulk operations by sender
โ”‚   โ”‚   โ”œโ”€โ”€ EmailViewerModal.tsx  # Full email content viewer
โ”‚   โ”‚   โ”œโ”€โ”€ CommandPalette.tsx    # Keyboard shortcut command palette
โ”‚   โ”‚   โ””โ”€โ”€ StatsCards.tsx   # Real-time statistics display
โ”‚   โ”œโ”€โ”€ contexts/            # React contexts
โ”‚   โ”‚   โ”œโ”€โ”€ AuthContext.tsx  # Authentication state management
โ”‚   โ”‚   โ””โ”€โ”€ ThemeContext.tsx # Dark/light theme management
โ”‚   โ”œโ”€โ”€ theme/
โ”‚   โ”‚   โ””โ”€โ”€ theme.ts        # Material-UI theme configuration
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ””โ”€โ”€ api.ts          # API client with Gmail integration
โ”‚   โ””โ”€โ”€ App.tsx             # Main app with routing
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.js         # OAuth authentication routes
โ”‚   โ”‚   โ””โ”€โ”€ gmail.js        # Gmail API routes with enhanced search
โ”‚   โ””โ”€โ”€ index.js            # Express server with security middleware
โ”œโ”€โ”€ .env.example            # Environment variables template
โ”œโ”€โ”€ SETUP_GUIDE.md          # Detailed setup instructions
โ””โ”€โ”€ README.md               # Project documentation

๐Ÿ”ง Available Scripts

Command Description
pnpm dev Start frontend development server
pnpm dev:server Start backend development server
pnpm dev:full Start both frontend and backend
pnpm build Build for production
pnpm preview Preview production build
pnpm lint Run ESLint

๐Ÿš€ Deployment

Frontend (Vercel/Netlify)

  1. Build the frontend:

    pnpm build
  2. Deploy the dist folder to your hosting provider

  3. Set environment variables:

    • VITE_GOOGLE_CLIENT_ID
    • VITE_APP_URL (your production domain)
    • VITE_API_URL (your backend API URL)

Backend (Railway/Heroku/DigitalOcean)

  1. Deploy the server code to your hosting provider

  2. Set environment variables:

    • GOOGLE_CLIENT_SECRET
    • JWT_SECRET
    • NODE_ENV=production
    • PORT (usually provided by host)

๐Ÿ”’ Security Considerations

  • Environment Variables: Never commit .env files
  • JWT Secret: Use a strong, random secret in production
  • HTTPS: Always use HTTPS in production
  • Rate Limiting: API calls are rate-limited per user
  • Input Validation: All inputs are validated and sanitized
  • CORS: Properly configured for your domains

๐Ÿ› Troubleshooting

Common Issues

OAuth Error "unauthorized_client"

  • Check that your redirect URIs are correctly configured in Google Cloud Console
  • Ensure the client ID matches exactly

"Failed to fetch emails"

  • Verify your Gmail API is enabled
  • Check that you've granted the correct scopes
  • Make sure your access token hasn't expired

Backend connection issues

  • Ensure both frontend and backend are running
  • Check that the proxy configuration in vite.config.ts is correct

๐Ÿ“ˆ Roadmap

โœ… Recently Completed

  • Command Palette - Quick actions with keyboard shortcuts (โŒ˜K visible button + hotkeys)
  • Bulk Operations - Sender group view with bulk unsubscribe and batch processing
  • Modal Email Viewer - Full email content viewing with sanitized HTML rendering
  • Auto-Archive - Fully functional automatic email archiving after unsubscribe
  • Enhanced Gmail Search - Comprehensive patterns finding significantly more unsubscribe emails
  • Show Unsubscribed Toggle - View archived/processed emails with proper filtering
  • Real-time Statistics - Live count updates that accurately reflect processed emails
  • OAuth Scope Enhancement - Added gmail.modify permissions for archiving functionality
  • Beautiful Modern UI - Gradient backgrounds, smooth animations, and professional styling

๐Ÿšง In Progress

  • Unsubscribe History Tracking - Persistent database storage of actions
  • PWA Support - Installable progressive web app
  • Scheduled Sweeps - Automated cleanup jobs

๐Ÿ”ฎ Future Features

  • Email Categories - AI-powered automatic categorization
  • Smart Suggestions - Machine learning recommendations
  • Export Data - CSV/JSON export of unsubscribe history
  • Multiple Email Accounts - Support for multiple Gmail accounts
  • Heat-Map Calendar - Visual inbox volume analytics
  • Undo/Restore - 7-day recovery for accidental unsubscribes

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ“„ License

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


If this project helped you, please give it a โญ on GitHub!


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors