Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Target Monitor Bot

👶 BEGINNER? If you have zero technical knowledge and want a step-by-step guide on how to install everything (Python, Node.js, Tampermonkey) and run this bot, please read the Easy Setup Guide!

License: MIT Node.js Python Docker

Target Monitor Bot is an automated, headless Node.js bot powered by Puppeteer and FastAPI. It is specifically designed to continuously monitor product pages on Target.com, tracking stock availability and price changes, and instantly notifying you via Discord webhooks.

🚀 Features

  • Real-Time Stock Monitoring: Continuously checks Target product pages for in-stock status and price updates.
  • Interactive Dashboard (FastAPI): A clean web interface to dynamically add or remove products, and adjust bot configurations on the fly without restarting the bot.
  • Security & Authentication: Dashboard protected by HTTP Basic Auth. API protected by secure X-API-Key.
  • Checkout Controls: Includes DRY_RUN=true safety default, manual confirmation modes, and a global Emergency Stop.
  • Discord Integrations: Delivers rich Discord notifications containing product details, images, and direct checkout links whenever a status changes. Includes a reliable queue with deduplication and retries.
  • Advanced Proxy Support: Dynamically loads authenticated proxies from the Dashboard and instantly rotates browser sessions.
  • Anti-Bot Mitigation: Utilizes puppeteer-extra-plugin-stealth and CDP interception to avoid detection.
  • Automated Testing: Fully integrated test suite to guarantee functionality across API and Bot.
  • Docker Support: Fully containerized environment using docker-compose for rapid deployment.

🏗️ Architecture

The application is split into two primary components:

  1. The Dashboard (Backend API): Built with Python and FastAPI, this provides a REST API and web interface to manage your monitored products and bot settings. It uses a PostgreSQL database in Docker or SQLite locally.
  2. The Bot (Worker): Built with Node.js and Puppeteer, this worker regularly fetches product data based on the configurations set in the dashboard.

🐳 Quick Start: Docker Setup (Recommended)

  1. Set up your environment file: Copy .env.example to .env. Ensure TARGET_API_KEY is set to a secure string.

  2. Start the containers: �ash docker-compose up -d --build

  3. Access the Dashboard: Open your web browser and go to http://localhost:8000. Login using the default credentials configured in .env.


💻 Manual Setup: Local Environment

1. Start the Dashboard (Backend)

�ash cd dashboard pip install -r requirements.txt python -m uvicorn main:app --reload

2. Start the Bot (Worker)

Open a second terminal window: �ash npm install npm start


⚙️ Configuration & Environment Variables

Create a .env file in the root directory based on .env.example. Common options include:

  • API_HOST: The host for the backend API.
  • TARGET_API_KEY: Secure key for Bot <-> API communication.
  • DATABASE_URL: Connection string. Defaults to PostgreSQL in Docker.
  • DASHBOARD_USER / DASHBOARD_PASS: Credentials for dashboard access.

Note: Discord webhooks, proxy strings, and checkout configurations are managed securely through the Dashboard UI and stored directly in the database.


💬 Adding Discord Notifications & Proxies

All settings can be easily configured through the Dashboard (http://localhost:8000/settings). Paste your Discord Webhook URL and Proxy connection string into the designated fields and hit Save. The bot will instantly pick up the new configuration without requiring a restart!


🛡️ Automated Tests

To ensure code stability, a full suite of automated logic and backend integration tests are included. To run them: �ash python -m pytest tests/


⚠️ Disclaimer

This bot is for educational and personal use only. Automated scraping of retail websites may violate their Terms of Service. Use responsibly and ensure you adhere to Target's obots.txt and terms of use.

About

Target Monitor Bot is an automated, headless Node.js bot powered by Puppeteer and FastAPI. It is specifically designed to continuously monitor product pages on Target.com, tracking stock availability and price changes, and instantly notifying you via Discord webhooks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages