Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

angular-seed-advanced

> 前端框架
Open source

Advanced Angular seed project with support for ngrx/store, ngrx/effects, ngx-translate, angulartics2, lodash, NativeScript (*native* mobile), Electron (Mac, Win

2.2K stars0 likes0 views
WebsiteGitHub

About

Advanced Angular seed project with support for ngrx/store, ngrx/effects, ngx-translate, angulartics2, lodash, NativeScript (*native* mobile), Electron (Mac, Win

Please read this notice first before continuing.

This is an advanced seed project for Angular apps based on Minko Gechev's angular-seed that expands on all of its great features to include core support for:

Integration with:

  • ngrx/store RxJS powered state management, inspired by Redux
  • ngrx/effects Side effect model for @ngrx/store
  • ngx-translate for i18n
    • Usage is optional but on by default
    • Up to you and your team how you want to utilize it. It can be easily removed if not needed.
  • angulartics2 Vendor-agnostic analytics for Angular applications.
    • Out of box support for Segment
      • When using the seed, be sure to change your write_key here
    • Can be changed to any vendor, learn more here
  • lodash Helps reduce blocks of code down to single lines and enhances readability
  • NativeScript cross platform mobile (w/ native UI) apps. Setup instructions here.
  • Electron cross platform desktop apps (Mac, Windows and Linux). Setup instructions here.
The zen of multiple platforms. Chrome, Android and iPhone all running the same code.
Programming Nirvana. Mac and Windows desktop both running the same code.

Table of Contents

  • Prerequisites
  • How to start
  • How to start with AoT
  • Mobile app
  • Desktop app
  • Running tests
  • Web configuration options
  • Code organization overview
  • How-tos
  • General best practice guide to sharing code
  • Integration guides
  • How best to use for your project
  • Dockerization
    • How to build and start the dockerized version of the application
    • Development build and deployment
    • Production build and deployment
  • Contributing
  • License

Advice: If your project is intended to target a single platform (i.e, web only), then angular-seed is likely more than suitable for your needs. However if your project goals are to target multiple platforms (web, native mobile and native desktop), with powerful out of the box library support and highly configurable/flexible testing options, then you might want to keep reading.

Too Much?!: Don't worry it's ok, I completely understand. There is a simplified version of this seed which still allows web + mobile + desktop without the extra libraries and features like ngrx or analytics. Give this a shot: https://github.com/jlooper/angular-starter

It's built with a lot of the same structure found here so things work the same but is definitely easier to start with if just getting into multi-platform development.

Prerequisites

Note you should have node v6.5.0 or higher and npm 3.10.3 or higher.

  • To run the NativeScript app (currently supports 3.x):
bash
npm install -g nativescript

How to start

bash
# install the project's dependencies
$ npm install
# fast install (via Yarn, https://yarnpkg.com)
$ yarn install  # or yarn

# watches your files and uses livereload by default
$ npm start
# api document for the app
# npm run build.docs

# generate api documentation
$ npm run compodoc
$ npm run serve.compodoc

# to start deving with livereload site and coverage as well as continuous testing
$ npm run start.deving

# dev build
$ npm run build.dev
# prod build
$ npm run build.prod

How to start with AoT

Note that AoT compilation requires node v6.5.0 or higher and npm 3.10.3 or higher.

In order to start the seed with AoT use:

bash
# prod build with AoT compilation, will output the production application in `dist/prod`
# the produced code can be deployed (rsynced) to a remote server
$ npm run build.prod.aot

Mobile app

The mobile app is provided via NativeScript, an open source framework for building truly native mobile apps.

Setup

bash
npm install -g nativescript 

Dev Workflow

You can make changes to files in src/client/app or nativescript/src/app folders. A symbolic link exists between the web src/client/app and the nativescript/src/app folder so changes in either location are mirrored because they are the same directory inside.

Create .tns.html and .tns.scss NativeScript view files for every web component view file you have. You will see an example of the app.component.html as a NativeScript view file here.

The root module for the mobile app is nativescript/src/native.module.ts: NativeModule.

Run

iOS:                      npm run start.ios   
iOS (device):             npm run start.ios.device

// or...

Android:                      npm run start.android
Android (device):             npm run start.android.device
  • Requires an image setup via AVD Manager. Learn more here and here.

OR...

  • GenyMotion Android Emulator
Building with Webpack for release builds

Create AoT builds for deployment to App Store and Google Play.

Android:   npm run build.android
iOS:       npm run build.ios

Desktop app

The desktop app is provided via Electron, cross platform desktop apps with JavaScript, HTML, and CSS.

Develop

Mac:      npm run start.desktop
Windows:  npm run start.desktop.windows

Develop with livesync

Mac:      npm run start.livesync.desktop
Windows:  npm run start.livesync.desktop.windows

Release: Package Electron App for Mac, Windows or Linux

Mac:      npm run build.desktop.mac
Windows:  npm run build.desktop.windows
Linux:    npm run build.desktop.linux

Running tests

…

You can learn more about Protractor Interactive Mode here

Web configuration options

Default application server configuration

javascript
var PORT             = 5555;
var LIVE_RELOAD_PORT = 4002;
var DOCS_PORT        = 4003;
var APP_BASE         = '/';

Configure at runtime

bash
npm start -- --port 8080 --reload-port 4000 --base /my-app/

Environment configuration

If you have different environments and you need to configure them to use different end points, settings, etc. you can use the files dev.ts or prod.ts in./tools/env/. The name of the file is environment you want to use.

The environment can be specified by using:

bash
$ npm start -- --env-config ENV_NAME

Currently the ENV_NAMEs are dev, prod, staging, but you can simply add a different file "ENV_NAME.ts". file in order to alter extra such environments.

Tools documentation

A documentation of the provided tools can be found in tools/README.md.

Code organization overview

  • nativescript: Root of this directory is reserved for mobile app.
    • src: mobile app src.
      • app: Symbolic link of shared code from web app.
      • App_Resources: iOS and Android platform specific config files and images.
      • mobile: Mobile specific services, etc. Build out mobile specific services here as well as overrides for web services that need to be provided for in the mobile app. Safe to import {N} modules here.
      • native.module.ts: Root module for the mobile app provided by NativeScript. Override/provide native mobile implementations of services here.
  • src/client: Root of this directory is reserved for web and desktop.
    • app: All the code in this directory is shared with the mobile app via a symbolic link.
      • components: Reserved for primary routing components. Since each app usually has it's own set of unique routes, you can provide the app's primary routing components here.
      • shared: Shared code across all platforms. Reusable sub components, services, utilities, etc.
        • analytics: Provides services for analytics. Out of the box, Segment is configured.
        • core: Low level services. Foundational layer.
        • electron: Services specific to electron integration. Could be refactored out in the future since this is not needed to be shared with the mobile app.
        • i18n: Various localization features.
        • ngrx: Central ngrx coordination. Brings together state from any other feature modules etc. to setup the initial app state.
        • sample: Just a sample module pre-configured with a scalable ngrx setup.
        • test: Testing utilities. This could be refactored into a different location in the future.
    • assets: Various locale files, images and other assets the app needs to load.
    • css: List of the main style files to be created via the SASS compilation (enabled by default).
    • scss: Partial SASS files - reserved for things like _variables.scss and other imported partials for styling.
    • index.html: The index file for the web and desktop app (which share the same setup).
    • main.desktop.ts: The file used by Electron to start the desktop app.
    • main.web.prod.ts: Bootstraps the AoT web build. Generally won't modify anything here
    • main.web.ts: Bootstraps the development web build. Generally won't modify anything here
    • package.json: Used by Electron to start the desktop app.
    • system-config.ts: This loads the SystemJS configuration defined here and extended in your own app's customized project.config.ts.
    • tsconfig.json: Used by compodoc - The missing documentation tool for your Angular application - to generate api docs for your code.
    • web.module.ts: The root module for the web and desktop app.
  • src/e2e: Integration/end-to-end tests for the web app.

How-tos

i18n

  • how to add a lang

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptandroidangularangulartics2aot

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架