On New Year's Eve and other significant days, the official website for the National Lottery often experiences freezing issues due to high traffic following the lottery draws. Faced with a similar issue on New Year's Eve 2023, I developed a Node.js application using Puppeteer to scrape the draw results from the official website and save them into a MongoDB database.
Subsequently, I used Next.js to fetch draw information from the MongoDB database and generate static pages for the results using the ISR (Incremental Static Regeneration) method. This allowed users to instantly view the results without consuming server resources when querying the lottery outcomes.
Since the data collection process was triggered manually, I eventually discontinued it. However, in the future, I plan to set up a Node.js - Puppeteer application on Proxmox to automate the data collection process.