Description: Shorty - the URL shortener
In September of 2024, my friend Joe decided to publish a web framework he calls, Spiderweb. Me, not being a web developer, decided it would be fun to play around with and see what I could do. And since I had been asked a few times to design a URL shortener, that's what I decided to do.
Shorty is about as simple a URL shortener as you can get. You have 2 options when shortening a URL:
Since I am not the greatest with databases and didn't really see the need to play around with them for the purposes of this, especially since the datastore is essentially a key:value pair, I decided to just store it all in a JSON file. An added bonus of this decision is there's one less attack surface exposed.
It essentially works like this - you go to Shorty and give it a URL or a URL and shortening and it checks to see if the shortening (hash or provided) exists. If it doesn't it adds it to the mappings and gives you back the new URL. If it does exist it lets you know. Then, if you click on the link returned, it will take you to the URL you started with. Easy peasy. Personally I use it a bunch with my own shortenings to have quick URLs I can remember for things I need to go to often enough and want to remember them.
The real learning experience with Shorty for me came when I decided, "Hey! This is really cool! I should actually deploy this and run it!" Since I am definitely not a pro in this there was a learning curve in getting it all setup. I had to figure out some stuff with Digital Ocean (that's where I host it) and SSL certs and a ton of other things that I, personally, had not had to worry about before. Getting it set up at https://bnet.boo was a big learning experience for me that I am glad I undertook.

One more quick thing before I go. Joe (you remember my friend, Joe from the first sentence of this?) created Spiderweb as an exercise to understand how web frameworks work. Being someone who works in them all the time he felt he needed to understand what happens under the hood. Which, I think, is really cool. In any case, he gave a talk about it at North Bay Python and I think it's an amazing talk about the projects we do for fun.