Git Product home page Git Product logo

ng-summit-redux's Introduction

#ng-summit-redux

Trendy Brunch Demo Application for Angular Summit

Get it: git clone https://github.com/e-schultz/ng-summit-redux.git

To start:

  • npm install
  • npm run start
  • open browser to localhost:3000/src

Slides from the Talk

TODO: Add Link

App Overview

To demonstrate reactive architecture using redux + ng-redux with Angular.

TrendyBrunch

Simple resturant application,

  • Reducer for Lineup - people waiting to be seated
  • Reducer for Tables - handles seated people, and their orders
  • Reducer for Menu - food items available, and what is in stock

General Idea:

  • parties of people can join/leave the line
  • parties get seated at tables
  • tables can take place orders - add/remove items from an order, then have it be submitted
  • UI is derived from the application data structure

Data Structure

[Resturant] --------- [Menu]
  |      |               
[Line]   |             
      [Tables]
         | 
         |
      [Order]

UI Overview

  • Lineup + Lineup Summary
  • Dining Room - Smart Component
    • Table - Dumb component
      • Can seat a party
      • Start an order
      • Pay the bill
      • Clean the table
    • Menu - Dumb component
      • Add item to order
      • Remove item from order
      • Place Order
  • Tabs for Orders
    • Pending Orders - orders that are activly being placed
      • No actions, render only
    • Completed Orders - orders that have been taken, and are now in the kitchen
      • Can add items to order
      • Can remove items from order
      • Can deliver the order

Lineup

Data

  • ID
  • number of people

Actions/Events

  • Join Line - PARTY_JOINED
  • Seat a party - PARTY_SEATED
  • Leave the line - PARTY_LEFT

Tables

Data

  • table ID
  • number of seats

Actions/Events --- simplify it so a table is either clean / dirty / occupied
--- events place order / pay bill / seat

  • seat customer
  • add items to order
  • remove items from order
  • submit order
  • request bill
  • pay bill + leave
  • clean table

Orders

  • table id
  • id
  • Order { key = menu item id, value = qty}

MenuItems

  • id
  • price
  • stock
  • description

Components

There are a few examples of components, smart/dumb components, containers in this application.

In the 'Orders' component, three versions are available showing different approaches.

In src/components/index.js you can switch between them by commenting out others and only bringing in the one that you want.

// import orders from './orders-v1'; 
// import orders from './orders-v2'; 
import orders from './orders-v3'; 

ng-summit-redux's People

Contributors

e-schultz avatar

Watchers

 avatar  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.