Price tracking web application that helps you save money on online e-commerce purchases. It allows you to monitor product prices and receive notifications via email when the price drops. It also provides a simple web interface to stay updated with trending deals.
Currently supported E-commerce websites : Amazon, Flipkart, Myntra, Boat.
It is built using Python, HTML, CSS, Flask, Jinja, Telethon and Beautiful Soup. Currently using MongoDB as primary Database and deployed using Microsoft Azure App Service.
Apache Airflow and cronjobs are setup on personal linux machine.
Check it out - https://budgetboss.adhirajpandey.me/
User inputs the desired product link and email. This data along with Product Title and it's Current Price is added in the database.
The background listener.py file runs every hour and compares the current price of the product with the saved price. If the current price is less than the saved price, the bot sends a mail to the user with the required details as shown in the sample below. This listener script is scheduled using cronjob.
To facilitate Deals Functionality, extract_deals.py gets most recent deals messages from telegram channel and saves them in MongoDB collection and fetch_images.py extracts images from saved deals links. Both of these scripts are scheduled using Airflow in form of DAG.
Edit: To bypass 15 mins sleep timeout by Azure, wakewebsite.sh
script is also scheduled using cron to ping webapp at regular intervals.
-
Clone the project on your local system using:
git clone https://github.com/adhirajpandey/Budget-Boss
-
Install the dependencies:
pip install -r requirements.txt
-
Setup environment variables in
.env
file.Notes :
- Add 'MONGO_CLUSTER', 'MONGO_USER', 'MONGO_PASSWORD' after setting up MongoDB Atlas and configure it's db to be accessed from anywhere.
- Add 'SENDER_EMAIL_ID', 'SENDER_EMAIL_PASSWORD' after setting up app password from google 2 factor authentication settings.
- Add 'TG_API_ID', 'TG_API_HASH' after setting up Telegram API.
-
Run the web app using
python app.py
-
Schedule the
listener.py
file using cron or github actions. -
Schedule
extract_deals.py
andfetch_images.py
using cron to populate the deals DB.
-
You would need to authenticate your telethon client using OTP and telgram password by following on-screen instruction after running
extract_deals.py
for first time usage. -
You can use
deals_dag.py
to setup schedule Airflow pipeline for latest deals and its images.
- Functionality for Flipkart
- Functionality for Myntra
- Functionality for Boat
- Notification via Whatsapp
- Best Deals Section