Skip to main content

Diet diary

 I really like play with food. I eat a lot of stuff and try different diets. After the last one, which was supposed to make me feel great, my LDL levels went to values I didn't think were possible at all. My doctor after seeing my tests and hearing my diet story said I don't need another diet, I need medicine treatment. But if diet made my condition, diet will take me out of it. I met with dietician and got request to log everything I eat, divided in 2-3 hour slots. As a person who prefers computers to pen and paper, I tried to find app that would fill my needs. There are plenty of apps to track food, but they all seem too complicated. You need to select every ingredient of every meal, I don't need to know how many calories my food has, I need to store somewhere that between 9 and 12 I have eaten slice of bread with pesto. That's it. Completing this task in most of the apps is just not worth the effort. So I decided to make my own app. I can log whatever I want there. But for reports, I wanted to have website which will do that. It should get data from ICloud and generate pdf. I wrote about some elements of the app itself before, today I'd like to write about the website.

CloudKit documentation is somewhat raw. You would think everything is there but no answers to real questions. I had to find various tutorials and other projects to get idea how to start. In the end I have found what I needed. 

App is available here:  https://jaropawlak.github.io/DietDiary/.

I don't provide sales landing page so you won't see anything until you login. After you do that, it connects to your IClouddata and you can start your work. Oh, a word about privacy. I don't store and I don't even see what data are on your ICloud, this is not a promise, this is fact. I don't have ability to see your data, it is only yours to see (and edit).

App has three main parts. One is to manage categories. You don't need categories but you may find them useful for filtering, if you want to log food and caffeine but report only food etc. Another part is adding new entries. As my app is not published (and I don't know if it will be considering how much free time is left after work and other things I do), you can add them on the site. Third part is for reports.

Error handling is pretty much nonexistent, if you enter "aaaaa" into number field, nothing is going to work, I made this app for myself and I know what to enter where :). 

However I had some difficulties too. Like some entries did disappear. I don't know if that's because it is hosted on "development" CloudKit or maybe under the hood some other things, which I don't understand did happen, but still, they happened. Even before my app had ability to delete entries (the mobile app). In the end I have added some extra checks in the mobile app, that test if entries are in ICloud and if they are missing - readding them again. 

I must admit I'm happy with both mobile and the webapp, they have filled my needs in 100%. My dietary adventure is over but software is left alive. Well, not very much alive, more zombie-like, waiting to be needed when I get new stupid dietary idea.

Cheers!

P.S. Sources here: https://github.com/jaropawlak/DietDiary


Comments