Desktop application for ingesting audio to Arbimon
Additional requirements for Windows
Install dependencies
npm install
Then, rebuild non-native modules for current OS platform with
npm run postinstall
Start the electron browser/app with hot reload (auto restarts app on file changes)
npm run dev
If you need to set your own URL to API use (TODO: fix this as it might not work for now!)
npm run dev --url=`http://localhost:3030`
The project has a Github Action workflow, which will start building and releasing the app automatically on push to master
branch. 🦾
Check the script in .github/workflows/electron.yml
to see how it works.
Get a certificate (.pem) with the password (.p12) from DevOps or Team Lead. Check the certificate in the Keychain: Developer ID Application: Rainforest Connection with the private key. (see the example: https://help.apple.com/xcode/mac/current/#/dev97211aeac).
Also, Get an API Key (.p8) with API Key ID and API Key ISSUER ID from DevOps or Team Lead, or generate a new one at https://appstoreconnect.apple.com/access/api. The name of the p8 file should be AuthKey_<api_key_id>.p8
Put the API Key (.p8) into one of these directory in your local development machine.
./private_keys
~/private_keys
~/.private_keys
~/.appstoreconnect/private_keys
Based on the API Key ID
, altool
will look in the above places for the API Key file.Add the following to the .env
file:
APPLE_API_KEY_ID=API Key ID
APPLE_API_KEY_ISSUER_ID=API Key Issuer ID
In the package.json
add the following under build option (electron-builder config)
build: {
...
"afterSign": "./after-sign-hook.js",
...
}
Use npm run build
command for building the app.
(The after-sign-hook.js
will do its job, to notarize the app for you with the configuaration above)
.env
file:
CSC_LINK=your windows pfx file content (base64 encoded of the pfx file)
CSC_KEY_PASSWORD=your windows pfx file password./node-server/public
. After every build, we should put 4 files with the last version in the folder: ./node-server/public
and includes following files: RELEASES, .exe, *-delta.nupkg and -full.nupkg (If a new version of the app v1.1.1 you should put v1.1.0 to the folder).npm run start
in ./node-server
to start serving those static files from the previous build.package.json
file:
“squirrelWindows”: {
“remoteReleases”: “http://localhost:5000/public”
}
npm run build
command for building the app in another terminal../app/build
folder:
squirrel windows
folder to the GitHub: RELEASES, .exe, *-delta.nupkg and -full.nupkg.Lint all JS/Vue component files in src/
npm run lint
This script will convert the audio files recorded by the guardian into AudioMoth file type. It will add deployment_id
along with other metadata into the header of the files.
test/convert_guardian_to_audiomoth.sh
to generate test files
chmod +x convert_guardian_to_audiomoth.sh
./convert_guardian_to_audiomoth.sh [folder_name_of_original_files] [deployment_id]
In electron, there are 2 processes: main & renderer. Both processes are stored in src
folder.
With electron-vue, we are using vue components to make our large complex applications more organization. Each component has the ability to encapsulate its own CSS, template, and JavaScript functionality. Components are stored in src/renderer/components
.
src/main/index.js
file is the app’s main file, the file in which electron boots with.