iOS wrapper, cache and data structure


#1

Since I’m an iOS developer used to working with offline-first solutions like Firebase, Realm and Core Data I think the Blockstack SDK should rival their functionalities or at least be able to provide a lot of good alternative functionalities.

Since offline first is not an easy problem to tackle given the many different ways of structuring data I started working on a little side project that uses a Clean Architecture approach to trying to solve this problem.

The way I went about is writing a few protocols that guarantee that any struct that implements these can be saved to and retrieved from Gaia through the sdk.

Because the blockstack sdk uses a singleton I decided to put it in a separate platform layer and make it accessible through use cases.

You can follow my progress or fork at: https://github.com/YannisDC/BlockstackAdvancedExample and help build a better structure for blockstack apps with a UX that rivals that of mayor companies.

p.s. the repo uses MVVM + RxSwift + Coordinators so might be a lot to take in for the uninitiated


#2

You may want to checkout out our new sample app which is multiple pages and has more functionality than any of the others:

This is part of our Zero-to-Dapp tutorial.


#3

Hey–excited to check this out. If I’m understanding you correctly, you want to make it easy to put/get struct types with a simple call, right?


#4

My goal is more to abstract Blockstack away into a separate layer that can be interchangeable with RealmPlatform or Firebase or any other web service and proof that the UX can be on par.

But yes that’s what it boils down to. Have all the put/get, indexing and caching built in for any struct that implement my BlockstackProvidable protocol and make it accessible through this platform layer.


#5

Certainly an interesting idea with merit. I’ll take a look!