Křižíci - Unofficial app for skolakrizik.cz

2020/08
logo

Background

This is the next version of the "Křižíci - Unofficial app for vosaspsekrizik.cz". A few years later, the school rebuild everything - shoutout to Michal Dudek. With a completely new website and a new system of class substitutions the old app was partially obsolete and having with few extra years of experience, I decided to rewrite the app from scratch.

Development

Server - source code

First, I rewrote the server. Since I already had a lot of experience with NetCore, I decided to go with it. One of the requirements from the school was Google login - data may not be publicly exposed to non-students thanks to GDPR. Also, all data moved to shared Team Drive (Google Drive for groups), so I had to implement the Google Drive API. To make everything automated, I decided to parse text from PDFs using iText 7 - AGPL library for working with PDFs (which may seem pretty ugly, but the general structure of PDFs never changed and was one of few things that were surprisingly constant throughout this project and which I could count on). Now getting lists of classes, teachers and classrooms was pretty easy - no more hardcoding. To get PNGs out of the PDFs, I went again with ImageMagick, but this time as a library for NetCore. Everything was also memory-cached to make responses even faster. To make everything "fresh, cool, and in" I decided not to write a monolithic application, so microservices over RabbitMq was an obvious choice. The result was three microservices: API, Data and Auth. The content was still updated using crontab, but this time by sending a request using curl to the server.

App - source code

This time I used Kotlin, wrote cleaner, properly async code. Aside redesign which gave users an option to view timetables for not only their classes but also classrooms and teachers. Since the school finally made a brand new system for substitutions, displaying them was just a web view of the actual website. Also, as requested, Google Login was implemented. The result was a more stable and cleaner application with friendlier UI.

Technologies

Screenshots

What would I do differently

Aside from checking if files differ before converting them, which was a pretty expensive task, I'm also pretty sure I can write much cleaner and better code now, but in general, I'm pretty happy with the result.