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 using either our JavaScript getting started guide, or our TypeScript and Angular getting started guide.
This repository contains a number of branches:
- The master branch shows how to build a robust, real-world app using NativeScript. The branch is built with TypeScript and Angular. This branch targets latest official release of {N}.
- The angular-end branch contains the finished code for the NativeScript TypeScript and Angular getting started guide.
- The end branch contains the finished code for the NativeScript JavaScript getting started guide.
- The web branch contains a web version of Groceries that shares code with the NativeScript-built native app. The app is built with the Angular CLI.
- The gh-pages branch contains the GitHub Pages hosted version of the web branch. You can view the web app live at https://nativescript.github.io/sample-Groceries.
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
From there you can use the run
command to run Groceries on iOS:
$ tns run ios
And the same command to run Groceries on Android:
$ tns run android
Groceries uses tslint + codelyzer rules to ensure the code follows the angular style guide.
You can run the linter with the tslint
npm script:
$ npm run tslint
Groceries uses NativeScript’s integrated unit test runner with Jasmine. 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.
The following is a list of all the people that have helped build Groceries. Thanks for your contributions!