Chocomat - Tristan Chocolatier
- Tristan Chocolatier
- chocomat.chocolatier-tristan.ch
- #coding #design #ci/cd
- 2026
Technologies
- Go
- HTML
- CSS
Details
I developed a web application for the new Tristan Chocolatier vending machine that provides customers with a real-time overview of the machine's inventory. The website displays product images, prices, stock levels, and availability, allowing visitors to see exactly what is available before visiting the machine.
The main script is powered by Go and communicates directly with the vending machine's administration dashboard. To minimize API usage and improve performance, the system implements multiple caching layers, including caching of raw inventory responses, processed inventory data, and previously downloaded product images. This significantly reduces the number of requests sent to the vending machine platform while keeping the displayed information up to date.
The processed inventory data is then injected into an HTML template to generate a fully static website representing the current state of the vending machine. This approach ensures fast page loading times, low hosting costs, and high reliability.
The entire workflow is automated through GitHub Actions, running every 30 minutes during the day and every hour during the night. Each execution generates an updated static website and deploys it to Cloudflare Pages. The combination of caching, optimized scheduling, and static site generation allows the project to operate entirely within the free tiers of both GitHub Actions and Cloudflare Pages.
A significant focus of the project was performance optimization. Since GitHub Actions billing is based on whole-minute increments, I worked to reduce execution times to under one minute, enabling more frequent updates while remaining within free usage limits for extended periods. The Go application itself runs exceptionally fast on an Ubuntu-slim GitHub Actions runner, typically completing in under one second. Interestingly, the main optimization challenge was not the Go code but the deployment process. Cloudflare Wrangler, the tool used to publish the static files to Cloudflare Pages, proved to be the most time-consuming component due to its large Node.js dependency tree. Optimizing the deployment pipeline therefore became the key factor in achieving a highly efficient and cost-effective solution.
Screenshot
CI/CD