All Projects → shripalsoni04 → nativescript-angular-web-starter

shripalsoni04 / nativescript-angular-web-starter

Licence: MIT license
A starter project to create web and native mobile apps using nativescript and angular with single shared code base.

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to nativescript-angular-web-starter

vueuse-vite-starter
⚡️ Starter for Vite + VueUse + TypeScript
Stars: ✭ 121 (+157.45%)
Mutual labels:  starter-template
react-typescript-material-ui-with-auth-starter
React + Material UI + Auth starter using TypeScript
Stars: ✭ 27 (-42.55%)
Mutual labels:  starter-template
nativescript-fancy-calendar
Fancy calendar for NativeScript 😄 🍻
Stars: ✭ 21 (-55.32%)
Mutual labels:  nativescript
phaser-3-vsc-typescript-nodejs
Template for a new Phaser 3 project with Visual Studio Code, TypeScript, and Node.js.
Stars: ✭ 18 (-61.7%)
Mutual labels:  starter-template
nativescript-image-filters
NativeScript plugin to apply filters to images
Stars: ✭ 30 (-36.17%)
Mutual labels:  nativescript
ios-empty-application-xcode-template
🙈 An empty iOS application project template without a storyboard for Xcode 11.
Stars: ✭ 28 (-40.43%)
Mutual labels:  starter-template
react-you-do-you
How I use React + Redux + Material-UI + TypeScript – you do you 💖
Stars: ✭ 103 (+119.15%)
Mutual labels:  starter-template
nativescript-numeric-keyboard
🔢 Replace the meh default number/phone keyboard with this stylish one
Stars: ✭ 33 (-29.79%)
Mutual labels:  nativescript
Minimal-Blog
Tailwind CSS Starter Template - Minimal Blog
Stars: ✭ 100 (+112.77%)
Mutual labels:  starter-template
nativescript-menu
A plugin that adds a pop-up menu to NativeScript
Stars: ✭ 17 (-63.83%)
Mutual labels:  nativescript
nodejs-angular-starter
A starter template to work with on NodeJS (typescript), Angular (with SSR), and shared models.
Stars: ✭ 13 (-72.34%)
Mutual labels:  starter-template
nativescript-ng-shadow
Angular directive to apply shadows to native elements according to the elevation level guidelines of material design specification
Stars: ✭ 54 (+14.89%)
Mutual labels:  nativescript
petite-vue-starter
🦋 Petite Vue + Vite + UnoCSS + TypeScript Starter
Stars: ✭ 39 (-17.02%)
Mutual labels:  starter-template
react-admin
基于React + ant-design的用作后台管理项目的脚手架
Stars: ✭ 96 (+104.26%)
Mutual labels:  starter-template
nativescript-vue-rollup-template
A NativeScript template ready to roll with Vue.js and .vue files.
Stars: ✭ 39 (-17.02%)
Mutual labels:  nativescript
vue-h5-template
H5 开发的 vue 项目快速启动模板
Stars: ✭ 23 (-51.06%)
Mutual labels:  starter-template
saas-react-starter-kit-boilerplate
SaaStr is a React SaaS boilerplate to kickstart your new SaaS adventure as fast as possible. Built on top of Adonis JS for the BackEnd and React Starter Kit for the Front-End
Stars: ✭ 100 (+112.77%)
Mutual labels:  starter-template
nativescript-apple-sign-in
Sign In With Apple, as seen on WWDC 2019, available with iOS 13
Stars: ✭ 37 (-21.28%)
Mutual labels:  nativescript
nativescript-dev-webpack
A package to help with webpacking NativeScript apps.
Stars: ✭ 98 (+108.51%)
Mutual labels:  nativescript
texttospeech
Text to Speech NativeScript plugin for Android & iOS 📢
Stars: ✭ 44 (-6.38%)
Mutual labels:  nativescript

Nativescript Angular Web Starter

A simple starter project to create native mobile and web apps with single shared code base using angular and nativescript.

YouTube demo

Check this Open Souce Cross Platform Quotes Application for reference, which is made with the exact same architecture as this starter project.

Prerequisites

  1. Globally installed Nativecript - npm install -g nativescript
  2. Globally installed Angular CLI - npm install -g angular-cli
  3. Mac OS to build iOS app.

Installation

  1. git clone https://github.com/shripalsoni04/nativescript-angular-web-starter --depth=1
  2. cd nativescript-angular-web-starter
  3. npm run ngxp-install

Run Web application

npm start - This will start the application at http://localhost:4200.

Run iOS Application

npm run start.ios

Run Android Application

npm run start.android

Project Folder Structure

nativescript

This contains a nativescript project for creating Android/iOS applications.

tools

This contains scripts useful during development.

web

This contains nothing but a web project created using angular-cli.

x-shared

All the code/assets which are common to both web and nativescript projects resides here. This folder is symlinked to nativescript/app/x-shared and web/src/x-shared folder. So changes in x-shared folder from any of the three locations will get reflected in other two folders.

Commands

You can execute any valid command of angular-cli from web/ folder and any valid command of nativescript-cli from nativescript/ folder. For convenince below are the commands which you can execute from root directory.

Common

Command Description
npm run ngxp-install Installs dependencies of web and nativescript applications. Creates symlink of x-shared folder in both web and nativescript project.

Web Application

Command Description
npm start Starts web application at http://localhost:4200
npm run start.prod Starts web application in production mode. Runs uglification and minification.
npm run start.aot Performs AOT for web application templates and starts web application.
npm run start.aot.prod Performs AOT, minification, uglification and starts web application.
npm run build Builds the web application and copy the built project in web/dist folder.
npm run build.prod Builds the web application in production mode and copy the built project in web/dist folder.
npm run build.aot Performs AOT, build the project and then copy the built project in web/dist folder.
npm run build.aot.prod Performs AOT, prepares production build and then copy the built project in web/dist folder.
npm test Runs web application and x-shared unit test cases. It will not generate code coverage report.
npm run test-cc Runs web application and x-shared unit test cases and generates code coverage report.

Nativescript Application

Command Description
npm run start.ios Runs application on iOS emulator/device
npm run start.android Runs application on Android emulator/device

FAQ

How to change package/bundle id for Android/iOS apps?

To change the package/bundle id you need to do changes in below files.

  1. nativescript/package.json
  • Change id property of nativescript object as follows:
"nativescript": {
    "id": "com.domain.yourapp"
}
  1. Open nativescript/app/App_Resources/Android/app.gradle file and change applicationId as shown below:
android {
  defaultConfig {
    ...
    applicationId = "com.domain.yourapp"
  }
  ...
}

How to change Android and iOS Application Display Name?

For Android, open nativescript/app/App_Resources/Android/values/strings.xml file and write your app name where Nativescript Angular Web Starter is written:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Nativescript Angular Web Starter</string>
    <string name="title_activity_kimera">Nativescript Angular Web Starter</string>
</resources>

For iOS, open nativescript/app/App_Resources/iOS/info.plist file and change value of CFBundleDisplayName and CFBundleName to your app name:

<dict>
  ...
  <key>CFBundleDisplayName</key>
	<string>Nativescript Angular Web Starter</string>
  <key>CFBundleName</key>
	<string>NativescriptAngularWebStarter</string>
  ...
</dict>

How to use angular dependencies from common node_modules folder. (Not tested properly yet!)

Currently you can see that for web project, angular modules are there as dependencies in common package.json and at web/package.json. So currently to update version of angular modules for web project, you need to update version at both of these package.json files. To avoid this, you can add path mapping in web project's tsconfig.json file as shown below:

web/src/tsconfig.json

"paths": {
  "@angular/*": ["../../node_modules/@angular/*"]
}

Once you add above configuration, the web project will try to find the @angular pacakges from common node_modules folder.

Attributes

  1. Angular Framework
  2. Nativescript Framework
  3. Nativescript Core Theme
  4. nativescript-swiss-army-knife
  5. tools/install.js from angular-advanced-seed

Awesome Contributors

Nathan Walker

Mathieu Brunot

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].