Skip to content

Deploy Electron pre‐2023

benloh edited this page Nov 12, 2024 · 1 revision

DEPRECATED

As of 2023-09-30, these are deprecated instructions for deploying Electron. Kept for archival purposes. See Deploy Electron for current instructions


[Placeholder instructions for how to deploy to an Electron App -- these have not been carefully vetted but just lays out the general outlines of what you need to do. Please update with more specific instructions.]

To build and deploy an Electron app, you need to do the following.

I. Prepare Data

As you prepare things for Ravit, go ahead and modify the datasets/meme/*.db.js db files directly and commit them to the repo.  That sets a baseline that everyone will use.

The files in /system/datasets/meme would represent the starting db for your study. So if you add resources you want to edit the following two files:

  1. boilerplate/src/system/datasets/meme/resources.db.js
  2. boilerplate/src/system/datasets/meme/classroomResources.db.js

resources.db.js is the master list of ALL the resources. You can't edit this via the admin interface, so you'll need to update this by hand.classroomResources.db.js defines the resources that are available to each classroom. You can actually edit this via the admin interface. Select a classroom and check the resources you want. BUT, I haven't had a chance to add this functionality yet. in the mean time, you'll have to edit it by hand.

II. Build

On your dev machine:

  1. Pull your db commits (if they're not in your local repo)
  2. Download and place resources in the boilerplate/src/app-web/static/dlc
  3. Make sure you're using the right version of node: nvm use
  4. Run the packager: npm run package

III. Deploy

  1. Send electron app (in boilerplate/dist/meme-darwin-x64/meme.app) to Ravit
  2. The machine running MEME may need to turn off security.

I believe she should access all the resources then.

File Locations

npm run electron will load the databases in src/system/datasets/meme/.

npm run dev will load the databases in src/system/datasets/test/.

I believe when you run the Electron app itself, it'll initialize the database using the data in datasets/meme/. The live / changed data is saved in the respective *.loki files in /runtime, e.g. /runtime/meme.loki and /runtime/test.loki.  As are the logs.  These are the files you'll want to grab.

In the electron app, I believe they are in /Contents/Resources/runtime.

[2023-04-11 Update] With the latest code sign/app sign revisions, the database files are now located in ~/Documents/MEME/db. You can move/replace the meme.loki file in that folder to update and backup your database.