- User submits an Amazon product URL on the frontend.
- Frontend sends a POST request to the backend
/trackendpoint. - Backend scrapes the product page using BeautifulSoup to extract the product name and price.
- Backend stores/updates the product in the Supabase database.
- Frontend displays all tracked products and their latest prices.
- User can click a product to see its details.
- A background scheduler re-scrapes all tracked products every 6 hours to keep prices up to date.
git clone https://github.com/YOUR-USERNAME/REPO-NAME.git
cd REPO-NAME- Create a Supabase project.
- Create two tables:
price_tracker1andprice_history(see schema below). - Get your Supabase URL and API key.
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.
uvicorn main:app --reload- The backend will be available at http://localhost:8000
cd ../price-tracker-front
npm install
npm run dev- The frontend will be available at http://localhost:5173
- 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.
- Start both backend and frontend servers as described above.
- Open the frontend in your browser: http://localhost:5173
- Enter an Amazon product URL (e.g.
https://www.amazon.in/dp/B09G9FPGTN) and click “Track Price”. - View all tracked products on the dashboard.
- Click on a product to see its details and latest price.
- The backend will automatically re-scrape prices every 6 hours.
| 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 |
| 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 |
MIT
Feel free to fork, star, and contribute!