This codebase contains the Electron 'shell' that houses the Q1 Synth web app. It enables this web app to be packaged up as a desktop app for Mac OS, Linux and Windows.
It is an installation of the Electron-Forge project - an all-in-one tool for packaging and distributing Electron applications. For more information, see the Electron-Forge docs.
The web app that this 'shell' houses, as well as information on how to actively work on it, can be found here.
The remote API that handles networking using websockets can be found here.
The Q1 Synth desktop app requires connection to a remote API for networking to function. These credentials include the domain of the remote API, an API key and a Pusher key for authentication. Contact Lunar for a copy of these.
- copy .env.example to .env and fill out with the appropriate credentials
- API_DOMAIN should follow the format listed in .env.example
- An API_TOKEN can be generated using Laravel Tinker on the command line of the API server. For instructions, see here.
- API_PUSHER_KEY refers to the REVERB_APP_KEY in the remote server's .env file
To further develop or publish a new release of this app, you need to set it up locally. You will need to install Node and Yarn.
- Install nvm - see https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script
- Run
nvm useat the root of the directory and follow instructions to install the correct Node version if missing.
- Install yarn -
npm install --global yarn
- Run
yarnat the root of the directory to install all Node packages (dependencies)
You can develop this application and the web application concurrently.
- Spin up local version of web app
- http://localhost:5147 to view the web application
yarn startornpm run startto view the desktop application
- In the web app repo, run
yarn buildornpm run buildto generate a bundled version of the html, css and js files - Clear the contents of src/q1synth2 in this repo
- Copy the contents of the build/ folder in the web app repo into src/q1synth2 in this repo
- Currently, the variables passed from .env file in preload.js are not available at build time. Temporarily, we have to paste in the credentials. Do not commit these to the repo!
yarn makeornpm run maketo package up the distributable for the platform you are currently working onyarn make --arch=arm64,x64ornpm run make --arch=arm64,x64to package up distributables for both Apple Intel and Apple Silicon chips
To publish distributables, you must have write access to this Github repo, as well as the correct code signing certificates in your keychain, and a valid Apple ID account credentials in the .env file.
- See the Electron Forge docs on code signing for information on how to generate code signing certificates and add them to your keychain using Xcode.
- See the Electron Forge docs for generating credentials for notarization process.
- Generate a personal access token with write access
- Paste token into GITHUB_TOKEN in .env file
- Increment the version number in package.json
- Replace the exposed variables in src/preload.js with those in your .env file. Do not commit this file!
contextBridge.exposeInMainWorld('environment', process.env.ENVIRONMENT) // replace
contextBridge.exposeInMainWorld('apiDomain', process.env.API_DOMAIN) // replace
contextBridge.exposeInMainWorld('apiWsDomain', process.env.API_WS_DOMAIN) // replace
contextBridge.exposeInMainWorld('apiToken', process.env.API_TOKEN) // replace
contextBridge.exposeInMainWorld('apiPusherKey', process.env.API_PUSHER_KEY) // replaceyarn run publishto publish the distributable for the platform you are currently working onyarn run publish --arch=arm64,x64to publish distributables for both Apple Intel and Apple Silicon chips
Releases are available here.