About this project

This project is a customized inventory monitoring and restock reminder system for TimeCigar, suitable for personal and small-scale use. The system monitors specific product stock statuses (e.g., cigar tubes, single cigars) and notifies subscribers via QQ email when a product transitions from out-of-stock to in-stock. The architecture adopts a decoupled front-end and back-end design with a serverless approach: the front-end is a public status page hosted on GitHub Pages, displaying real-time inventory data and a subscription form with an invitation code; the back-end utilizes Cloudflare Worker with D1 database for private storage of subscriber emails and unsubscribe tokens, ensuring privacy and security. The monitoring and notification logic is driven by GitHub Actions' scheduled tasks, checking inventory every 5 minutes and sending emails via QQ SMTP. Sensitive information (e.g., SMTP auth codes, invitation codes) is stored in GitHub Secrets or Cloudflare Worker Secrets, preventing exposure in the code repository or front-end page. The deployment process involves obtaining a QQ email SMTP auth code, setting up a Cloudflare D1 database and deploying the Worker, configuring GitHub Actions Secrets, and running the deployment workflow. The system features an invitation code subscription mechanism to prevent abuse and ensure subscriber email addresses remain private. Note that due to GitHub Actions' free plan limitations, the monitoring frequency is at least 5 minutes, which may not support real-time purchasing responses. Restock emails serve as notifications, and actual inventory should be verified on the official website.