Technique details
Inspiration and Concept
The main inspiration for this site comes from a fusion of ideas from MacRumors Buyers Guide, The Mac Index, and Apple Price Compare. The development of this website was completed before my patience wore thin, primarily because I borrowed and integrated their concepts.
Addressing Common Issues
After observing these sites, I identified a significant problem: they all required manual maintenance. Many similar sites maintain updates for a period but eventually become abandoned.
Key Objectives
When deciding to emulate and merge these ideas, I established two crucial goals to make this a meaningful website:
- Host and run it in a zero-cost manner, as there would be minimal tangible returns.
- Enable quick content updates without manual copying and pasting from Apple’s website.
- Implement correct operational procedures, where as a maintainer, I would only intervene after Apple product launches.
Zero-Cost Hosting
Achieving zero-cost hosting was straightforward. I’ve been using Cloudflare Workers for years, which provides all necessary resources for hobby projects at a low cost, both in the past and foreseeable future.
Data Collection and Storage
I learned that The Mac Index uses a database to store product information and prices, suggesting manual data collection. Apple Price Compare also offers clear data with an SKU selector, but its last update was a year ago. Such repetitive work clearly drains enthusiasm and quickly becomes meaningless.
Automated Data Scraping
Before any UI design or development, I created a CLI script to scrape prices for specific or all Apple products, storing results in local JSON files. Using a monorepo supported by pnpm, I can access and use this data during the Astro project build.
Currency Conversion Challenge
A major challenge was currency conversion. The Mac Index reportedly uses a commercial exchange rate API, while Apple Price Compare uses a fixed conversion table (which somewhat invalidates the data). Given recent significant currency fluctuations, I needed a method to update exchange rates daily without incurring costs.
Solution: Daily Builds and Data Fetching
Fortunately, I finally found exchange-api repo, this repo provides exchange rate data to everyone for free in a way that is very consistent with the iPrice Pro design philosophy. Astro can fetch online data during build time. By rebuilding the site daily, combined with Cloudflare Pages’ deploy hook and GitHub Actions, this process can be automated.
Minimal Maintenance
With core functionality implemented without any backend services, my only task is to update new product information after Apple events and run the data scraping CLI locally. This requires intervention only about twice a year.
Buyers Guide Implementation
Regarding the MacRumors Buyers Guide, I maintain a static list of product release dates and a set of functions in the project. Astro calls these functions at build time, using static data. Daily builds update the days since release and buying advice.
Buying Advice Algorithm
The buying advice algorithm likely divides the average release days into 6 parts, comparing it with the time since the last release at 1/3, 2/3, 5/6, and 6/6 intervals to determine buying recommendations. However, I won’t manually intervene or modify these recommendations.
Open Source and Future Applications
This website is partially open-source, develope this is mainly for validate my ideas. I’ve only removed parts of the Astro project to prevent proliferation of iPricePro clones. With defined constraints and processes, this model could potentially be applied to other products like Google Pixel or Meta Quest.