Sitecore Hackathon 2024: Visual Studio Code for Sitecore
More than half a year passed since our participation in the Sitecore Hackathon 2024. And I just realized that I didn’t write a blog post about it.
This year our team consists of 2 members: me and Stanislav.
We decided to participate in the category “Best Module for XM/XP or XM Cloud”. And we decided to improve the way, how you can view and edit files on your Sitecore instance.
Sitecore could be hosted in many different ways. Sitecore XM/XP can be hosted on the virtual machine, it can be hosted as Azure App Service, and it can be hosted on Docker or Kubernetes. Usually, you don’t need day-to-day access to the files in your CM instance. You deploy them using CI and everything works as it should. But, from time to time, things may go wrong. And, in order to troubleshoot them you need access to the files on your CM instance.
You can download files, analyze them, and upload them using different tools. But the most straightforward way would be the web interface.
Sitecore has(had?) a tool for it. It is named Sitecore File Explorer. Sitecore hid this tool from the menu, but you still can access it using a direct link. Can you just imagine, that it happened 8 years ago, and we still have a link in our favorites to access the File Explorer tool?
Nowadays, you will not surprise anyone by developing directly in the browser. You can click “.” in any GitHub repository, and you will get a very capable IDE. I was always interested in how it works. And when I can try it if not on the Hackathon? Can we have something similar to Visual Studio Code directly in the browser for our Sitecore instance? Let’s try!
Of course, we were not intended to write everything by ourselves. It would be just impossible in 24 hours. That is why the first part was to investigate, what we can use for it. After a quick search, we found two possible ways: Monaco Editor and Visual Studio Code Server. We tried both and decided to stop on the VS Code server. It was quite promising. There was less development work rather than integration work.
We divided our work. One of us was working on the installation of the VS Code server in our environment. Another was working on the creation of the Sitecore Application itself. Both tasks were quite straightforward. After finishing them, we got VS Code that allowed us to browse files on the Sitecore server:
But we missed one detail. VS Code Server relies on the web sockets for proper work. It worked without enabled web sockets, but with too many issues. Enabling them is not a big deal. But, the hard thing is to make them use Sitecore security for file access.
Unfortunately, we didn’t manage to integrate the Sitecore Identity Server and VS Code Server in time. And we submitted a fully working, but insecure solution. Please, don’t use it for any production instances.
Conclusion
Sitecore Hackathon is a wonderful event! It is the time when you can try something new. You can learn something new. You can check your time management skills in an extreme environment. It is like real project management in miniature. You want to make more, but you have a limited amount of time and a limited amount of developers. And also, you don’t want to be exhausted(burned out) after the event.
And it is fun! We participated in many Sitecore hackathons. All of them were interesting. We had clever ideas and interesting implementations for some of them. We failed some of them. And we won one of them!
And despite of results, it was always fun! Register for the Sitecore Hackathon 2025 and join us in this wonderful Sitecore community event.