voznik / nx-workspace

Nx Workspace demo to share ngrx-based logic (state, action and reducers) between Ionic4 and Angular7 apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nx-based Angular7 web app and an Ionic4 mobile app

Introduction

This is a proof of concept that demonstrates the ability to share core functionalities and ngrx-based business logic between an Angular7 web app and an Ionic4 mobile app.

It is based on a Nx Workspace mono-repo project structure (from Nrwl.io Nx Extensions, an open source toolkit for enterprise Angular applications).

It is a fork with latest packages version & separate UI laibrary, based on benorama/ngrx-demo-workspace, so please check his Medium article Sharing (Ngrx-based) logic between Angular5 web app and Ionic3 mobile app for more info.

Screenshots

Web Mobile
Web Mobile

Goals:

  • encapsulate all the business logic in a core module, based on @ngrx/store,
  • keep specific view layout, markup and navigation logic in the app projects.

Note: @ngrx/store is a RxJS powered state management inspired by Redux for Angular apps. It's currently the most popular way to structure complex business logic in Angular apps.

Running the apps locally

# Clone the repo
git clone https://github.com/voznik/nx-workspace.git
# Install dependencies
npm install

Prerequisites, latest version of:

WARNING: in order to be able to support Ionic multi-app projects, you'll need the latest Ionic CLI (4.3.0+, with npm install -g ionic@latest) and latest NodeJS (v10+)

Web app

To run web app, we use the root Nx Project package and Angular CLI.

# Run the web app locally
ng serve web

Mobile app

To run mobile app, we use the mobile app Ionic package and Ionic CLI.

# from root folder
# Run the mobile app locally
ng serve mobile

Bugs and feedback

If you have any questions or suggestions to improve the demo app, don't hesitate to submit an issue or a pull request!


This project was generated with Angular CLI using Nrwl Nx.

About

Nx Workspace demo to share ngrx-based logic (state, action and reducers) between Ionic4 and Angular7 apps


Languages

Language:TypeScript 70.0%Language:HTML 14.1%Language:CSS 13.8%Language:JavaScript 2.1%