story creator

The App
This is a simple React app I wrote that has the following intention:
- A user provides 4 topic areas they want a funny, short story written about
- A prompt is created in the background based on that input
- The prompt is sent to Open AI via an API to request a story
- The returned story is displayed to the user
- The app is styled to give an βauthorsβ feel via borrowed CSS and MS Paint
It turns out my API usage hit itβs limit π₯, so Iβve slightly altered the code to just display a static message. The ChatGPT part was secondary to actually learning and applying react, which was the real purpose of this. See below!
The Journey
I'll start by saying I π shiny. It's my π. But this year has shown me a few things, namely, it's π’ to need a Connect server to share apps. I've also wanted to learn something a bit more broad strokes, and so I chose React
This app, while simple, was a bit of a pain to get up and running. Here are the things I needed to learn:
- π¨ fundamental react concepts and syntax π¨βπ»: I mostly followed Youtube π₯ and surprisingly... the official π. I tried not to use GPT in generating any code as that would defeat the purpose π―
- βοΈ adapting ideas βΆοΈ: What I mean by this is pretty much switching mindsets and translating my ideas, couched Shiny's reactive framework, to React. The UI side was easy since I use a lot of custom CSS and JS in my shiny apps π
- π· development environment setup: I (begrudgingly) used VSCode to do the development. This involved setting up Node, using `npm` and getting familiar with testing and debugging in Chrome developer tools. `npm create-react-app` allowed me to hit the ground running ππ¨
- CI/CD: kind of, I first setup a github repository in VSCode, which was a learning by itself π¨βπ«. I then had to figure out how to actually `build` π a react app and deploy it somewhere! Here I setup a process to compile and push to gh-pages for hosting.
I realize a lot of these things I take for granted using R Studio and I see the value in knowing how to do it through other means β . I'll most likely continue working on my react skills next year, so keep an eye out!
Till next time π»β