Diarist app - My entry for the #TwilioHackathon
Tags: twiliohackathon
Published: 2020-04-28 04:32:13


## What I built
**Diarist** is an app to help you update your Journal directly from Whatsapp. 
To use it you need to do the following:
1. Create an account by providing your phone number
![Registration](https://i.imgur.com/8sL4EBe.png)

1. You'll receive a whatsapp message from us asking you `How was your day today?`, just reply to it and we'll save your response
![Welcome](https://i.imgur.com/cv2a5CM.png)
![Whatsapp](https://i.imgur.com/kmU3DRf.jpg)

1. When you want to see your old entries, just log into the website or consume from the REST API.
![Journal](https://i.imgur.com/Gov4oME.png)


### Why is this better than an app or an old-fashioned notebook ?

* A common recommendation when starting a diary is to [write as if you were writing to a friend](https://www.skillsyouneed.com/ps/diary-journal.html), so what if the platform you used to do that was the very same one ?
* You don't have to install anything, it's literally just a number you text.

## Demo Link

Since there's still some functionality missing from the app (e.g. proper user management, I don't have an approved whatsapp business account, etc.) I've decided not to host it just yet, so I recorded a short video showing the functionality:

{% youtube UUQqogz5KqU%}

I hope you forgive my bad editing skills and dull voice over 🙈 


## Link to Code
{% github caruano95/diarist %}

## How I built it
I did the first draft of the app using the [Concepts app](https://concepts.app/en/) which you can see [on the repo docs](https://github.com/caruano95/diarist/blob/master/docs/layout.pdf)

Once I had a more clear idea I started looking at Twilio's examples and I found this [Appointment reminders](https://www.twilio.com/docs/sms/tutorials/appointment-reminders-java-spark) java spark app which seemed like a good baseline to build the project on top off.

In the end I used the Spark micro-framework for everything from the rest API to the frontend, as well as the Mustache template engine. I also use a MySQL instance to store all of the users journal entries.

## Inspiration for the app
* I've been thinking about diaries since I saw that [Loretta](https://youtu.be/6xSxXiHwMrg) superbowl commercial from Google (If you haven't seen it, go do that now, it's really good).
* The [Mellow Days](https://youtu.be/fPkPesz-t_Q) youtube channel is probably my goal as to how I want the interface to look

## A better description of the app
I like to think it's split in 3 separate functions:
1. A **journal 'prompt'**. This is the whatsapp message you get everyday. It's purpose is both to remind you to write every day and also to inspire some responses (There's a difference between "Remember to write your diary" and "What was the best part of your day?")
1. A **journal manager**, to CRUD all of your journal entries
1. A (not so) fancy **journal viewer** to read your old entries. Currently it's very simple but my vision for it includes different themes and tools to edit your entries

### What's next for the Diarist app ?
I already have some ideas but we'll see what the future brings (If you want to collaborate or bounce off more ideas I would appreciate the input):

* Add configurable journal prompts. I think figuring out what to write about it's really hard and asking the right questions always helps.
* Add more ways to send updates. Email is an obvious candidate for the next integration.
* Create an "On this day" feature like the one on Facebook. Journal entries are there to be remembered and although I'm not a Facebook user anymore I do miss that feature.
* Make the notification schedule configurable. Do you want a message every day at 8 PM ? You got it! Do you want a message only on Sundays ? It's up to you
* Create "themes" for the viewer. Mainly based around the stuff [Mellow Days](https://www.youtube.com/channel/UCU3ZpZbnPqdfUVU5zAeofcQ) from youtube creates since I'm interested on the whole "Looks hand-drawn but it's actually generated digitally" kind of stuff
* Normalize all of the stored data. I've seen some of the projects like [Notable](https://github.com/notable/notable) use markdown as a way to avoid vendor lock-in, which is a win for everyone IMO
* Add an easy way to edit the journal entries. I'm sure I'm not the only that has twice as many typos when writing on my phone.
* Add support for pictures (and other media). [That old adage](https://medium.com/@dt/the-myth-and-reality-of-a-picture-is-worth-a-thousand-words-a4ea985f8932) is true after all.