Skip to content
This repository was archived by the owner on Aug 9, 2019. It is now read-only.
This repository was archived by the owner on Aug 9, 2019. It is now read-only.

Api-Ui Functions Proposal #7

@sGerli

Description

@sGerli

Rebble Store Api UI Functions Proposal V1.2

This is a proposal for communication between Ui and Api for the Rebble Store.

UI Communication

The Api should have various functions for communicating with the Vue.js UI, I propose this ones:

  • getHome(platform, isApp) (isApp is used to identify if we are talking about the watchface home or app home) this should return this:

    {
      "slider": [
        {
          "imageURL": "http://example.com/image.png",
          "altText": "My Featured",
          "id": 75 // ID is then used to link this banner with the collection
        },
        {
          "imageURL": "http://example.com/image.png",
          "altText": "My Featured",
          "slideId": 75 // ID is then used to link this banner with the collection
        }
      ],
      "appCollections": [
        {
          "headerTitle": "Fresh Picks",
          "id": 76576, // Again used to link with the app collection
          "cards": [ // Should only return 8 cards
            {
              "title": "My App",
              "isApp": true, // This is to decide screenshot/icon size
              "imageUrl": "http://example.com/image.png",
         	  "thumbsUp": 24,
              "id": 32 // To link with the app-detail page, this id is unique for each app
            },
            {
              "title": "My App",
              "isApp": true, // This is to decide screenshot/icon size
              "imageUrl": "http://example.com/image.png",
         	  "thumbsUp": 24,
              "id": 32
            }
          ]
        },
        {
          "headerTitle": "All Apps", // This should always come but it should be the last item
          "id": 765346,
          "cards": [ // Should only return 8 cards
            {
              "title": "My App",
              "isApp": true, // This is to decide screenshot/icon size
              "imageUrl": "http://example.com/image.png",
         	  "thumbsUp": 24,
              "id": 32
            },
            {
              "title": "My App",
              "isApp": true, // This is to decide screenshot/icon size
              "imageUrl": "http://example.com/image.png",
         	  "thumbsUp": 24,
              "id": 32
            }
          ]
        }
      ]
    }

  • getCollection(id, platform, page, popular) (popular is a boolean it only is valid in tags (categories), in any other case it should be ignored used to change order from Popular to New Releases) this should return:

    {
      "cards" :[ // Each page should not contain more than 12 cards
      	{
         "title": "My App",
         "isApp": true, // This is to decide screenshot/icon size
         "imageUrl": "http://example.com/image.png",
         "thumbsUp": 24,
         "id": 32
       },
       {
         "title": "My App",
         "isApp": true, // This is to decide screenshot/icon size
         "imageUrl": "http://example.com/image.png",
         "thumbsUp": 24,
         "id": 32
      }
     ]
    }
  • getTags(n, platform) (n is the number of tags to get (most popular first)) should return:

    {
      "tags": [
        {
          "title": "Games",
          "id": 324 //App Collection ID
        },
        {
          "title": "Daily",
          "id": 324 //App Collection ID
        }
      ]
    }

  • getApp(id, platform) (if platform is blank it will be ignored and basalt will be selected by default) it should return:

{
  "title": "Smarty Weather",
  "assets": {
  "screeenshots": [
    	{
      		"imageUrl": "http://example.com/image.png"
    	},
    	{
      		"imageUrl": "http://example.com/image2.png"
    	}
  	],
    "appBanner": "http://example.com/banner.png",
    "appIcon": "http://example.com/icon.png" // Only if it's an app
  },
  "description": "My large description",
  "author" {
  	"name": "Stefano Gerli"
    "id": 65
  }
  "appInfo": {
    "pbwUrl": "http://example.com/app.pbw"
    "rebbleReady": true, // True if the developer has authorized us to distribute his app
    "updated": "Dec 7 2016",
    "version": "4.4",
    "tags": [
    	{
      		"title": "Games",
      		"id": 324 //App Collection ID
    	},
    	{
      		"title": "Daily",
      		"id": 324 //App Collection ID
    	}
  	],
    "supportUrl": "http://support.example.com",
    "authorUrl": "http://example.com"
  }
}
  • getAppVersions(id) this should return:

    {
      "versions": [
        {
          "number": "4.4",
          "releaseDate": "Dec 7, 2016",
          "description": "My changelog 7"
        },
        {
          "number": "4.3",
          "releaseDate": "Dec 4, 2016",
          "description": "My changelog 1"
        }
      ]
    }

  • getSearchResults(searchQuery, platform) this should return:

    {
      "successful": true, // false when no result was found
      "cards" :[ // Each page should not contain more than 12 cards
      	{
         "title": "My App",
         "isApp": true, // This is to decide screenshot/icon size
         "imageUrl": "http://example.com/image.png",
         "thumbsUp": 24,
         "id": 32
       },
       {
         "title": "My App",
         "isApp": true, // This is to decide screenshot/icon size
         "imageUrl": "http://example.com/image.png",
         "thumbsUp": 24,
         "id": 32
      }
     ]
    }
  • Collections (card collection, this name comes from the Vue UI) are groups of apps (Featured, fresh picks, and tags)

  • Tags are our replacement to app categories they have an id that is also a reference to a collection).

  • There are only 3 types of id:

  1. App Collection (for features, tags, banner slides)
  2. App Id
  3. Author Id
  • Platform should be: aplite, basalt, chalk, or diorite.

  • I'm still missing the thumbs up add on and remove one and also a way to fetch them for the app details page.

  • I want to hear what do you think and what can we change to make it better.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions