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!