eclipsesource / tabris-js

Create native mobile apps in JavaScript or TypeScript.
https://tabrisjs.com
BSD 3-Clause "New" or "Revised" License
1.4k stars 170 forks source link

Feature Request: Hackathon Starter Kit #1491

Open NotSoSmartNow opened 7 years ago

NotSoSmartNow commented 7 years ago

Thank you

First of all, may I commend everyone on this wonderful project.

Excellent job with the Snippets and examples. The documentation could do with a bit more love, but hey, this is a fantastic project!

The big plus point of this project is that it allows a mere Javascript developer to build a native, cross-platform mobile app without the massive overhead of having a macbook and installing all those complicated SDKs.

Feature Request

So, for a newbie, it would be super helpful to have a "Starter Kit" which would provide at least the following if not the whole kitchen sink:

  1. Login / authentication with a RESTful user authentication api. Auth with major providers etc. Log out / forgot password functionality.
  2. Offline app functionality.
  3. Fetching json data and images from remote server
  4. Maps integration
  5. Messaging system
  6. A good UI theme out of the box

I have spent over a month going through the documentation, examples and snippets and tried the individual components, but can't yet seem to glue them all together.

By the way, if it is possible to run all the snippets in Tabris.js 2 app like we can run the examples, it would be fantastic. Please point me in the right directions if someone knows an easier way than copy-pasting everything over.

Eg: Hackathon Start Kit by Sahat makes it super easy for newbies to get something up and running to play around with and learn how individual components are glued together. It's got a fantastic README to hand-hold a newbie from development to production.

I know this is a big ask, but it would help a lot of newbies get onboard.

PS: If anyone can provide a login snippet to authenticate a user against a RESTful api and store the credentials and not show the login screen again, it would be super useful.

cookieguru commented 7 years ago

The big plus point of this project is that it allows a mere Javascript developer to build a native, cross-platform mobile app without the massive overhead of having a macbook and installing all those complicated SDKs.

The latter is one of my favorite features as well :)

  1. This is a complicated ask, as no two APIs are the same. Could sample code be provided? Sure. But this isn't an end-to-end ecosystem; it's just a mobile app framework/ecosystem so the implementation details are going to vary widely depending on what backend you choose. Sometimes there are pre-existing Node modules that you can drop in and they just work if they're built on W3C APIs.
  2. "Offline app functionality" is vague--there's no clear definition of what this is
  3. What is missing? There's a Fetch example. For images, you can just set a URL as the source of an image and it just works
  4. Not all apps use maps, so maps functionality isn't baked in by default to try and keep it as lightweight as possible. There's tabris-plugin-maps that you can add to your project if you need it.
  5. Again, this is vague, and subject to the backend you choose. Two-way support while the app is open? Pick your favorite WebSocket implementation. Push notifications in the background? tabris-plugin-firebase (a work in progress).
  6. "Good" is subjective. There isn't really a theme, per se. The components all have their native style rather than conforming everything to fit some specific stylesheet. That is, the buttons you see are what you see are exactly the same as if you created a project from scratch on the native platforms. There are plenty of opportunities to style them to suit an individual app, if desired.

I think 4 and 5 are good candidates for adding to the documentation; these are two core types of functionalities that apps can have but aren't mentioned anywhere in the docs. I don't think deferring their functionality to a plugin is a non-starter, but discoverability is hard at the moment. On 6, this is something that has come up before, and could use a good doc page. #1429 is a good place to get started. Custom themes on Android may also help.


if it is possible to run all the snippets in Tabris.js 2 app like we can run the examples, it would be fantastic

Check out Running a Snippet in the snippets folder


At the bottom of the documentation homepage is a link to an eBook that helps walk you through the creation of the app.


If anyone can provide a login snippet to authenticate a user against a RESTful api and store the credentials and not show the login screen again, it would be super useful.

I do have a sample of logging in to a remote service: barcode-pusher with several caveats: 1) It's OAuth, not REST 2) The UI is very bad 3) The code is very sloppy 4) I never released the app for those two reasons 4) This was written for an older version of Tabris.js and 5) It no longer works because Google does not permit apps to place authentication pages in to an app's WebView. But if you can read through my callback hell, it may prove useful. As I mentioned before, the actual implementation details are going to vary from API to API. The high level outline, is, however:

When the app boots, check to see if credentials have been stored If they have not:

  1. Open a login page
  2. Validate the credentials against the remote server
  3. If they're valid, drop the credentials (or token) in to secureStorage
  4. Close the login page
  5. Proceed with the app's flow as normal

If they have:

  1. Proceed with the app's flow as normal
mpost commented 6 years ago

The suggested ideas are reasonable but very brought. I think it boils down to having a better getting started experience which than could lead to different aspects of app development in the docs.