Code Monkey home page Code Monkey logo

ngrx-realtime-app's Introduction

Introduction

This is a proof of concept that demonstrates the ability to build a realtime app with an Angular web client (powered by a Ngrx data architecture) and a Vert.x server.

Please check the Medium article Building a realtime web app with Angular/Ngrx and Vert.x for more info.

Goals

  • share and synchronize a common (Ngrx-based) state between multiple connected clients,
  • distribute in realtime (Ngrx-based) actions across multiple connected clients (which impact local states/reducers).

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.

Demo

For the demo, the app uses a simple counter example, with increment, decrement and reset actions.

Demo

Running the apps locally

# Clone the repo
git clone https://github.com/benorama/ngrx-realtime-app.git

Prerequisites:

Vertx server app

First, compile and run Vertx app locally.

# Go into core module directory
cd ngrx-realtime-app/server

# Build project
./gradlew shadowJar
# Or gradle shadowJar if you have Gradle installed locally

# Run the server app locally
java -jar build/libs/server-1.0.1-fat.jar

Angular client app

# Go into Angular app directory
cd ../client

# Install dependencies (you can get a burger...)
npm install
# Or yarn

# Run the client app locally
ng serve

To test the app:

  • open the client app in two separate browser windows,
  • login with 2 different user names,
  • increment/decrement/reset counter

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!

ngrx-realtime-app's People

Contributors

benorama avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.