All Projects → bobbui → order-management

bobbui / order-management

Licence: Apache-2.0 license
Simple Order Management web application built using NodeJS, ExpressJS, Polymer, MongoDB

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to order-management

xkcd-img
Custom Polymer element for displaying random images from XKCD!
Stars: ✭ 12 (-63.64%)
Mutual labels:  polymer
ak-cli
🔖 Collection of useful cli commands
Stars: ✭ 39 (+18.18%)
Mutual labels:  heroku
odooku
Run Odoo as a service
Stars: ✭ 52 (+57.58%)
Mutual labels:  heroku
TGInlineGIF
Telegram Inline tenor gif search bot.
Stars: ✭ 19 (-42.42%)
Mutual labels:  heroku
police-cad
This is a easy to setup and use police server CAD. Includes a signup/login for both Civilians and Police Officers. Also this is mobile friendly. Built for GTA V's Modding framework: FiveM.
Stars: ✭ 49 (+48.48%)
Mutual labels:  heroku
travel app
Travel App using Flutter 💙
Stars: ✭ 74 (+124.24%)
Mutual labels:  heroku
PokerTexter
SMS App for Poker Odds. Runs on Flask + Twilio + Heroku.
Stars: ✭ 17 (-48.48%)
Mutual labels:  heroku
Google Translater V2
Google Translater v2
Stars: ✭ 30 (-9.09%)
Mutual labels:  heroku
chat-window
A simple and flexible chat window for listing messages.
Stars: ✭ 27 (-18.18%)
Mutual labels:  polymer
polymer-2-carousel
Codelab
Stars: ✭ 18 (-45.45%)
Mutual labels:  polymer
react-phoenix-users-boilerplate
Elixir/Phoenix + React + users template/boilerplate.
Stars: ✭ 71 (+115.15%)
Mutual labels:  heroku
paper-weather
☀️🌧 Material design weather element inspired by google weather
Stars: ✭ 14 (-57.58%)
Mutual labels:  polymer
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (-6.06%)
Mutual labels:  polymer
Malicious-Urlv5
A multi-layered and multi-tiered Machine Learning security solution, it supports always on detection system, Django REST framework used, equipped with a web-browser extension that uses a REST API call.
Stars: ✭ 35 (+6.06%)
Mutual labels:  heroku
Covid-19-API
A realtime API for coronavirus cases on Heroku. Data automatically updated every 10 minutes!
Stars: ✭ 59 (+78.79%)
Mutual labels:  heroku
heroku-cli-oauth
this code is now in https://github.com/heroku/cli
Stars: ✭ 40 (+21.21%)
Mutual labels:  heroku
heroku-local
this code is now in https://github.com/heroku/cli
Stars: ✭ 21 (-36.36%)
Mutual labels:  heroku
heroku-deploy
A simple action to build, push and deploy your dockerized app to your Heroku Application
Stars: ✭ 40 (+21.21%)
Mutual labels:  heroku
heroku-wordpress
Template project for deploying WordPress 5.7.2 to Heroku
Stars: ✭ 49 (+48.48%)
Mutual labels:  heroku
nuxeo-elements
Nuxeo web components
Stars: ✭ 23 (-30.3%)
Mutual labels:  polymer

Overview

Toy project to play with Polymer

Tech stack:

  • Frontend: Polymer, Lodash
  • Backend: Node.js, ExpressJS, Mongoose
  • Database: MongoDB

Deployment

Application

Assumption

I assumed that an order only contains one type of drink.

##Source code structure

  • Back-end
    • routes/rest.js: main back-end file, communicate with database and expose data/functionality to frontend via JSON RESTful web service.
  • Front-end
    • public/index.html: application’s main page
    • public/add-order-form.html: custom element for adding new order.
    • public/all-orders.html: custom element for tracking all orders.
    • public/shared-styles.html: shared styles and custom SVG icon set.

Data model

Database includes two following collections:

  • Drinks: contains information for all drinks type
{
"type" : <drink type>,
"name" : <drink name>,
"size" : <drink size>,
"price" : <drink price>
}
  • Orders: contains information for all orders:
{
"type" : <drink type>	,
"name" : <drink name>,
"size" : <drink size>,
"price" : <drink price>,
"quantity" : <quantity>,
"amount" : <total amount>,
"time" : <order date>,
}

Main requirement

0) Adding orders

  • Add new order on desktop alt text
  • Add new order on mobile

1)Keep track of all orders (total sales)

All orders are displayed in a table, default sorted by order time in descending order. Date time is in UTC, not local time.

  • View all orders on desktop: alt text

  • View all orders on mobile:

2) Group orders by type of orders (coffee or tea)

Using “filter by type” to group order by drinks’ type: coffee or/and tea

alt text

3) Group orders by type of size (tall, grande or venti)

Using “filter by size” to group order by drinks’ size: tall, grande and/or venti

alt text

Additional question

0) What if we want a new type of coffee, a new type of tea?

A new type of drink can be easily added from the database. Front-end is implemented in a way that dynamically read all drink type and display on UI. For example, I added following a new drink type “Americano”:

{
	"size" : "Tall",
	"price" : "1.98",
	"name" : "Americano",
	"type" : "Coffee"
}

alt text

1) What if we want a new size?

New size can be added in the same way as adding new drink type except we need to add CSS code for new drink size. CSS can be added to add-order-form.html file as follow:

iron-icon.<name of new size> {
    height: <desired height which is relative to other sizes>;
    width: <desired width which is relative to other sizes >;
}

For example: I add a “Mini” size for “Cappuccino” into database:

{
	"size" : "Mini",
	"price" : "2.75",
	"name" : "Cappuccino",
	"type" : "Coffee"
}

And as new CSS to add-order-form.html file as follow

iron-icon.Mini {
    height: 24px;
    width: 24px;
}

alt text

2) How would you change the model to add hot/cold options?

Add hot/cold will require adding a new property in drink model. On the frontend, we also need to add a new input field such as radio button group for users to select the hot/cold option.

3) (optional) How would you change the model to support adding condiments to drinks (perl, grass jelly,...)

We can follow either of two below methods to support condiments:

  • First method: We will treat condiments just like properties of drink same as adding hot/cold options. We will need to add a new property to the database and add new input field on the front end. This way is simple to implement but may create a large number of drinks result from combinations of multiple drinks with multiple condiments.
  • Second method: we will treat condiment as separate items that have their own price. They will be ordered separately from drinks. Order total amount will be the sum of drink amount and condiments amount. We will need to add separate condiments section to add order screen. This method requires considerable effort on front-end side but will eliminate the complexity of management of a large number of drinks like the first method.
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].