MailPilot AI is a full-stack Gmail automation dashboard that connects with a user's Gmail account, analyzes emails, generates smart replies, creates Gmail drafts, and stores AI analysis history using MongoDB.
It is designed as an AI-powered productivity tool for managing Gmail workflows through a clean dashboard, smart inbox, reply assistant, analysis history, and system health monitoring.
MailPilot AI helps users manage their Gmail inbox intelligently by combining Gmail API integration, AI-based email analysis, smart reply generation, and persistent history tracking.
The application allows users to:
- Connect Gmail securely using Google OAuth
- Fetch real Gmail emails
- Analyze emails using an AI fallback engine
- Classify emails by priority and category
- Generate smart reply drafts
- Create Gmail drafts directly from the dashboard
- Save and view AI analysis history
- Search, filter, and manage analyzed emails
- Monitor backend, Gmail, AI mode, and MongoDB status
Secure Gmail authentication using Google OAuth 2.0 with token persistence.
Fetches real Gmail emails and displays them in a searchable, filterable dashboard.
Analyzes emails and generates:
- Email summary
- Priority level
- Email category
- Suggested response
Generates editable reply drafts with tone control and allows users to create Gmail drafts directly.
Stores analyzed emails in MongoDB Atlas so users can revisit, search, filter, and delete past analysis records.
Provides overview statistics such as loaded emails, analyzed emails, saved history, high-priority emails, and system status.
Displays backend health, Gmail connection, AI mode, MongoDB history count, tech stack, and project module status.
Includes a modern landing page, dark glass dashboard, animated visual elements, responsive layout, and clean product-style interface.
- React.js
- Vite
- CSS
- Framer Motion
- Lucide React
- Axios
- Node.js
- Express.js
- Gmail API
- Google OAuth 2.0
- MongoDB Atlas
- Mongoose
- Rule-based fallback AI engine
- Email summarization
- Priority detection
- Reply generation
mailpilot-ai/
│
├── backend/
│ ├── config/
│ │ └── db.js
│ ├── models/
│ │ ├── User.js
│ │ └── AnalyzedEmail.js
│ ├── routes/
│ │ ├── authRoutes.js
│ │ ├── gmailRoutes.js
│ │ └── aiRoutes.js
│ ├── services/
│ │ ├── googleAuthService.js
│ │ ├── gmailService.js
│ │ └── aiService.js
│ ├── utils/
│ │ └── emailUtils.js
│ ├── server.js
│ ├── package.json
│ └── .env.example
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ └── Sidebar.jsx
│ │ ├── pages/
│ │ │ ├── LandingPage.jsx
│ │ │ └── Dashboard.jsx
│ │ ├── services/
│ │ │ └── api.js
│ │ ├── App.jsx
│ │ ├── App.css
│ │ └── main.jsx
│ ├── package.json
│ └── vite.config.js
│
├── .gitignore
└── README.mdCreate a .env file inside the backend folder.
Use .env.example as reference:
PORT=5000
FRONTEND_URL=http://localhost:5173
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
GOOGLE_REDIRECT_URI=http://localhost:5000/auth/google/callback
MONGO_URI=your_mongodb_atlas_connection_string_here
AI_MODE=fallbackNever upload your real
.envfile to GitHub.
git clone https://github.com/javcod/mailpilot-ai.git
cd mailpilot-aicd backend
npm installnpm run devBackend runs on:
http://localhost:5000Open a new terminal:
cd frontend
npm installnpm run devFrontend runs on:
http://localhost:5173GET /healthGET /auth/statusGET /api/gmail/emailsPOST /api/ai/analyze-emailsPOST /api/ai/generate-replyPOST /api/gmail/create-draftGET /api/ai/historyDELETE /api/ai/history/:idWhile building MailPilot AI, I worked on:
- Google OAuth authentication
- Gmail API integration
- MongoDB Atlas connection and schema design
- Full-stack API communication
- AI-powered email workflow logic
- Dashboard UI/UX design
- Persistent user session handling
- Secure environment variable management
- Building a practical AI automation product
Add screenshots here after uploading images to the repository.





- Add OpenAI or Gemini integration for advanced LLM-based responses
- Add Gmail label automation
- Add follow-up reminder system
- Add n8n workflow integration
- Add email sentiment detection
- Add deployment on Render/Vercel
- Add user-specific dashboard analytics
- Add role-based authentication
MailPilot AI is currently a working full-stack MVP with:
- Gmail OAuth
- Gmail API integration
- MongoDB persistence
- AI fallback analysis
- Smart reply generation
- Gmail draft creation
- Dashboard analytics
- History management
- Premium UI/UX
Prabhuji Mishra B.Tech CSE Student Focused on AI Agents, Automation Workflows, and Full-Stack AI Projects
GitHub: javcod
If you like this project, consider giving it a star on GitHub.