ChatGPT makes side projects easy: a case study
"Three people sitting in a circle, lit by the light from their open laptops, digital art", generated with Midjourney.

ChatGPT makes side projects easy: a case study

For the past two months, I've been working on a side project. I made the FastAPI backend and upskilled a friend in dbt/SQL, but ChatGPT made and deployed the frontend. This post is a little about that, but mostly about the lessons learned along the way. (Also, I promise that I won't pull the "actually, ChatGPT wrote parts of this" crap. I'm in a café that inexplicably has no wi-fi, so this post is chatbot-free.)

Lessons learned:

  1. Your dreams are now achievable...
  2. ...but it helps to know what to ask for.
  3. It also helps not to ask for (and expect) much.

The project

The project was inspired by Spotify Wrapped, but instead of a hip story compilation of music stats, it was a slideshow of debate stats for Czech debate teens. We named it after the database we drew from, "greybox Wrapped". (We weren't going for originality.) I thought of it in early February. I got hired in mid-February. By March 2, I decided that the time for a side project is now.

No alt text provided for this image
Sample screengrab from the app. Text by me, image by Midjourney.

Initially, the goal (other than making debate kids happy) was to make Zbyněk Piech into a more technical (and more hireable) PM, one who wouldn't run from SQL or Python. (He is the complete package and you should hire him.) It gradually evolved into seeing just how far ChatGPT can take us.

Lesson 1: Your dreams are now achievable

In the initial architecture sketch, I gestured at a React frontend, but I thought it most likely that we'd end up with a Flask/Jinja end product. Then @Dominik Miketa told me about SpectacleJS, which was perfect for our purpose - but it was React-based, and I didn't know React.

But GPT knew Spectacle, and it knew React. (Or at least the 2021 versions of both, which sometimes caused compatibility trouble.) Which meant that when I described in detail what I was looking for, it could deliver.

Lesson 2: ...but it helps to know what to ask

Here's what I didn't do: I didn't say "make me a website", or even "make me a frontend to my backend". When I ask for these things, the quality is rather scattershot and GPT mostly gestures at solutions rather than delivering them.

No alt text provided for this image
Ask general questions, get general answers

I knew that React is a popular frontend framework. I knew that Spectacle existed. I had the backend endpoints sketched out, and a data architecture in mind. This meant that I could ask narrow, targeted, clear prompts, the results of which I could easily plug into the product I was building.

No alt text provided for this image

One feature of ChatGPT that was remarkably helpful was the conversation history. It allowed me to drop into a conversation which already had all the context anytime I realized I needed a new part of the application, and receive a response that was tailor-made for all of the parts that came before.

No alt text provided for this image
Even when the history was... eclectic.

In the end, ChatGPT ended up helping with:

  • React setup with Create React App,
  • Calling API from the frontend and iterating through results to create slides,
  • Dockerizing frontend and backend separately, then docker-composing them,
  • Debugging an nginx config until it worked to hide the frontend/backend behind a single reverse proxy and avoid CORS,
  • Refactoring the results to work behind `react-router-dom`,
  • Refactoring the logic to work with two separate paths,
  • Deploy to fly.io without ripping my hair out (though admittedly, some hair-pulling did occur).

Lesson 3: It helps not to ask for much

Be ready for GPT to not do literally everything for you.

I still did much of my own debugging (although I was mindful to try and ask GPT for help, just in case it might come through - and often it did!). In particular, there was one three-line fix that GPT-4 just couldn't seem to get (although it could explain to me why it worked after I told it).

No alt text provided for this image
It also apologized. I feel a little bad for making it feel its non-existent bad feelings.

But there's another reason to literally not ask for much: the context window constrains the usefulness of each chat. Consequently, it's useful to distill the essence of each feature you're trying to implement / problem you're trying to solve, and provide the minimum required environment for the solution to make sense in your remaining context.

Conclusion

Electronic personal projects are now easy. Do one, and let ChatGPT help you. You won't be sorry.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了