This backend project allows you to:
- ✅ Create users
- ✅ Subscribe users to different plans (
basic
,pro
,premium
) - ✅ Store and manage user subscriptions in MongoDB
- ✅ Update the user's plan automatically when subscribed
- ✅ Send email reports (optional)
- Node.js
- Express.js
- MongoDB + Mongoose
- dotenv for environment variables
- nodemailer (if you're sending emails)
- Postman (for testing the APIs)
git clone https://github.com/faizan-devs/Automate-Email-Report-Subscription-System.git
cd AUTOMATE-EMAIL-REPORT
npm install
MONGO_URI=your_mongodb_connection_uri
EMAIL_USER=your_email@gmail.com # Only if using email
EMAIL_PASS=your_email_app_password # Only if using email
npm run dev
node src/scripts/dailyReport.js
POST: /api/users
{
"name": "Faizan",
"email": "faizan@example.com"
}
POST: /api/subscriptions
{
"userId": "user_object_id_here",
"plan": "pro"
}
Add GET /users/:id to fetch a user and their plan
Add GET /subscriptions to list all
Add subscription history and expiration tracking
Add cron job to email reports automatically
Pull requests are welcome! Feel free to open issues or suggestions.
This project is open-source and free to use.
Let me know if you'd like:
- This README in Hindi or dual language
- Email report instructions added
- Or a frontend integration guide