DEV Community

Cover image for I asked GPT-4 to build a Shopify app. In an hour. And it did.
Ralf Elfving
Ralf Elfving

Posted on • Originally published at Medium

I asked GPT-4 to build a Shopify app. In an hour. And it did.

“You’re a helpful Shopify app developer assistant, helping to code Shopify apps.”

That’s what I typed into the system field of GPT-4 before I copy/pasted a Shopify app tutorial from Gadget.dev into the prompt. Then I added my question:

“What other kind of Shopify app tutorials do you think you could build with Gadget using the example tutorial above? Give five reasonable Shopify app projects you think we could complete together in less than an hour.”

I wanted to know if it could do it. I assume it could, but I wanted to find out for myself. I wanted to experience it. About an hour later, I had a complete Shopify app that updated a newly created customer segmentation metafield based on custom spending tiers whenever customers places an order.

Watch me.. erh.. GPT-4 code

I recorded a video of me going from prompt to finished app. Don't worry, I fast forward over the segments where GPT-4 is responding or where I'm debugging.

There's some resources and a longer write-up linked in the video as well if you want to get more details.

Some learnings from using GPT-4 to code

I'm not a very good developer. I just have ideas that are outside of my current experience, and available time. I learned that the importance to developing with GPT-4 is primarily two things.

  1. Understanding what GPT-4 has context of, and what is unique to your circumstance that you need to feed it context about (in my case I used a new platform called Gadget)
  2. Knowing enough to debug, or how to identify bugs and feed back the errors to GPT-4 to iterate.

I'm hoping my experience can inspire others to try this or something similar out. Time box an hour, and try something new you'd normally need many hours to complete. I think you'd be surprised what you can achieve.

Top comments (4)

Collapse
 
aarone4 profile image
Aaron Reese

GPT-4 is scary good. I gave it 3 related C# models and asked for a viewModel for create and update of the parent model with child's models and it correctly dropped the id and rowstamp fields. I then asked for a controller to use the create, update and delete and it created it including the cascade delete of the children.
Then I asked for a next.js API to hit the create and update with the correct http verb and model.
Lastly I asked for a next js page with a form to populate the body for the API, using React-for-m-hook and basic validation (inferred from the c# model!!!!!!)
Not a pretty page but functional in under an hour....

Collapse
 
ralfelfving profile image
Ralf Elfving

That's the thing. It's not pretty, but it's getting there faster than I would. Often in situations that are novel to me. It's an exoskeleton, question is if it will lead to atrophy.

Collapse
 
aarone4 profile image
Aaron Reese

GPT makes it work. The craft is in making the UI and UX. I still haven't found how to talk to GPT to create good CSS and on{Event} handlers. Maybe feed it some storybook templates....

Thread Thread
 
ralfelfving profile image
Ralf Elfving

Yes, try giving it existing examples and see how that goes. That's what's have worked well for me!