Matchlogger: March summary and stats!

It is April already, so it’s time for some summary on my „Get Noticed” contest results so far. Did it go as I expected?

Application

First of all, things go a little bit slower than expected. 8 commits to the repository in March isn’t a great result. By now I have a working login and an ability to add teams (which I still want to restrict so that users could propose teams and an admin needs to accept them). My immediate goals are adding matches and, of course, deployment. BTW, did I mention that I own matchlogger.com? 馃槈 I would like the application to be available to the end users as soon as possible to be able to iterate with further development.

In total, the project now has 837 lines of code:

  • Java – 14 classes, 437 LOC
  • XML – 3 configuration files, 177 LOC
  • HTML – 5 files, 158 LOC
  • .properties – 6 files, 43 LOC
  • CSS – 1 file, 7 LOC
  • .yml – 1 file, 7 LOC
  • JS – 1 file, 6 LOC
  • .md – 1 file, 2 LOC

Blogging

I wrote 7 blog posts with tag DSP2017 in March. That’s around the planned amount. The most popular were:

  • Choose your Licence, Luke! – 41 views
  • Google OAuth2 login with Spring Boot – 37 views
  • Spring Boot: saving OAuth2 login data in DB using PrincipalExtractor – 11 views.

Those three were also the most popular posts on my blog during March. Looks like if the posts are focused on explaining one topic and have examples, they are the most popular. Likely this update post won’t be nearly as interesting as those three 馃槈

Extra stats

Time spent

In March, I spent 14 hours, 11 minutes and 10 seconds on Matchlogger development (data thanks to Toggl). Further 12 hours, 24 minutes and 56 seconds were spent on blogging – mostly for this contest. That means that in total, I spent around 51 minutes daily on the contest.

Code frequency

Looks like I tend to work in bursts. Those bursts are likely the days where I didn’t have any other plans, so I spent a lot of time on Matchlogger.

Branching

I’m not using full git flow, but branch my code and merge it to master through pull requests. It is enough for my project needs. As you can see, I usually have up to two branches open. You can also notice that there’s one case where a branch didn’t get merged – that was my modern approach to Vue.js development that turned out to freeze my IntelliJ on assets lookup even before I could exclude node_modules from scanning.

Timeslots

Nothing too unexpected here. On weekends I work throughout the day (I’m writing this post at 9 am), during the working week I tend to sit and code in the evening as during the day I’m at work.

Even if not everything goes as smooth as expected, I really like my pet project. I already learned new things and it can be satisfying at a time. 10/10, would participate again.

Niby o pi艂ce, a na Daj si臋 pozna膰, czyli Morena Gda艅sk – Karlikowo Sopot

Zaczyna si臋 runda wiosenna polskiej ligi, wi臋c pora nieco przyspieszy膰 prace nad Matchloggerem, 偶eby da艂o si臋 zapisywa膰 swoje mecze. Mia艂em dzisiaj okazj臋 by膰 na B-klasowym derby Tr贸jmiasta pomi臋dzy Moren膮 Gda艅sk, a Karlikowem Sopot. O samym meczu nie napisz臋 jednak za wiele, je艣li kto艣 ma ochot臋 dowiedzie膰 si臋 wi臋cej, to polecam albo relacj臋 na regiowyniki.pl, albo album ze zdj臋ciami z meczu zrobionymi przeze mnie. Opowiem za to co nieco o r贸偶nych sposobach patrzenia na mecz i tym, jak te sposoby maj膮 si臋 do procesu wytwarzania oprogramowania.

Uwaga, post zawiera zdj臋cia o 艂膮cznej wadze kilkunastu MB. Przed przej艣ciem na „czytaj dalej” upewnij si臋, 偶e korzystasz z Wi-Fi, jeste艣 na kablu albo masz odpowiednio du偶y pakiet transferu danych.

Matchlogger update: I can add teams now!

I did quite a lot today. From working login, I went to being able to add teams through the user interface. All code changes can be seen in today’s pull request.

Tables and entity classes for countries and teams

I started with a database table for country information. I decided that this one will be (for now) managed only through Liquibase changesets, as I expect that country list will be static. For the beginning, there’s only one country (Poland), but I already have a task to add more. Each of the countries consists of name, some country codes (ISO-3166-1, FIFA, IOC) and a link to flag picture from Wikimedia Commons.

My structure for teams starts simple and is likely to grow. We’ve got a name, country and a link to team’s crest (logo). Right now I don’t store pictures, just links to them. This will likely change in future, but that requires a decision on how to store them – something that is a good topic for another post 馃檪

Vue.js attempt

I must admit that I had some issues with Vue.js. My first idea was to create a REST API returning team list, load them with Vue.js and present records in a table with Angular-like syntax. I must have overlooked that before, but it turns out that core Vue cannot trigger AJAX calls and needs to use a separate library for that. One has several options, starting with vue-resource, up to jQuery. I decided to start with jQuery, as I already was importing it for Bootstrap JS features. Turned out that fighting with what it looked like a simple „for each row print <tr> and three <td> tags” took me three hours after which I decided that for this module, I will go the known way and implement it with Thymeleaf.

With Thymeleaf, the structure of the application is different. We don’t provide a REST API but insert needed values on backend side using a Model object instead. The templating engine works fairly similar to what I wanted with Vue.js though, so while I don’t remove Vue yet, I’ll start with Thymeleaf and read more on Vue in the meantime.

Thymeleaf layout

Thymeleaf has its benefits – one of them is a fragment-based layout. I now have a structure where layout.html defines the core layout and each of pages doesn’t have to include a header, footer, core CSS and JS files all over again. Of course, as I’m a lazy developer that wants to start with something that looks decent and is responsive, I started with Bootstrap that I aim to customize when I get the functional part done.

So, how does the team list look like?

The user is able to add a new team, define a country (from a long list that includes Poland, Poland and… Poland), add a link to a crest picture and that’s it. Not much, but it is a first real functional part of the application. More to come soon.