notes.mackiec

Shopify on an iPod Classic

What's old is new again. Bring back the clickwheel.

download
Pass me the corded phone, 2007 is calling

I put a custom version of Shopify on my 2007 iPod Classic. :had-enough:

This started as an experiment to play with the Shopify AI Toolkit, test the capabilities of Opus 5.5, and install Rockbox on my old iPod at the same time; a kind of 'three birds, one stone' project that I seem to enjoy tormenting myself with.

Note: This is not endorsed or sponsored by Shopify in any way. This was a personal project on my own time, on my own machine.

Obviously, not everything that's available within Shopify is in this little project. The whole Lua-app is only about 450KB. The constraint of not having any internet access was the most fun to solution around. How do you manage calling the Shopify Admin API and updating an isolated device that can't respond?

Even still, I can view analytics, products, orders, customers, even which theme is published. Creating new Products, adding tags and making edits is all supported, as is some light Order management. There's a queued changes system that writes updates locally on the app, which are then actioned to Shopify the next time I plug in the iPod to my Mac. Everything is handled by .txt files in the background, which get converted by a script into a data.lua file the app can actually read.

download
Sorry Test Johnson, you're cancelled
  • A macOS Launch agent watches for the iPod's disk to mount.
  • Once it's recognised, a script fires, and any queued changes on the iPod are sent to the connected Shop as GraphQL mutations via a node.js client.
  • Any failures or rejections are written back to a log.
  • After the updates, another fetch sync action script is run by node.js that makes 13 API requests to various endpoints (mix of GraphQL, ShopifyQL, and REST).
  • New data from Shopify is written to the .txt files, converted to the data.lua file, and the iPod is unmounted.
  • A smile crosses my face and all is well.

The UI build was pretty cool to watch. Opus 5.5 built it's own mocked Rockbox API to locally 'draw' the screen SVGs it needed. The agent was really proud of itself for figuring out some font sizing thing I barely understand. The 'home' dashboard had intersecting characters when there were different sizes of values. Something about how fonts are rendered locally versus at 8px in the iPod UI? :dunno: I plugged the iPod back in and let the agent run it's own diagnostics to figure it out on it's own.

home
Not a popular store, okay
an90
Good month for fake orders

As far as the Shopify API goes, the agent used the AI toolkit to inform itself of proper request patterns and GraphQL syntax, which just saved me a lot of time feeding it dev context. It's also just such a relief to have the agent understand what I'm trying to do when I'm giving it my private app credentials and client secret and whatnot, and not have it spin it's wheels with endless online search actions.

Why do this?

Great question, thanks for asking. :cool-kid: I really wanted to see how far I could push the concept of 'connecting' Shopify to anything. I've spoken in the past to a lot of big businesses who wonder about the ability to synchronise external systems of record with their Shopify environments. This feels like a bit of a definitive demo of 'look what's technically possible'. Not that I'm saying this would go into production. Please don't run your store from an iPod from 2007. But... you could. Do you see what I'm saying? This whole little sidequest cost me about $20US. There's something in the middle here, that if we can do something cool on the worst possible hardware, with so many unrealistic constraints, then something more modern shouldn't really be a challenge.

If a 20 year old click-wheel interface can support a lightweight store management workflow, all your bad old software has no more excuses. Make it better or drop 'em.