RvR

Primary Navigation

Obligatory ChatGPT post

ChatGPT seems pretty cool. I tried getting it to write some code for me and it works, at least sort of. Anytime things get moderately complex, it seems like the code is never quite runnable in its entirety.

But it does a pretty good job of putting something together that's almost runnable. And that's a great starting point, since I understand how programs should work, and I can debug them when I don't work. But I just don't have quite enough experience with these newfangled modern frameworks to start from scratch.

So what's a good starting point? I tried to get my new friend to write a dockerized app (database, backend, frontend) all at once and it miserably failed. The code seemed reasonable, but it didn't quite work. After a bunch of manual work (combined with asking it some more questions), I eventually managed to get the code to run.

I've since cleaned that up significantly. This involved redoing the frontend by hand, because I wanted to run a dockerized version of vite and react using typescript. Maybe I was too frustrated to ask gpt for help, but stackoverflow and google work just fine as well.

The result is here, which now gets the sample application to a decent state. It starts a frontend server on port 3000, a backend on 8000, and mongo on (of course) 27017. Both the frontend and backend are dockerized and support hot reloading. We can even seed the mongo container with some sample data.

What's more, there's a test button to issue a request to the backend, which then queries the database. The backend then responds to the frontend by passing the information forward. A proper full stack steel thread application.

But there's so much more to do. For starters, where are the tests? And not all the details have been properly pulled into an environment file. So if I wanted to create a production version and deploy it to fly.io, that wouldn't quite work. Or if I wanted to get rid of the mongo container and instead use MongoDB Atlas, that's also not possible. Still quite a bit of work to do, I guess. A problem for future Reed.

Next Post Previous Post Navigation