backendkinveymbaas

Kinvey HTML5-Starter: README instructions work on localhost but not Kinvey


Kinvey has an HTML5-Starter (link) that your supposed to "learn from, and even leverage[] as starting templates for your own apps." This suggests that the starter app is designed to work in the Kinvey environment, but I have serious doubts that the supplied instructions will achieve that.

The app works successfully on my laptop localhost, which is running Apache; but when I try to host the same on Kinvey, I'm stuck with some unanswered questions:

  1. The instructions say to execute "npm install" and "npm start". This was easy to do from the Windows command prompt when I tested it in the localhost environment, but how do you do the same in the Kinvey environment? As far as I can tell, this step is important in order for the app to load all the dependencies between the files.
  2. The instructions say to "Create a books collection and import data/books.json". Importing a file into a custom collection does not appear to be possible in the same way it is to import a file into the files repository. How do you "import" the .json file into the books collection without having to add each row and column manually?
  3. The src in the <script> tags of the html files are pointing to subdirectories that are lost in Kinvey because the folder hierarchy is not replicable in that environment. For example, login.html includes the following tag: <script src="/js/kinvey-html5-sdk.min.js"></script>. Because folders aren't imported to Kinvey's data repository, the /js directory doesn't exist. Intuition suggests scrubbing all the html of these directories so they all point to the files root, but I'm perplexed why this sample app, which presumably is tailored for Kinvey, would require such modification.

I'm stuck and I don't know the right questions to ask to research the solution further. Please help!


Solution

  • Kinvey does not host your mobile application, it hosts your backend (the data stores, user stores, etc. etc.)

    As such, the opposite of "deploying locally" is "deploying to your application delivery framework", for a webapp some type of webhosting service, for a mobile hybrid app you package it up as an apk or package to the apple appstore. This answers your questions 1 and 3.

    Question 2: Importing a collection doesn't go via the Files, in the Settings page for each collection is an import button.