Introducing Rockpool

Information Flaneur 2023-05-21

Summary:

I've spent roughly a year completely rewriting the code running Aus GLAM Blogs, and it's finally ready for use. The old codebase was built with MeteorJS. This was a really useful framework when I was first learning JavaScript, because it allowed me to build a usable webapp with logins and routing, without really being that good at coding. As my JavaScript and general coding knowledge improved, Meteor became increasingly frustrating. I was spending more time fiddling with versions and dependencies than I was writing code. Integration with the npm module world was imperfect. I also realised there were some larger structural problems with the app. So I foolishly decided to build a new version from scratch.

After fiddling with a few options, including writing it in Python instead of JavaScript, I ended up using express, with the existing MongoDB backend and - a key component - passwordless for user logins. I'm calling the new software Rockpool - because it allows people to form a small conversational community without having to constantly swim in the bigger ocean of information. It's a crappy metaphor but I had to call it something.

What I learned

You might be wondering how on earth it took me (more than) a whole year to rebuild something that is really not that complicated. The answer is partially that I was doing this in my spare time, partially that it got more complex as I completed each part and became more ambitious, and partially that I used this as a learning opportunity for a number of new things I hadn't done before. I spent quite a lot of time thinking about how to implement new features I really wanted: several would require blog owners to sign in to the app, but I didn't want to be responsible for keeping passwords secure. I initially considered passport, but then I found Florian Heinemann's passwordless which sends a one-use login link every time a user wants to log in. Given users may only ever log in one or two times, this was a perfect solution. Unfortunately, Florian hasn't updated the code for a while, and there was a problem with one of the dependencies. So I had to fork the code and make a minor adjustment, and then publish that fork as a new npm module.

I got some experience publishing my own scoped npm module from scratch when I realised that obtaining RSS feed information from a website URL and vice-versa was something I might want to do in other coding projects. That module - feedfinder - also gave me a small project to use for finally learning unit testing with mocha, which I went on to use in a much bigger way in Rockpool. I've written before about using mocha, and how whilst it sometimes felt like it was slowing me down, it almost certainly made the project go faster with better code in the long run.

I played around with some roll-my-own AJAX, learned the basics of React, and then rejected it as far too fiddly and decided to learn and use VueJS instead. It turned out that using mocha to do unit testing really helped me when structuring Vue components, (even though I didn't actually test them with mocha), because it directed me to a kind of API-driven structure for the app's routes and function triggers.

I learned a bit about MongoDB indexes (though it's quite likely I haven't got this right), and finally got my head around Docker Compose. I've been using Docker Compose to run my Mastodon server for a while, but putting Rockpool into Docker containers helped me to understand what's actually going on. In some ways, Rockpool was just a vehicle for learning a bunch of web technologies and frameworks.

What it means for Aus GLAM Blogs

That's a lot of tech jargon for people uninterested in software development! Here's what it means if you follow or have registered your blog with Aus GLAM Blogs:

Improved performance

The old app connected to a remotely hosted database, and I hadn't set up any indexes. There were also problems with the way my database queries were set up. As a result, it was really slow - especially on first loading a page. The new app is much faster.

Update your own blog details

The new software allows blog owners to log in and update the Twitter and Mastodon accounts associated wi

Link:

https://www.hughrundle.net/introducing-rockpool/

From feeds:

Library ยป Information Flaneur

Tags:

Authors:

Hugh Rundle

Date tagged:

05/21/2023, 16:19

Date published:

03/29/2020, 20:00