This content originally appeared on DEV Community and was authored by Anna Villarreal
Infinite curiosity from the land of why-not
SO, there I was, attempting to rig up my backend…
It’s been a while since I touched React at all, and I had never used Node.js to any markable extent. It’s bad enough fighting my way through some basic javascript. But hey. What’s wrong with having a serious pile of nerves on occasion.
I made this nice user interface I crafted with AI prompts, and wanted to connect up the backend. I also recently created my first-ever virtual private server. This is such a long story, I’m not sure where to begin or end. So I’m writing about it.
Bruh
When I first deployed my VPS I was all excited about it. I chose to try out Digital Ocean after digging around and it being recommended by a friend. I thought about all the money and time I was going to save. Well there is always a security risk of course. But if you’re deploying bunny rabbits, who cares, right?
When I first went to deploy, I didn’t even have enough processing power to deploy my app. It literally died. Alrighty then. So I double it up, and it “deploys” – if you can call it that.
I was planning on using postgresql for my backend at first. Made user accounts and all of that, only to discover that AI had written the app for use with mongoDB. I hadn’t used that before but also didn’t want to rewrite the app, assuming that the AI had written it in a semi functional manner. In my prompts I instructed it to setup the backend as far as it could go, setting up routes and folders where backend information would go. So I guess we’re learning mongoDB today.
What I discovered right away, is that the most recent Ubuntu does not have the right dependencies to just pull in mongoDB. You have to go back in time and choose wisely. So that was a journey in and of itself. To make matters worse, the setup was trying to connect to mongoDB atlas. No wonder it wasn’t connecting. I didn’t have a mongoDB atlas account! But I didn’t want that, I wanted mongoDB on my VPS that I was already paying for. So once monogDB was set up properly on my VPS, that particular error went away.
Among my troubles was a very interesting situation where I got stuck, where the page was returning HTML when it should have been JavaScript. I kept making changes and then redeploying my app. Why were my changes not appearing? I had cloned my repo multiple times to my project in an attempt to get it working to grab the changes. In my frustrations, I had cloned the repo in multiple locations in my project, thus introducing these curious “submodules”.
Turns out, when you have repos inside of repos, the nested repos are called “submodules” – at least this is how I think of it. Every repo has its own “git”. For each git repo, it can have its own uncommitted changes, its own merge conflicts, and whatever other annoyance you can think of that would prevent a git fetch. Right when I thought I was done cleaning it up, THERE WAS ANOTHER. They had multiplied, like bunny rabbits! So, it goes without further ado, it was a HOT MESS.
I went full send on the forced rebases. It was without elegance and full of maniacal whims. I took comfort in knowing I had a “good” one on Github. I’m just glad I realized at some point that I was cloning repos in multiple places expecting results. Never again.
So, at the end of the day, I can’t tell you how excited I was to have a brand new, shiny error to chew on for hours. To be continued…
This content originally appeared on DEV Community and was authored by Anna Villarreal