First I should say that I think the existing lesson is very good, and most ‘real’ devs would not find too many problems, but for us lesser mortals, there are still a few pitfalls.
So first, how about providing a simple ‘hello world’ type example as suggested in this thread?
Second, it would be helpful to beginners for the tutorial to be a little more instructional. There are lots of places where mistakes can be made, an obvious one being a failure to set the NODE_ENV to dev in the correct consoles (easily done if you start the browser from the file manager rather than the CLI too…). Also, there is the ever-present problem with node and npm versions, with different Linux distros seemingly having different requirements. Some of these issues could be avoided by spelling out the procedure and noting down where errors might occur.
For the SAFE Desktop App Tutorial, after a beefed up prerequisites section, I would suggest something like this (these are only partial instructions obviously):
Open three console windows or tabs in the folder where you want to build the app (e.g. /home/user in Linux ).
Download SAFE Browser Mock Routing zip file into that folder and unzip to extract the contents. We now need to do three different operations, one from each of the consoles.
Console 1
Start the browser and set up an account.First set the node environment to dev:
$ export NODE_ENV=dev
or in Windows
$ set NODE_ENV=dev
Now start SAFE Browser in Console 1 with:
$ safe_browser.../safe_browser
[or Windows equivalent]
[Instructions on setting up an account etc etc]
[What to do if you get stuck here]
Console 2
In Console 2 we will clone the repo which contains the boilerplate using git onto a local folder named safe_examples :
$ git clone https://github.com/maidsafe/safe_examples safe_examples
set the environment to dev:
$ export NODE_ENV=dev
And then install its dependencies:
$ cd safe_examples/safe_app_electron_quick_start $ npm install
At this point we have an Electron application ready to be launched, let’s run it:
$ npm start
[what we expect to see, etc, screenshot]
[What to do if you get stuck here]
Console 3
In Console 3 we will import the SAFE API.
The application will interact with the SAFE Network using the safe-node-app package, we therefore need to add it as a dependency in our package:
$ npm install @maidsafe/safe-node-app --save
[What to do if you get stuck here]
Configuration file
We will now edit the config file in stages to authorise our app, connect to the network, and create an editable file (MutableData) on the network.
First find the file safenetwork.js in /path/to/file and open it in a text editor.
At each stage, it would be useful if there were a note about common errors and their causes and possible solutions. For example:
“‘Uncaught in promise’ error - this can be solved in some OSs by upgrading node and npm …”[link to how to do this]
It would be good to have the final safenetwork.js file available to copy or download so users can make sure it is not their mistakes that are causing the errors.
Also, how about linking mentions of functions such as initialiseApp to the relevant API documentation?
That’s it for now. I hope walk-thoughs are planned for the other apps too? Happy to assist in writing/editing.
EDIT: Also, how about a different favicon for the dev hub? At the moment its the same as the safedev forum icon. Just a small change like a thin border or something would help differentiate it.