Skip to content

Instantly share code, notes, and snippets.

@ptgamr
Created April 14, 2015 05:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptgamr/7d2629645910104fd196 to your computer and use it in GitHub Desktop.
Save ptgamr/7d2629645910104fd196 to your computer and use it in GitHub Desktop.
SoundCloudify sync approach

ON APP INIT

  • User has not login to Chrome: no server communication needed. only store data to local storage.

  • When user login to Chrome (profile_id is defined)

ON APP INIT

  • check if user is in the database

[If yes]

  • Override local data with remote data

[If not]

  • signup user: this will create a user in the database
  • upload local data to server (playlist, now playing, recent search)

ON USER INTERACTION

save to database first. If success, save to local. If error, notify user.

  • add/remove song to now playing
  • create new playlist
  • add/remove song to/from pla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment