# Kids NCurses Messenger

Yesterday I wrote a program that lets me and [Lily](https://www.lilywise.com/) (7y) send messages back and forth:

[![](https://www.jefftk.com/simplechat-slack-demo.png)](https://www.jefftk.com/simplechat-slack-demo-big.png)

[![](https://www.jefftk.com/simplechat-eeepc.jpg)](https://www.jefftk.com/simplechat-eeepc-big.jpg)

The laptop is an [eeepc 700](https://en.wikipedia.org/wiki/Asus_Eee_PC#Eee_700_series). It was the first mass produced [netbook](https://en.wikipedia.org/wiki/Netbook) and I [liked it a lot](https://www.jefftk.com/p/eeepc). By [2010](https://www.jefftk.com/p/making-a-looper-pedal) I wasn't using it anymore, and it ended up in the basement. Recently I found it, I noticed that while it is still a ridiculously tiny computer, it is a good size for a child:

[![](https://www.jefftk.com/eeepc-700-with-measuring-tape.jpg)](https://www.jefftk.com/eeepc-700-with-measuring-tape-big.jpg)

It still booted, and was apparently running [Debian 7](https://wiki.debian.org/DebianWheezy). I'm not sure where that came from; I had thought it had been in a box since before Debian 7 came out in 2013, but I guess not. I wasn't entirely sure what I wanted to do with it, but started by upgrading it to something recent. It was too old for `apt-get dist-upgrade` on its own, but by putting first 8, then 9, then 10 in `/etc/apt/sources.list` I was able to get it up to date with `apt-get update && apt-get upgrade`.

Thinking more about what to do with it, I thought Lily would be excited to have something her size, which might get her more interested in typing and writing. After over a year of remote school (and a bit of parental lessons) she could use the practice!

I started by writing a [simple chat TUI](https://github.com/jeffkaufman/simplechat/blob/main/client.py) in [python with curses](https://docs.python.org/3/howto/curses.html). It has a section at the bottom for input, and the rest is for the conversation so far. I added `exec python3 simplechat/client.py` to the end of her `.bashrc`, so it starts automatically when she logs in.

I initially wanted to make it send texts, but everything seems to cost at least $1/m for a phone number. Thinking over the chat apps already on my computer/phone, Slack would work well: they prioritize making it easy to integrate with.

Posting to Slack directly from the client was straightforward, but there wasn't a great way to receive messages. I decided to write an [intermediate server](https://github.com/jeffkaufman/simplechat/blob/main/wsgi.py) to receive messages with Slack's [Events API](https://api.slack.com/apis/connections/events-api), and have the client poll it. I didn't use any of their libraries; it was simple enough to send and receive JSON.

Our [house](https://www.jefftk.com/p/shared-house-setup) Slack now has a `#kids` channel, and any of us who join it can talk to Lily. I could potentially add external guests, but I'd want to teach her about `@-ing` people first. I could also potentially build support for other kids to join; perhaps her cousins when they're literate?

She's pretty happy with it, though I am curious how much she ends up using it.

(The code is [on github](https://github.com/jeffkaufman/simplechat).)