Lifegr – Quantified Self Web-App

I always forget which places I have visited and traveled too, so I wanted to keep a log of those locations. Initially, I tried using a custom Map under Google Maps, but it’s limitations quickly made it hard to search and visualize.  So for fun, I created my own little personal-tracker I called Lifegr (Life-Manager).

I started out by using the Google POI API to gather information about places and Firebase for storing the locations I visited. But, as with my Home Controller Project, I prefer to be in control of my data and be able to host it locally if I want to. So I imported my data from Firebase and into a locally hosted database.

But as the project slowly grew as I wanted more features, one of which was 24/7 location tracking of my phone, I ended up renting a DigitalOcean Droplet and hosting it there.

Features

The app is still being developed when I’m missing a feature, but here’s a small curated list of features.

Phone Tracking

Whenever I sat down and started noting all the different places I had been, I sometimes found it hard to verify when and sometimes where I had been. So I wanted to track the location of my phone as it’s with me most of the time.

To solve this issue I looked for an app, preferably open-source where I could enter my own server IP-address and have it push the location and status of my phone to said server. Luckily I found OwnTracks, the exact app I was looking for, but the only ‘issue’ was that it pushed over MQTT, so I wrote a small app that subscribes to the MQTT topic and writes it to a separate database.

Additionally to GPS location, OwnTracks also pushes battery percentage, if my phone is connected to wifi, etc. But for now only GPS Location is visualized:

File upload

On my study abroad trip I wanted to keep track of my expenses and receipts. But, if I for some reason needed to retrieve a receipt at a later point, I wanted to keep an image copy of it.

So some kind of file hosting was needed, I solved it by using an S3 (Amazon Storage) Compatible self-hosted solution, where I found Minio to be a pretty good fit. The file gets uploaded through the application server, where meta-data about the original file such as filename, uploaded data, etc. and it is then available for viewing by the user:

For each uploaded document I could add meta-data about how much money was spent on the transaction, location and what the time was (Including Timezone).

Personal Info

Then I started researching my family tree a little bit and thought it would be interesting to create a family tree, so I did:

I can click on each member and see their auto-generated family tree as well.

Since I had all the location data on myself, I wanted to generate I list of countries, municipalities, etc. I have visited, so I found datasets online for the different areas, which available in GJON (Geo-Json) and implemented an algorithm I found online to iterate over all unique places I have visited and calculated if it was inside any borders, which I then displayed:

This is a feature I will properly come back to some point to include Phone GPS locations and display at what times the user visited those locations, which shouldn’t be too difficult given the data is all there.

Even without phone location, it does take a few seconds to run through all the places I’ve visited and see if it is inside one of the ~4000 different borders/areas I’m currently checking against. So some optimization might be needed at some point.

 

To be continued.