A full-stack MERN Starter Project for creating an open-source email marketing platform β similar to AWeber or Mailchimp β that can:
- π© Send mass emails to large groups efficiently
- π€ Provide AI-powered automated replies
- π Schedule meetings, reply to FAQs, and manage follow-up messages automatically
Frontend: React (Vite or CRA)
Backend: Node.js + Express
Database: MongoDB (Mongoose)
Email Service: Nodemailer / Gmail API / SendGrid (planned)
AI Bot Engine: OpenAI API / Local Model Integration (planned)
Styling: CSS / Tailwind
Routing: React Router v6
Task Scheduling: Node Cron
To create an open-source scalable platform where contributors can collaboratively build:
- Bulk email campaigns
- Contact management system
- Template-based email editor
- AI assistant for automated replies
- Analytics dashboard for sent & opened emails
MailMERN/
β
βββ backend/ # Node.js + Express API backend
β βββ server.js # Main backend entry point
β βββ routes/ # Express routes
β β βββ emailRoutes.js # Routes for sending & managing emails
β β βββ userRoutes.js # Routes for authentication & profiles
β β βββ chatbotRoutes.js # Routes for AI-based auto responses
β βββ controllers/ # Controller logic for routes
β β βββ emailController.js
β β βββ userController.js
β β βββ chatbotController.js
β βββ models/ # MongoDB models
β β βββ User.js
β β βββ Campaign.js
β β βββ Message.js
β βββ utils/ # Helper files
β β βββ sendEmail.js # Nodemailer logic
β β βββ openaiClient.js # AI chatbot integration
β β βββ scheduler.js # Cron job for scheduled emails
β βββ config/ # DB & server config
β β βββ db.js
β β βββ dotenv.config.js
β βββ .env.example # Example environment variables
β
βββ frontend/ # React frontend
β βββ src/
β β βββ pages/ # App pages
β β β βββ Home.jsx
β β β βββ Campaigns.jsx
β β β βββ Chatbot.jsx
β β β βββ Analytics.jsx
β β β βββ About.jsx
β β β βββ Contact.jsx
β β β βββ NotFound.jsx
β β βββ components/ # Reusable components
β β β βββ Navbar.jsx
β β β βββ Footer.jsx
β β β βββ CampaignCard.jsx
β β β βββ ChatbotWidget.jsx
β β β βββ Loader.jsx
β β βββ App.jsx # Routing setup
β β βββ main.jsx # ReactDOM entry point
β β βββ assets/ # Images and icons
β β βββ styles/ # Global styles
β βββ package.json
β βββ vite.config.js
β
βββ .gitignore
βββ package.json # Root file for concurrent scripts
βββ README.md # Project documentation
βββ LICENSE # Open source license
git clone https://github.com/OPCODE-Open-Spring-Fest/MailMERN.git
cd MailMERN2οΈβ£ Backend Setup
cd backend
npm installCreate a .env file based on .env.example:
PORT=5000
MONGO_URI=your_mongodb_uri
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_app_password
OPENAI_API_KEY=your_openai_keyRun the backend:
npm run dev3οΈβ£ Frontend Setup
cd frontend
npm install
npm run devOpen: π http://localhost:5173 (Vite) or π http://localhost:3000 (CRA)
4οΈβ£ Run Both (Optional)
In the root directory, add to package.json:
"scripts": { "start": "concurrently "npm run dev --prefix backend" "npm run dev --prefix frontend"" }
Then simply run:
npm start
The AI Auto Responder chatbot has been successfully implemented! π
- OpenAI Integration: Uses GPT-3.5-turbo for intelligent responses
- Smart Fallback: Predefined responses when OpenAI is unavailable
- Message Categorization: Automatically categorizes queries (greeting, pricing, support, features)
- Sentiment Analysis: Analyzes user message sentiment
- Full Chat Interface: Complete chat page at
/chatbot - Embeddable Widget: Chat widget for any page
- Conversation History: Stores and retrieves chat history
- Analytics: Usage analytics and insights
-
Set up OpenAI API key in your
.envfile:OPENAI_API_KEY=your_openai_api_key_here
-
Access the chatbot:
- Visit
/chatbotfor the full chat interface - Use the chat widget on the home page
- Navigate via the "AI Assistant" link in the navbar
- Visit
-
API Endpoints:
POST /api/chatbot/message- Send messagesGET /api/chatbot/history/:userId- Get chat historyGET /api/chatbot/analytics/:userId- Get analytics
For detailed documentation, see CHATBOT_README.md
| Feature | Description | Status |
|---|---|---|
| π§ Mass Email Sending | Send personalized bulk emails | β Base setup |
| π§ AI Auto Responder | AI chatbot replies to received emails | β COMPLETED |
| π Scheduler | Schedule campaigns for future dates | π§© Planned |
| π Dashboard | Track sent, opened, and clicked emails | π§© Planned |
| π Contact Management | Upload and manage email lists | π§© Planned |
| βοΈ Template Builder | Create and edit HTML email templates | π§© Planned |
π©βπ» Contribution Guide
We β€οΈ contributions from the community!
Step 1: Fork the Repo from github and then clone it in local pc
git clone https://github.com/OPCODE-Open-Spring-Fest/MailMERNStep 2: Create a Branch
git checkout -b feat/your-feature-nameStep 3: Make Changes
Add your updates inside frontend or backend folder.
Step 4: Commit & Push
git add .
git commit -m "feat: added <feature>"
git push origin feat/your-feature-nameStep 5: Create a Pull Request
Go to GitHub β Pull Requests β New PR Describe your changes, link related issues, and submit π
π§ How It Works (Concept)
User uploads contact list (CSV/Excel) β Contacts stored in MongoDB
User creates a campaign β Selects template and message content
System sends emails using Nodemailer / SendGrid β Logs results (sent, failed, bounced)
Incoming replies trigger AI chatbot β Uses OpenAI API to auto-reply, schedule meetings, or answer FAQs
π§ͺ Scripts Command Description
npm run dev (backend) Start Express server npm run dev (frontend) Start React frontend npm start (root) Run both concurrently π§© Future Enhancements
Add JWT authentication
Integrate email tracking via Pixel
Add custom analytics dashboard
Integrate Google Calendar API for scheduling meetings
Support multiple SMTP providers
βοΈ License
This project is open-sourced under the MIT License. Youβre free to use, modify, and distribute β just give credit.
Md Irfan Raj
πͺͺ Code Name: Silver
π§ mdirfanraj88.omega@gmail.com
π Support & Contribution
If you like this project:
β Star this repository
π¬ Share feedback in Issues
π Contribute by raising PRs
Together, letβs build an open-source AI-powered mass email platform!
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!