Console #104 -- Theatre.js, diaspora*, and Gladys Assistant
Interview With Pierre-Gilles of Gladys Assistant
š¤ Sponsor - Around
"Once you start using Around, there is no going back."
Not a fan of video calls with clunky UX that take over your screen? Around's radically reimagined video calls are unobtrusive, thoughtfully designed, and free up your desktop. It's perfect for getting work doneāinstead of just talking about work. We've eliminated everything tiring about traditional video conferencing and rebuilt from the ground up for remote teams. Around's collaborative interface is perfect for things like code reviews, pair programming, and stand-ups, and comes with anti-fatigue touches like AI-based noise cancellation and background cropping. Once you try it, you'll never want to use Zoom or Google Meet again.
šļø Projects
Theatre.js
Motion design editor for the web. Theatre.js is an animation library for high-fidelity motion graphics. It is designed to help you express detailed animation, enabling you to create intricate movement, and convey nuance.
language: TypeScript, stars: 5741, issues: 41, last commit: May 07, 2022
repo: github.com/theatre-js/theatre
site: theatrejs.com
diaspora*
A privacy-aware, distributed, open-source social network. diaspora* depends on its community members to host and run pods that are open to anyone who wants to take part.
language: Ruby stars: 13,024 issues: 422 last commit: April 28, 2022
repo: github.com/diaspora/diaspora
site: diasporafoundation.org/
Gladys Assistant
Gladys Assistant is a privacy-first, open-source home assistant that runs on any Linux machine: a Raspberry Pi, a NAS, a VPS, or a server at home.
language: JavaScript, stars: 2056, issues: 44, last commit: May 04, 2022
repo: github.com/GladysAssistant/Gladys
site: gladysassistant.com/
š¤ Interview With Pierre-Gilles of Gladys Assistant
Hey Pierre-Gilles! Thanks for joining us! Letās start with your background. Where have you worked in the past, where are you from, how did you learn how to program, and what languages or frameworks do you like?
My name is Pierre-Gilles Leymarie, Iām 27 and Iām from France.Ā
I started programming when I was a young kid, I was building robots with the famous LEGO Mindstorms Kit, and programming them with C code.
At the beginning of my engineering studies in France, I started building websites using PHP and a bit of Javascript.Ā Node.js was gaining some popularity at that time (Node.js v0.6!), so I started playing with it, and I loved it. So I learned a lot about Node.js, backend development, and databases.
Still during my studies, I found a job in a Parisian startup that later became selected for Y Combinator! We all went to San Francisco with the team to work on the project one summer. I was doing mostly backend development (Node.js), working on the databases (Postgresql/Redis) and Cloud infrastructure (Docker/Azure), and learned a lot while working there.Ā
During that time, my parents offered me the first Raspberry Pi, and this is when I started playing with home automationā¦
Why was Gladys Assistant started?
When I received this first Raspberry Pi as a gift, on my side I was passionate about the Iron Man movie and wanted to have my own āJarvisā assistant like in the movie. So I started building it, and I created a blog that was called āBuild Your Own Jarvisā.
As more and more people were visiting my blog, I was getting some requests from strangers to build a full software that could integrate all the features that I was describing.
Ā So I started coding for a few months, and then I released the first version of Gladys Assistant.
Where did the name for Gladys Assistant come from?
I donāt remember exactly, but I was brainstorming with my family/friends, and the name āGladysā came out. Some people think itās because of GLaDOS in Portal, but itās not š
Are there any overarching goals of Gladys Assistant that drive design or implementation? If so, what trade-offs have been made in Gladys Assistant as a consequence of these goals?
Yes, we have a strong philosophy on Gladys that drives a lot of implementations choices:Ā
Easy to use: āOpen-sourceā doesnāt mean for us that Gladys is designed for tech people only. Gladys is built like we would build any consumer product like Twitter or Instagram. Everything happens in a clean UI, that we design with great care: loading state, translated and readable error messages, and no need to run command lines to use Gladys. Itās for the whole family!Ā
Stable: We value stability a lot. Gladys is embedded software thatās self-hosted by our users. When you work for a tech company hosted in the cloud, if you mess up on the backend/DB side, itās not a problem: you can still fix it because you have access to the servers. In Gladys' case, people self-host our solutions, and as a result, we donāt have access to the servers running Gladys. If we shipped buggy code, all Gladys instances worldwide would go down and we wouldnāt be able to do much about it! So we deploy releases with great care and have lots of mechanisms in place to ensure that releases are stable.
Opinionated choices over options: We like the philosophy of Elementary OS. When designing things, we make strong design choices, instead of putting lots of options so everyone is happy. We prefer having fewer users that love our product than a lot of users that just like our product.Ā
What is the release process like for Gladys Assistant?
We have some continuous integration to verify that the code quality is to our standard and that the code is working as expected!Ā
On each commit, we run some unit tests + integrations tests + frontend tests + linting + format check. Those tests are mandatory, and we cannot build a release if they are not passing.
When those builds are passing, we are building a Docker image, which is then downloaded automatically on every Gladys instance using Watchtower. Watchtower automatically replaces the old container with a new one running the new code, so releases are atomic: they cannot fail and we cannot end in a bad state.Ā
On the local Gladys instance (on each user self-hosting Gladys), after upgrading we have Sequelize running database migrations to migrate the local DB to the new format.Ā
What is the most challenging problem thatās been solved in Gladys Assistant, so far?
Gladys is a self-hosted product, meaning that if you host it at home, you can only access it from your local network.
If you are tech-savvy, you can forward the port of your internet box to put your Linux server on the Internet, but itās quite dangerous to do that, because now your home automation system is available online, and could be hacked!Ā
But still, our users like home automation because they want to control their homes remotely.
So how do we make Gladys accessible globally, without compromising security, and more importantly without compromising privacy?
To solve this issue, I built a few years ago the āGladys Gatewayā, which is an end-to-end encrypted proxy, powered by WebSockets, that makes it possible to access Gladys from anywhere in the world, without compromising privacy as the traffic is end-to-end encrypted between the instance at home and the user browser.
To build that, I had to dig into the WebCrypto API, to be able to generate key pairs from the browser and Node.js. At that time, WebCrypto was not even in Node.js, so I had to find a polyfill that was compatible with the browser implementation.
I read a lot about end-to-end encryption in other products: How does WhatsApp work? Apple iMessage? Dashlane? ProtonMail?Ā
After reading on the topic for weeks and a lot of testing, I wrote the first specification and talked about it with the founder of Insomnia, who built E2E encryption for the backup feature in his software.
In the end, it took me almost 4 months to build the E2E encryption feature, and itās been running for some time now and people are really happy about it!Ā
Is Gladys Assistant intended to eventually be monetized if it isnāt monetized already? If so, how? If itās already monetized, what is your main source of revenue?
Monetizing an open-source project is vital if the goal is to support this project for years. There are lots of costs in any kind of project (hosting a forum? Sending a newsletter? Domain? Website hosting? CDN to distribute builds?), and of course, it takes a lot of time to maintain a popular project.Ā
As time passes, if the project is only costing money to the core maintainer, and taking a lot of time on issues, pull requests, itās hard to stay motivated and involved as you have to get money somewhere to live! If the project is bringing 0, you have to work for another job and donāt have enough time to work on your open-source project.
To be sustainable, any open-source project has to find a stable source of income.
On Gladys, I started monetizing the project by selling an ebook and some videos about āhow to automate your house with Gladysā. It worked well, and I did 25k$ in sales on this package. A good start, but not enough to live on it and work on it as the main job.Ā
I was talking previously about the āGladys Gatewayā, Iām now offering this service as a subscription for 9.99ā¬/month, and it gives access to Gladys users to a bunch of useful features:
Remote E2E encrypted access to Gladys
Encrypted backups
Google Home integration
An Open REST API, accessible from anywhere in the world
I still cannot live fully from it, so Iām only working part-time on Gladys.Ā
How do you balance your work on open-source with your day job and other responsibilities?
I work part-time on Gladys, and part-time as a freelancer doing backend development for startups.
Iām very strict with my schedule: I only work on open-source during my āopen-source daysā, and I remove all notifications from my phone/emails to avoid being distracted when I work for a client, and when Iām on weekends/holidays.
In the past, I used to work during the evening/on weekends/on holidays, but in the long run, I struggled to keep this pace: I was burned out, demotivated, and tired.Ā
Now I keep those days off for family time & friends š
Whatās the funniest GitHub issue youāve received?
In Gladys, we used to have a feature that was called āBluetooth auto-detectionā.Ā
Any Bluetooth device that was detected near the Gladys instance was saved in Gladys, so the user could use it for presence detection.
One day, a guy complained that a marathon was going on in his street, and thousands of runners passed in front of his house with their Bluetooth running watchesā¦
As you can expect, the guy saw thousands of Garmin watches appearing in his Gladys instance! This was a very funny ābugā that we didnāt expect when building this feature! (This is fixed now btw)
Are there any competitors or projects similar to Gladys Assistant? If so, what were they lacking that made you consider building something new?
We do have some competition (Home Assistant, OpenHAB, Domoticz), and itās a good thing! It means there is a market for what we are building.Ā
I never really focused on the competition, all I wanted to do was to build something truly unique with my heart, and this is what I did with Gladys :)Ā
If you plan to continue developing Gladys Assistant, where do you see the project heading next?
We are looking forward to seeing what the Matter standard is going to bring to the smart home ecosystem (Matter is a proposal of an open-source smart home protocol developed by Apple & Google).
Our number one goal is to be compatible with most connected objects, and itās incredibly hard to do it right now without a unified standard.Ā
Want to join the conversation about one of the projects featured this week? Drop a comment, or see what others are saying!
Interested in sponsoring the newsletter or know of any cool projects or interesting developers you want us to interview? Reach out at console.substack@gmail.com or mention us @ConsoleWeekly!