Groceries is a NativeScript-built iOS and Android app for managing grocery lists. You can learn how to build a version of this app from scratch in the official NativeScript getting started guide.
The latest version of Groceries is available on the iOS App Store as well as Google Play:
This repository contains a number of branches intended to show off a number of the ways you can build NativeScript apps:
- The start branch contains the starting point for the official NativeScript getting started guide.
- The end branch contains the finished code for the getting started guide. Refer to it at any point while you’re completing the guide.
- The master branch contains the version of Groceries that appears in the iOS App Store and Google Play. The intention of the master branch is to show how to build a robust, real-world app using NativeScript.
- The firebase branch contains a version of Groceries that uses Firebase as its data store.
- The angular-end branch contains a version of Groceries built with NativeScript’s Angular 2 integration.
This app is built with the NativeScript CLI. Once you have the CLI installed, start by cloning the repo:
$ git clone https://github.com/NativeScript/sample-Groceries.git
$ cd sample-Groceries
Next, install the app's iOS and Android runtimes, as well as the app's npm dependencies:
$ tns install
From there you can use the run
command to run Groceries on iOS:
$ tns run ios --emulator
And the same command to run Groceries on Android:
$ tns run android --emulator
Finally, use the livesync
command to push out changes to your app without having to go through the full build cycle:
$ tns livesync ios --emulator --watch
$ tns livesync android --emulator --watch
If you’d like to try developing Groceries without going through the full setup, you may be interested in loading the app through Telerik AppBuilder:
Groceries uses JSHint and JSCS for code linting. To kick off both, use the app's npm run lint
command:
$ npm run lint
Groceries uses NativeScript’s integrated unit test runner and Mocha with Chai for assertions. To run the tests for yourself use the tns test
command:
$ tns test ios --emulator
$ tns test android --emulator
For more information on unit testing NativeScript apps, refer to the NativeScript docs on the topic.
Groceries uses Travis CI to verify all tests pass on each commit. Refer to the .travis.yml
configuration file for details.