Sean is Coding #9 - Hopping Back to JavaScript and Introducing TheraGPT 🐰
Hey there, coding enthusiasts!
Happy Easter to those of you who celebrate! I hope you're enjoying the holiday with family, friends, or just a relaxing day to yourself. We just got back from a fun Easter Egg hunt with the kids. It was a blast watching them excitedly gather up eggs, and it was super fun getting to know some of the other parents in our daughter’s kindergarten class a little better.
Now, let's dive into the latest updates from my software engineering bootcamp at Rithm School.
🔄 Switching Gears: JavaScript, Node.js, and Express.js
This week, we returned to JavaScript after three weeks of immersing ourselves in Python. It felt like a small whiplash getting reacquainted with semicolons, curly braces, and let/const, but our instructors assured us that switching back and forth will become easier over time.
The transition was made smoother thanks to our foundation in Python and Flask, as we began exploring Node.js and Express.js for running JavaScript on the backend. Node.js comes with most of the modules, like file system access, to make JavaScript work more like a proper server-side programming language. Express.js is a lightweight web app framework, much like Flask but for JavaScript.
To build web apps entirely in JavaScript, we had to get really tight with Promises and async/await. Async and await take care of most of the awkwardness that comes with JavaScript being single-threaded, but because of the promise object, it’s still noticeably more mental work to write asynchronous code in JS than in Python. I find this kind of ironic since JS was built to be a web language, but it is what it is, and honestly, it’s kind of fun to untangle.
🤖 Introducing TheraGPT: Your AI Therapist
Last week, I mentioned I’m working on a side-project called TheraGPT. With the AI craze sweeping the tech world, I've been eager to align my programming efforts more with AI/ML.
TheraGPT is built on the Open AI’s chat completions API, and the idea is simple: you provide a negative thought that's been troubling you, and TheraGPT identifies the cognitive distortions, suggests strategies for overcoming them, and offers a reframed thought to help you think more productively and objectively about the situation.
I'm thrilled to announce that an early (very early) MVP of TheraGPT is now live at https://theragpt.onrender.com/! Please give it a try and let me know what you think. The initial page load might take a minute or two since I'm using a free server.
It's a super-simple 2-route Flask app (a single GET and POST route) that uses JavaScript to handle the POST request asynchronously. It uses a single-field WTForm to accept and authenticate the request, and there's no database, so if you like the output you see, I recommend taking a screenshot or copying and pasting.
Source code is available here, along with a list of some of my planned new features: https://github.com/seanoliver/thera-gpt
This was a ton of fun to build, and even though it's very rudimentary, I'm kind of proud of it because it's the first time since starting this journey I've been able to go from "Oh, that's a cool idea" to "This idea is now a thing I made!"
That's all for this week! I appreciate you following along on this journey. Your support means the world to me. Until next time, keep exploring and learning!
Sean