Skip to content

A React-Fast API based platform to track price of a commodity available on Amazon.

Notifications You must be signed in to change notification settings

Sanschinu95/Amazon-Price-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation


⚙️ How It Works

  1. User submits an Amazon product URL on the frontend.
  2. Frontend sends a POST request to the backend /track endpoint.
  3. Backend scrapes the product page using BeautifulSoup to extract the product name and price.
  4. Backend stores/updates the product in the Supabase database.
  5. Frontend displays all tracked products and their latest prices.
  6. User can click a product to see its details.
  7. A background scheduler re-scrapes all tracked products every 6 hours to keep prices up to date.

🚀 Getting Started

1. Clone the repository

git clone https://github.com/YOUR-USERNAME/REPO-NAME.git
cd REPO-NAME

2. Set up Supabase

  • Create a Supabase project.
  • Create two tables: price_tracker1 and price_history (see schema below).
  • Get your Supabase URL and API key.

3. Backend Setup

cd price-tracker
python -m venv venv
# On Windows:
venv\\Scripts\\activate
# On Mac/Linux:
source venv/bin/activate
pip install -r requirements.txt
  • Configure your Supabase credentials in supabase_client.py.

Run the backend server:

uvicorn main:app --reload

4. Frontend Setup

cd ../price-tracker-front
npm install
npm run dev

🕸️ Web Scraping Details

  • The backend uses a custom Python function (in scraper.py) to fetch the HTML of the Amazon product page and parse out the product name and price.
  • This is triggered every time a new product is tracked, and also periodically by the scheduler.

🖥️ Usage Example

  1. Start both backend and frontend servers as described above.
  2. Open the frontend in your browser: http://localhost:5173
  3. Enter an Amazon product URL (e.g. https://www.amazon.in/dp/B09G9FPGTN) and click “Track Price”.
  4. View all tracked products on the dashboard.
  5. Click on a product to see its details and latest price.
  6. The backend will automatically re-scrape prices every 6 hours.

🗄️ Database Schema

price_tracker1

Column Type Description
id uuid Primary key
product_name text Name of the product
price numeric Latest price
url text Amazon product URL
last_updated timestamp Last price update time

price_history

Column Type Description
id uuid Primary key
product_id uuid Foreign key to tracker
price numeric Price at this time
timestamp timestamp When price was checked

📝 License

MIT


🙏 Acknowledgements


Feel free to fork, star, and contribute!

About

A React-Fast API based platform to track price of a commodity available on Amazon.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published