Automated price tracking system with Telegram bot integration, email alerts, and trending products showcase.
- ๐ค Telegram Bot Integration - Automatically scrapes product URLs shared in Telegram groups...
- ๐ Price Tracking - Monitors price changes for Amazon products
- ๐ง Email Alerts - Notifies users when prices drop
- โญ Trending Section - Promotes featured products from verified users
- ๐ Wishlist - Save favorite products for quick access
- ๐ Authentication - Secure user authentication with Clerk.js
- โก Next.js 14 with App Router
- ๐๏ธ MongoDB for all data storage (users, products, wishlist)
- ๐ BrightData web scraping with proxy support
- ๐ฎ Nodemailer email notifications
- ๐ Automated cron jobs for price updates
- ๐จ Tailwind CSS for styling
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: MongoDB (via Mongoose)
- Authentication: Clerk.js
- Web Scraping: Cheerio + Axios with BrightData proxies
- Bot: Telegram Bot API
- Email: Nodemailer
Users
- Stores user information and roles
- Supports authentication
Products
- Product details with price history
- Tracking subscribers
- Promotion status for trending section
Wishlist
- Links users to their favorite products
- Node.js 18+ installed
- MongoDB database (local or Atlas)
- Telegram Bot Token
- BrightData account (for web scraping)
- Email account for notifications
- Clone the repository
git clone <repository-url>
cd Deals-1- Install dependencies
npm install- Configure environment variables
Create a .env file:
# MongoDB
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/database
# Telegram Bot
BOT_TOKEN=your_telegram_bot_token
# Web Scraper (BrightData)
BRIGHT_DATA_USERNAME=your_username
BRIGHT_DATA_PASSWORD=your_password
# Email
EMAIL_PASSWORD=your_email_app_password
# Authentication (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_key
CLERK_SECRET_KEY=your_clerk_secret- Verify migration (optional)
npx ts-node verify-migration.ts- Run development server
npm run dev- Run Telegram bot (separate terminal)
npm run start-bot-
Track a Product
- Share Amazon product URL in Telegram group
- Or manually add via web interface
-
Set Price Alerts
- Click "Track" on any product
- Enter email to receive alerts
- Get notified when price drops
-
Browse Trending
- View promoted products from verified sellers
- Add to wishlist
- Quick access to deals
- Add Promoted Product
POST /api/trending- View Your Products
GET /api/trending?email=your@email.comTelegram Bot โ Detects URL โ Scrapes Product โ Saves to MongoDB
โ
Updates Price History
โ
Checks Price Drop
โ
Sends Email Alerts
A cron job runs periodically to:
- Fetch all tracked products
- Re-scrape current prices
- Update price history
- Send alerts if prices dropped
// Triggered via /api/cron
GET /api/cron // Scheduled via external serviceโโโ app/
โ โโโ (auth)/ # Auth pages (sign-in, sign-up)
โ โโโ (route)/ # Protected routes
โ โโโ api/ # API endpoints
โ โโโ products/ # Product detail pages
โโโ components/ # React components
โโโ lib/
โ โโโ models/ # MongoDB models
โ โโโ actions/ # Server actions
โ โโโ scraper/ # Web scraping logic
โ โโโ nodemailer/ # Email templates
โโโ scripts/
โ โโโ bot.ts # Telegram bot
โโโ types/ # TypeScript types
POST /api/trending- Add promoted productGET /api/trending- Get trending productsGET /api/trending?email=x- Get user's promoted products
POST /api/wishlist- Add to wishlistGET /api/wishlist?userId=email- Get user wishlistDELETE /api/wishlist?useremail=x&productId=y- Remove from wishlist
POST /api/user- Create/get userGET /api/user?email=x- Get user by email
GET /api/cron- Update all product prices
- Migration Summary - Database migration details
- MongoDB Migration - Migration guide
- DB Helpers - Utility functions
- Scraper only supports Amazon currently
- Email sender is hardcoded (needs env variable)
- Rate limiting not implemented
- Migrate to NextAuth (replace Clerk)
- Support multiple e-commerce sites
- User dashboard with analytics
- Price prediction ML model
- Browser extension
- Mobile app with push notifications
- Admin panel for promoters
- Email queue system
- Add Redis caching
- Implement rate limiting
- Better error handling
- Comprehensive test coverage
- Performance optimization
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Vanshaj
- GitHub: @vanshaj2023
- BrightData for web scraping infrastructure
- MongoDB for database solution
- Clerk for authentication
- Next.js team for the amazing framework
Made with โค๏ธ for deal hunters and smart shoppers!