Building my own desktop environment for the web, my 10 months journey
Tags: react, linux, typescript, webdev
Published: 2021-04-03 17:05:48

Around 9 and a half months ago I started working on a small idea I had, back then I thought to myself what if I could implement a full desktop environment with all the regular features of a desktop environment such as a full window manager and high-level abstractions of concepts like running apps and managing your desktop, but all with the exception of running in your web browser as a web app.


![nord theme example](https://raw.githubusercontent.com/shmuelhizmi/web-desktop-environment/master/assets/nord_theme_screenshot.jpg)
*above a screenshot of "web-desktop-environment" in action using the Nord theme and vs-code app*

# But way ❓
In theory, this may sound unnecessary (at the very least for some people), you could think to yourself, isn't the web much slower than my daily used blazing fast native CPP-based desktop environment?
or, what about support for all of the existing apps that weren't built to run on a web environment? well before I start and explain my solution to both those issue I want to start over and list the Pros I personally see in a web-based desktop environment -  

# The PROs 🤘
- accessible from anywhere - since it exists in the form of a website.
- isn't bound to a physical box - you don't must to have a physical PC, you could host your PC from anywhere, sometimes working directly from a public server could be awesome for some developers.
- great for low-end computers or servers - small PC boards like the raspberry PIs or low-end servers with virtual CPU/s and no GPU can struggle running a full desktop and dealing with rendering, but running a desktop environment web server? that's no problem.  

# The flows 👎
now, what about the flows with a web desktop environment?
let's start with the performance issues -
well, the way why address those is by breaking the regular way people have been writing web applications for the last few years, instead of providing to the user with a client app that contains all of the app logic and supporting that logic flow with a rest/socket API to supply the native functionalities like must full-stack web apps do, we instead move all of the logic to the server and only provide the client with instructions of what the server wants him to currently render, this moves out all of the heavy calculation and stuff that relies heavily on multithreading away from the client to into the server and by doing so keeps the web lightweight, fast and eliminate the performance issue with running a complete desktop on the browser.  

and what about the backward compatibility issue?
this is the hard one, I am working hard to find a way to enable support for x11 applications to run on the desktop environment but in the meantime and as of today (03.04.21) support for gtk3-apps to run via the broadway backend of gtk3 is already in the main branch and soon to be released to NPM.

![running gtk3 app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh1z548k1tgy52o6aisn.png)
*above a "screenshot of web-desktop-environment" in action running gnome-mines (a GTK3 app) via the broadway backend*

# Main features 🌠
## Apps
- terminal emulator 👩‍💻
- visual studio code ✌
- file explorer 📁
- text editor 📝
- media player 🎧
- settings/ system info app ⚙
- any GTK3 app (30% of apps do crash) 🐾

## Desktop
- slick-looking desktop 💻
- lot's of themes 🎨
- complete sync between all instances 👦<->👦

# Screenshots 🖼

![dark theme example](https://raw.githubusercontent.com/shmuelhizmi/web-desktop-environment/master/assets/dark_theme_screenshot.jpg)
*above a screenshot of "web-desktop-environment" in action using the main (dark) theme*

![dark theme pwa example](https://raw.githubusercontent.com/shmuelhizmi/web-desktop-environment/master/assets/pwa_app_screenshot.jpg)
*above a screenshot of "web-desktop-environment" in action running in PWA mode*

# Live demo  🖥
You can visit the live client side demo here https://web-desktop.app/demo , I can promise you that playing a bit with the themes can be quite fun!!

![demo app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/95iz5auikxjt533tu52j.png)
*above a screenshot of "web-desktop-environment" in demo mode using the dark transparent theme*

# Learn more
If you are looking to learn more, install the app or even just wanting to give me a star on GitHub 🙏 here is the link
{% github https://github.com/shmuelhizmi/web-desktop-environment %}