[Confinement] Week 1

Busy busy week, although not really that hard for people who are used to freelance - and working from home.

Confinement is currently imposed by our government, and even though you hear here and there that it's an affront and whatever, make no mistake: we are testing our social bond by doing this. I am not at risk. Most of my friends are not at risk. We catch COVID-19, we run a fever, and we heal.

Near me, people at risk include my grand father, whose health is fluctuating, and my niece who will soon turn 3. We do it for them, not for ourselves. Now, if they caught it, a decently stocked hospital could save them. But here's the kicker: there are only so many beds in hospitals, and I don't want to put the people working there in the position of deciding whether or not my grandpa or my niece deserve to live, compared to someone else's grandpa or niece.

So we confine ourselves to slow the infection rate, so that hospitals could cope if my loved ones catch that virus, and so that people there don't have to choose who lives or dies. It's that simple really.

Now, it does present some challenges: all the classes at school must be remote-taught and you know how well that goes. Despite the fact that they save a ton of transit time, students don't work more. I'm not going to go on a rant about who students should be working for (hint: themselves), but I will let you imagine how much more energy is needed to keep them focused on learning rather than, say, watching videos online or playing games.

Of course, that means working on new means of coercion 😇

And so, I decided to put money where my mouth is, and since I teach some of them how to develop a backend system with Kitura, I build a plagiarism detector for the work they hand in. Everyone who knows me will tell you how much I hate web front development, but hey, confined means more time to learn new tricks.

Technologies used:

  • REDACTED: for plagiarism detection, CLI tool
  • Kitura: for backend development, resource management and rendering
  • PostgreSQL: for session management, data storage and retreival, in conjunction with Kuery
  • React: for front end development
Things learned from REDACTED

Plagiarism detection is hard. It is absolutely not about diffing files, but is more about turning the documents into a tree-like structure and comparing the branches and the leaves.

It's slow and inefficient, and it's probably not going to work against smart plagiarists. But hey, we'll see how many of my students read my blog 😜

Things learned from Kitura

I actually know Kitura quite well, having worked with it (and taught it) pretty much since its inception. I know some of its "competitors" (if such a term could be applied to open-source frameworks) quite well as well, but this one is the cleanest I know. It has very few dependencies, idiosyncrasies and pitfalls.

Even though IBM has decided to stop contributing in an official capacity, I still think it's the best fit for me, and that somewhat large project has comforrted me in that belief.

Things learned from PostgreSQL

It's the best open-source database software, bar none. Don't change postgres, I've been with you for 20 years, and I still love you very much.

Things learned from React

Where to start? I don't like the way modern frontend dev works. To my old eyes, they seem to be reinventing stuff we always had, in a worse way.

The component based approach is definitely better than doing plain HTML/CSS/JS, but it's so... heavy. There are hundreds if not thousands of dependencies, none of which I can audit for performance or security in a finite amount of time, and it's all running on an engine that's millions of not billions of lines of code. It's just too big to grasp, and too hard to debug.

It works, don't get me wrong, and when you do manage to get it to display things the way you want, it can do marvelous things... I am not dissing the web, per se, just lamenting that it emphasized the two things that I ask my students to avoid doing at all costs:

  • copying stuff you don't understand
  • relying too much of third party dependencies

But hey, got drag and drop upload, session history, and visual code comparison working, so I guess there's that. It was also the #1 time sink on this project.

Infrastructure

I decided to host and deploy that thing on my own server to test my chops as a sysop. Way back when, I contributed to open-source OSes, and I've always fancied myself above average when it comes to server management. That being said, I've had no formal training in the matter and I know I do some... ad-hoc stuff.

Managing a multi-site server has come a long way with Docker and docker-compose, but it's still not 100% easy. Especially if you need to add SSL certificates, which I do, because I'd like the contents of the files to have a modicum of security in transit.

If you need to have a docker + nginx proxy + let's encrypt certificates, I strongly suggest reading this documentation which will help you tons.

Can I Haz Ze Softwarez?

Only if you ask nicely. This is not going open-source for now, but I can offer it to other teachers/schools who face the same situation as me. Reach out and let's talk.