-
Notifications
You must be signed in to change notification settings - Fork 1
/
info_project-structure.Rmd
109 lines (83 loc) · 3.8 KB
/
info_project-structure.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
title: "project structure"
---
the jamovi source structure contains the following components:
directory | contents | build command | artifacts |
----------|--------------------------------|---------------|-----------|
electron/ | the electron app which represents the entry point of the program | `npm install` | default_app.asar
server/ | the server code written in python and built on top of tornado | `python3 setup.py \` `build_ext --inplace` | jamovi.server (python module)
engine/ | the background processing engine, written in C++ and making use of R | `make` | jamovi-engine (an executable)
client/ | the html, javascript and css which make up the user interface for jamovi. | `npm install` | js, css, html |
examples/ | the example data sets | (these can be copied verbatim)
platform/ | platform specific files, icons, etc.
the `electron/`, `server/`, `engine/` and `client/` subprojects can be built by navigating into their directories and issuing the build command listed in the table above.
## final structure
after building each of these subprojects, the results of the builds are assembled into a final tree for installation. the final jamovi folder structure for ubuntu is as follows:
```
/usr/lib/jamovi/
├── bin/
| ├── locales/
| | └── ...
| ├── resources/
| | ├── electron.asar
| | └── default_app.asar
| ├── jamovi
| ├── env.conf
| └── ...
└── Resources
├── jamovi
│ ├── client/
| | └── assets/
| | | └── ...
| | └── ...
| ├── examples/
| | └── ...
| └── server/
| └── jamovi/server/
└── modules
├── base
| └── R/
| └── ...
└── jmv/
└── ...
```
## `bin/`
the electron executable is the entry point for jamovi. it represents a combined web browser interface and nodejs interpreter. in constructing the `bin/` folder, its contents are simply taken from electron release archives (available from https://electron.atom.io), with three exceptions:
- the `jamovi` executable
- resources/default_app.asar
- `env.conf`
the `jamovi` executable is simply the `electron` executable renamed.
the `resources/default_app.asar` is the default electron app which electron goes looking for when it starts up. this needs to be replaced with the `default_app.asar` produced by the electron component of jamovi (from the `electron/` folder in the repo).
`env.conf` contains the path settings and environmental variables that jamovi requires. variables which end in `PATH` or `HOME` are resolved relative to the `env.conf`. on ubuntu, it's contents are:
```
[ENV]
R_HOME=/usr/lib/R
R_LIBS=/usr/lib/R/site-library:/usr/lib/R/library
PYTHONPATH=../Resources/jamovi/server
JAMOVI_HOME=..
JAMOVI_MODULES_PATH=../Resources/modules
JAMOVI_EXAMPLES_PATH=../Resources/jamovi/examples
JAMOVI_CLIENT_PATH=../Resources/jamovi/client
JAMOVI_SERVER_CMD=/usr/bin/python3 -u -m jamovi.server 0
```
## `Resources/jamovi/client`
this folder contains the following files from the `client/` subproject:
- `index.html`
- `main.js`
- `main.css`
- `analysisui.html`
- `analysisui.js`
- `analysisui.css`
- `resultsview.html`
- `resultsview.js`
- `resultsview.css`
- `assets/*`
## `Resources/jamovi/server`
this folder should contain the following files and folders from the `server` subproject:
- `jamovi/server/`
- `jamovi/core.*.so`
- `jamovi/__init__.py`
- `jamovi/__pycache__`
note that the `PYTHONPATH` in `env.conf` is `Resources/jamovi/server`, so the final path of the `jamovi/server/` directory will look a bit silly: `Resources/jamovi/server/jamovi/server`
## `Resources/jamovi/examples`
this is just the contents from the `examples/` subfolder