Diff
Not logged in

Differences From Artifact [2b3efa3205]:

To Artifact [dc3c448e18]:


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
..
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
..
83
84
85
86
87
88
89
90
91
92
93

94
95

96
97
98
99
100
101
102
103

# SAFE Hosting Manager




## Install

* **Note: requires a node version 6.5.0 and an npm version 3.10.3**

First, clone the repo via git:

```bash
git clone https://github.com/maidsafe/safe_examples && cd safe_examples/web_hosting_manager
```

And then install dependencies.
Install with [yarn](https://github.com/yarnpkg/yarn) for faster and safer installation

```bash
yarn install

```

Manually build [safe_app_nodejs](https://github.com/maidsafe/safe_app_nodejs) dependency from `app/node_modules/safe-app`






## Run

Run these two commands __simultaneously__ in different console tabs.

```bash
$ npm run hot-server
................................................................................
```

or run two servers with one command

```bash
$ npm run dev
```

## CSS Modules

This boilerplate out of the box is configured to use [css-modules](https://github.com/css-modules/css-modules) and SASS.

All `.scss` file extensions will use css-modules unless it has `.global.scss`.

If you need global styles, stylesheets with `.global.scss` will not go through the
css-modules loader. e.g. `app.global.scss`

If you want to import global css libraries (like `bootstrap`), you can just write the following code in `.global.scss`:

```css
@import "~bootstrap/dist/css/bootstrap.css";
```

For SASS mixin
```css
@import "~bootstrap/dist/css/bootstrap.css";
```


## Packaging

Based on the platform configure `build.asarUnpack` option in package.json
```
osx : "*.dylib"
linux : "*.so"
windows: "*.dll"
```

To package apps for the local platform:

```bash
$ npm run package
```

To package apps for all platforms:





To package apps with options:

```bash
$ npm run package -- --[option]
```

................................................................................
To run the application without packaging run

```bash
$ npm run build
$ npm start
```

To run End-to-End Test

```bash
$ npm run build

$ npm run test-e2e
```


#### Module Structure

This boilerplate uses a [two package.json structure](https://github.com/electron-userland/electron-builder#two-packagejson-structure).

1. If the module is native to a platform or otherwise should be included with the published package (i.e. bcrypt, openbci), it should be listed under `dependencies` in `./app/package.json`.
2. If a module is `import`ed by another module, include it in `dependencies` in `./package.json`.   See [this ESLint rule](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md).
3. Otherwise, modules used for building, testing and debugging should be included in `devDependencies` in `./package.json`.



>
>
>







|


|
<


<
>


<
>
>
>
>
>







 








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


<
<
<
<
<
<
<







>
>
>
>







 







|

|
<
>
|
<
>

|

|

|
|
|
>
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
..
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
..
65
66
67
68
69
70
71
72
73
74

75
76

77
78
79
80
81
82
83
84
85
86
# SAFE Hosting Manager

#### Prerequisites
> SAFE Hosting Manager uses **[keytar](https://www.npmjs.com/package/keytar)** module as its dependency. Please install the prerequisites mentioned [here](https://www.npmjs.com/package/keytar#installing) based on the platform.

## Install

* **Note: requires a node version 6.5.0 and an npm version 3.10.3**

First, clone the repo via git:

```bash
$ git clone https://github.com/maidsafe/safe_examples && cd safe_examples/web_hosting_manager
```

And then install Node.js dependencies.


```bash

$ npm i
```


Finally, rebuild the native modules

```bash
$ npm run rebuild
```

## Run

Run these two commands __simultaneously__ in different console tabs.

```bash
$ npm run hot-server
................................................................................
```

or run two servers with one command

```bash
$ npm run dev
```






















## Packaging








To package apps for the local platform:

```bash
$ npm run package
```

To package apps for all platforms:

```bash
$ npm run package-all
```

To package apps with options:

```bash
$ npm run package -- --[option]
```

................................................................................
To run the application without packaging run

```bash
$ npm run build
$ npm start
```

# License

Licensed under either of


* the MaidSafe.net Commercial License, version 1.0 or later ([LICENSE](LICENSE))

* the General Public License (GPL), version 3 ([COPYING](COPYING) or http://www.gnu.org/licenses/gpl-3.0.en.html)

at your option.

# Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
work by you, as defined in the MaidSafe Contributor Agreement, version 1.1 ([CONTRIBUTOR]
(CONTRIBUTOR)), shall be dual licensed as above, and you agree to be bound by the terms of the
MaidSafe Contributor Agreement, version 1.1.