3.1 App File Structure

The file structure of this app is relatively simple. It consists of:

R code files: These can all be found in the R_code folder. The server functions are separated for convenience and placed in the server_actions folder. Markdown files containing the documentation are placed in the Rmd folder.

R compiler files: All the necessary files for the stand-alone R compiler are placed in the R-Portable_Mac folder. This includes the custom Rcpp functions used to run the reconstruction codes (dan & SOE).

Electron files: The remaining collection of files; main.js, package.json, package-lock.json and the node modules folder come from the electron instance.

The basic structure is highlighted below:

electron-quick-start
│   main.js
│   package.json
|   package-lock.json
│
└─── node_modules
│   │   ...
│
└─── R-Portable-Mac
|   |   ...
│
└─── R_code
    │   ui.R
    │   server.R
    |   R_code.proj
    |
    └─── Rmd
    |    |   analytical.html
    |    |   citations.html
    |    |   filter.html
    |    |   Overview.html
    |    |   Release_Notes.html
    |    |   soe.html
    |
    └─── server_actions
         |   energy_matrix.R
         |   energy_spectrum.R
         |   filtering.R
         |   fitting.R
         |   hit_locations.R
         |   interaction_depths.R
         |   load_data.R
         |   multiple_slices.R
         |   reconstructing.R
    

The node_modeules and R-Portable-Mac folders contain too many files to comfortably display on the above file tree. The most important ones to note are the R shortcut and libraries folder in R-Portable-Mac and the electron folder in the node_modules folder.

I have found this layout to be the optimum way to deal with multiple R scripts. Originally the ui.R and server.R were contained in the same file but this was too combersome.