MaidSAFE • TodoMVC

I pleased to introduce a reference implementation of TodoMVC for the SAFE Network, here https://github.com/Zatvobor/todomvc.

The main purpose of this app is to provide a complete example of MAID application development routine. This app promotes things like:

  • React and Redux conveniences.
  • compile JS and CSS through electron-compile.
  • testing through electron-mocha. Tests are running in renderer process.
  • Fetch API to interface a safe_launcher (first step towards Workers API).
  • application authorizing with confirmation whether the obtained token is still valid.
  • store todo list into safe network.

development still in progress. Let me know if you discover anything worth sharing.

18 Likes

@zatvobor that’s marvelous. Something I have in mind is a reference implementation for http://nobackend.org/ - but I’m busy with other stuff, so feel free to to jump in and we can get listed there! :slight_smile:

1 Like

Love and :star:ed it! Keep it up!

I was also thinking of building a pouchdb adapter of some sort (not exactly sure that’s the right angle), which allows you to replicate a pouchdb to maidsafe. Not gotten around to looking into that in detail yet though :frowning: .

3 Likes

Hi @lightyear, Hi @happybeing,

@lightyear you brought up PouchDB, as did @happybeing several times in the past.

The question of how a web app built with modern Javascript/RoR/… frameworks can live server-less in the browser and use the SAFE network for persistency and interaction with other clients also bugs me for a long time now. And the SAFE community didn’t find an answer to it yet, at least none that I am aware of. Please correct me if you have more insights than me.

Building a PouchDB-based layer for API-style interaction between a Javascript client-side app and the SAFE network is a worthwile goal! (In terms of simplicity I dream of an RoR-activerecord-like abstraction to interact with SAFE as an app developer!)

@happybeing and @lightyear, please let me know when your thoughts become actions…maybe i would join you.

Cheers!

1 Like

@mabe I’m currently looking at adding a SAFE back-end to remoteStorage which does what you seek: works offline and automatically syncs with the back-end. It uses browser offline storage rather than PouchDb, which means it is less powerful but - fingered crossed - easier to implement.

I’m still investigating at this point so am not sure how hard or easy this will be, but would welcome others helping with this as I’m still learning JavaScript and don’t have loads of time. So if you are interested, let’s get our heads together - anyone else welcome too!

2 Likes

wahahahaa - you really made me install a launcher with mock-network :smiley:

i created tasks, saved them - closed the app - restartet the app and everything was still there =) i love it! :sunglasses:

3 Likes

now i just need an arm client for my ubuntu phone + a front-end-app to show me the same todos and i could manage my tasks everywhere via safe :slight_smile:

For sure. It works as expected (some UI issues will be improved ASAP). Thanks ))

1 Like

Not sure. Launcher doesn’t provide Couch like API… The right angle is just only https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API

That sounds like an interesting (and sane) approach. I was briefly looking at the (current) spec and I think it shouldn’t be too hard to even have the launcher expose such an API per default (including the shipping of the currently supported remotestorage.js) not sure extensibility of the launcher is on the plan right now though. However, remoteStorage.JS seems to extensible by itself, and from looking at the existing backend-implementations, it shouldn’t be too hard to get one up for safe!

No. But that is also – from our perspective – just a glorified one-level-FS-system with specific rules on format and how to keep track of things. I was actually looking into the replication algorithm earlier and it really shouldn’t be too complicated to emulate that via a filesystem (and therefore ontop of maidsafe) – only problem is the usual: locking in a distributed system :wink: .

3 Likes

Not sure if I understood you correctly (totally new to remoteStorage), but basically you are proposing two approaches, right?

  1. Integrate remotestorage.js into launcher: A Javascript app directly communicates to launcher in a remotestorage.js-fashion.

  2. Extend/fork remotestorage.js: A Javascript app communicates to extended remotestorage.js, a SAFE-enabling localStorage-adapter communicates to lauchner.

In both cases the main task would be to code that safeStorage-adapter, right? Please correct me if I got you wrong!

You understood me right, @mabe

From what I understand you wouldn’t need to fork/mess with remotestorage (RS) itself, you could just provide the provider as a separate module – remotestorage is designed in a way to allow that easily.


For me the killer feature for a higher-level JS API kinda-baked-into-Safe would be to encourage good citizenship by the App/Tooling and more over offer offline-first capability. If MS came with an API for that, that’d be a major game changer!

2 Likes

@mabe @lightyear and @zatvobor in case you want to get involved in work on remoteStorage we can carry on our discussion in the SAFEpress forum remoteStorage discussion rather than derail this topic. We could have a topic here but I’d like to spark some life into the SAFEpress forum if possible, and SAFEpress is my ultimate (if overly ambitious for just me) destination! :slight_smile:

I have not done much yet, so it is open for anyone to hack code etc. When I have any code to share I’ll push it to my repo, but I’m happy to be overtaken by anyone who knows JavaScript and so on better than I.

@lightyear I thought it was necessary to hack remoteStorage.js itself so you you may already be ahead of me there. I’ve been looking at the support it has for Dropbox and Googledrive (both unsupported pre-alpha code) and was planning to follow that, but if you’ve found a better method I’m all ears.

So any of you are welcome to jump in if you’re interested, otherwise I’ll plod along and see how far I can get with a crude backend and share anything useful I can create, in that unlikely event :slight_smile:

3 Likes

Even better!

I totally agree!

2 Likes