Developing your Desktop App
Following the recent changes in the codebase, developing desktop apps takes into consideration the use of TypeScript 4. This is to address issues regarding maintainability.
src/main.ts, the script running at the main Electron process, orchestrating the whole application;
src/rootWindow.ts, the script that renders the UI of the root window, the app's main window;
src/preload.ts, which runs in a privileged mode to connect the app and the webviews rendering Rocket.Chat's web client.
To extend the app's functionalities with modules, always remember to differentiate between modules needed as
package.json.Like any other package depending project, only modules listed in
dependencieswill be included in the final distributable app.
servers.jsonfile will help define what servers the client will connect to. When specified, it will automatically populate the server list in the sidebar.
This file contains a list of default servers that will be added the first time the user runs the app and also when all servers are removed from the list. The file syntax is as follows:
"Demo Rocket Chat": "https://demo.rocket.chat",
"Open Rocket Chat": "https://open.rocket.chat",
"Awesome Rocket Chat": "https://awesome.rocket.chat"
You can bundle a
servers.jsonwith the install package, the file should be located in the root of the project application (same level as the
If the file is found, the initial "Connect to server" screen will be skipped and it will attempt to connect to the first server defined in the array. When that is done, it will take the user straight to the login screen.
If you cannot (or don't want to) bundle the file inside the app, you can create a
servers.jsonin the user preferences folder which will overwrite the packaged one. The file should be located in any of the directories listed below.
Run this command to execute tests on your changes.
To package your app into an installer use command:
This will start the packaging process for the operating system you are running this command on. When it is done, the output file ready for distribution can be found in the