Dev an app in SafeNetwork. Where to start?

Hello,

i am a young french software engineer and I discovered Maidsafe as part of my work (Blockchain Start-up). The project is pretty cool and I would like to develop an application on the safe network. Where to start ? Is there some onlines tutorials/courses for beginners ? What is possible to do currently with the safe network ?

Thank you in advance for your replies and happy new year!

8 Likes

If you go to forum.safedev.org at the top you can click on tutorials and there are explanations on how to build these example apps (webrtc, markdown editor, comments plugins, p2p email) but I highly suggest you check back here on Jan 10th!!! We will be receiving an update which will most likely showcase the new authentication flow rather than the current launcher. This will change how apps interact with the network to a more direct and granular level. There may also be a new test network to test your app(s) you decide to build on! We’ll see but it has been hinted at strongly that we may be receiving vaults from home again, so true p2p after some redesign and refactoring that took place based off from community/maidsafe testing. As for the soon to be outdated example apps/tutorials I mentioned previously, those are supposed to be updated to reflect the upcoming changes so stay tuned and welcome!

11 Likes

The are several options and which you choose will be a mix of suitability for your purpose and personal preference.

As an example, the simplest and most readily portable option is a WebApp:

  • WebApps: HTML/CSS/JavaScript which can do pretty much anything via an API (safe-js) which is injected by the SAFE Browser. This API is pretty stable at the high level (safeAuth, safeNfs and safeDns), but incomplete and being extended/revised at the lower level (as is the underlying client library). There are quite a few demo and prototype apps running on the current testnet, which are built like this. I think all the MaidSafe tutorial examples are web apps, while also using web frameworks. Other examples are almost just HTML with small amounts of JavaScript. Many to look through and some posts written on this forum have attempted to summarise the options, but most are out of date (though still worth examining).

You’ll find the MaidSafe ones in the tutorials. Some recent examples created by the community are:

App Zero by @whiteoutmashups is a minimal example showing how to authorize your app with the network. He’s also created SAFE-FS Demo which goes further in terms of some useful functionality, and utilising much of the higher level safe-js JavaScript API.

I’ve ported a couple of existing web apps that use RemoteStorage.js, a JavaScript library that supports offline working and so automatically syncs data with SAFEnetwork. See My Favorite Drinks, a minimal list editing demo, and Litewrite a useful clutter free note taking app. Both are currently live on the test network (Test 11).

  • Complied/Interpreted languages: You can build apps in any language, and these can be licensed how you like - unless you link directly with the SAFE libraries which will then require GPL3.

Apps other than web apps would be compiled per platform, and also need to be downloaded and possibly installed by the user.

  • Nodejs/electron: A mixed option is to use nodejs/electron, which gives you a web app style framework which can be compiled for different platforms. The MaidSafe Demo App and the SAFE Launcher were built like this.
9 Likes

Thank you for your answers. I will do my first app in safe network in 2017!

8 Likes

I thought they used React, not electron?

Most of them has this particular code…

ReactDOM.render(
    <App />,
  document.getElementById('root')
)

Edited:

Actually some examples uses React, while other examples uses Electron.

I said the Demo App and Launcher use electron (not the tutorial examples), I think they both also used Angular but that was swapped out for React. Electron remains AFAIK.

Since (safe)beaker uses electron for their UI, is it smart to use electron to build the UI apps inside of the beaker? To save resources, and dependencies?

I think you are confusing things a bit here, Electron allows you to run and package a web app in such a way you can run it as a desktop app without worrying about compatibility of different OSs. So you can build web apps with Angular, React, etc., and run it in the browser or package it with Electron to run in on Widows, Linux or Mac.

1 Like