Replenishing stock is one of the most important repetitive tasks performed by a retailer, yet for majority of the retail world this process is highly inefficient and time consuming. We've created a (first of its kind) open-source and free iPad application that makes the stock ordering process fast and fun, and frees up a whole lot of time for st…
Switch branches/tags
bug_fix_excel_import bug_fix_sku_receive_purva develop developV2 dismiss_ipad_native_keyboard excel_cornercase_fix excel_import_fixes feature/add-aws-worker feature/add-es-connector feature/add-notifications feature/add-security-for-multi-tenancy feature/addProductRow feature/bhushan/cli-tool feature/bug_fix_dismiss_edit_box feature/bug_fix_for_filename feature/bug_fix_virtual_keyboard_ipad feature/bugFixForWarehouseUI feature/bugFixkeyboard feature/case_quantity_fix feature/clarion-gruntfile feature/cleanup1 feature/codeship feature/comments feature/detect_device feature/excel_file_part2 feature/fix_207 feature/getStockOrderDataFrombackend feature/google-cloud-platform feature/harshad/docker-tweaks feature/harshad/improve-local feature/harshad/upgradeCircleCI feature/import_csv feature/issue_4 feature/issue_13 feature/issue_22 feature/issue_33 feature/issue_59 feature/issue_66 feature/issue_68 feature/issue_72 feature/issue_75 feature/issue_77 feature/issue_89 feature/issue_90 feature/issue_91 feature/issue_107 feature/issue_110 feature/issue_117 feature/issue_120 feature/issue_121 feature/issue_122 feature/issue_128 feature/issue_130 feature/issue_131 feature/issue_132 feature/issue_138 feature/issue_144 feature/issue_151 feature/issue_160 feature/issue_184 feature/kamal/angular2-sdk feature/kamal/bin-locations-sorting-and-grouping feature/kamal/e2e-setup feature/kamal/fix_submodule-1 feature/kamal/msd-sync feature/kamal/patricias-mailing-orders-2 feature/kamal/remove-ffcc feature/kamal/signup-flow feature/kamal/update-lb-sdk feature/kamal/update-readme-with-architecture feature/keep_virtual_keyboard_only_for_comments feature/kue_support feature/logWithDebug feature/login_bug_fix feature/minxins feature/mongodb feature/mottie_virtual_keyboard feature/pulkit/healthcheck feature/pulkit/improve-docs-and-automation-1 feature/pulkit/improve-docs-and-automation-2 feature/pulkit/issue-267 feature/pulkit/newRelic feature/pulkit/upgrade-to-node-6 feature/pulkit_use_docker feature/release_script_fix feature/remove/terraform feature/removeVirtualKeyboard feature/seedUsers feature/set-eslint-as-default feature/shoppinpal_warehouse_ui feature/store-workflow feature/submitManagerReportToWarehouse feature/submitWarehouseReportToReceiver feature/unpackAndClose feature/uploadFilesForProcessing feature/use-sqs feature/usePhasesForMiddleware feature/wireReportKickoff feature/yogesh/log-sqs-messageId feature/yogesh/notifier-service-intregation feature/yogesh/terraform hotfix/v1.3.2 hotfix/v1.4.2 hotfix/v1.4.7 introduceWorkers master path_hardcoding_removal pulkitsinghal-patch-1 pulkitsinghal-patch-2 quick-setup release/v1.1.1 release/v1.2.6 release/v1.3.2 release/v1.4.0 release/v.1.4.1 release/v1.4.3 release/v1.5 release/v1.5.1 release/v1.5.7 setup status_check_ui_fix update/yogesh/dev-entrypoint-permission upgrade-aws-sdk upgrade_npm_packages yogesh/feature/sp-json-logger
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
admin Supplier email and storeIds in admin panel Nov 20, 2018
client/app
common Mail should contain PDF alongwith CSV Dec 17, 2018
docs
e2e
questions
scripts
server
terraform
workers
.bowerrc
.dockerignore
.editorconfig
.env.example
.gitignore Create csv from JSON and mail to the specified email address Nov 14, 2018
.jshintrc
.npmignore
CHANGELOG.txt
Dockerfile
Dockerfile-dev Separate dockerfiles for dev and production environment Nov 20, 2017
Dockerfile.admin
Gruntfile.js
LICENSE
README.md Deployment architecture in readme (#294) Jul 12, 2018
bower.json
conf.js tweak timeouts Jul 29, 2015
conf.js.browsers
dev-entrypoint.sh
docker-compose.yml
docker-entrypoint.sh remove command hardcheck in entrypoint Feb 7, 2018
getenv.js
nginx.warehouse.conf Routing requests received base_url/v2/ to port 4200 Nov 24, 2017
npm-shrinkwrap.json
package.json
spec.js better labels and naming issue #179 Oct 10, 2015
wait-for improve warehouse docs and scripts so it runs out-of-the-box for devs Jul 18, 2017
worker.env.example env example files (.env, worker.env) cleanup and terraform readme upd… Nov 16, 2017

README.md

Warehouse

Replenishing stock is one of the most important repetitive tasks performed by a retailer, yet for majority of the retail world this process is highly inefficient and time consuming. We've created a (first of its kind) open-source and free iPad application that makes the stock ordering process fast and fun, and frees up a whole lot of time for store managers and warehouse folks. To top it off, this app works beautifully with your inventory and POS! Just let us know which system(s) you use and we can add the integration.

Gitter

Pre-requisites

Deployment Architecture

The deployment consists of the following key components (few aspects have been left out for the the sake of brevity).

alt text

LoopBack (LB) Node Cluster

  • LoopBack Node cluster is the frontend (responsive web app) for Warehouse used by the store and fulfillment center staff.
  • This module only accept inputs and displays the results to the end user, while the heavy lifting is performed by the worker cluster.
  • The LB cluster will be deployed in a fashion so that it will scale based on resources utilized on server as traffic increases towards the application. Auto-scaling can also help in mitigating some low scale attacks that happen on web applications generally.

Worker Node Cluster

  • Worker Node Cluster will perform all heavy operations such as communicating with POS/ERP APIs and updating the database. As this is the backend cluster and has to communicate with POS/ERP APIs as well as the Database, it will be hidden and within a secure environment. Standard measures for security like IP whitelisting will be used to allow access from specific nodes.

Database

  • Warehouse uses MongoDB as the database. This will be deployed in a private cluster where only the Worker and LoopBack nodes can communicate with it. Here you have the option of using a hosted service such as MongoLab or setting up Mongo within your environment.

Security measures

  • User traffic can be filtered with Firewalls such as Apigee or CloudFlare (or any others currently being used in your environment) to prevent malicious traffic.
  • All traffic exclusively over HTTPS.

Deploy

  1. On remote machine with Docker while editing locally
  2. Locally (not recommended)

Troubleshooting

  1. To start and troubleshoot a docker image:

    ##
    # docker-compose run <service_name> /bin/bash
    ##
    docker-compose run web /bin/bash
    
  2. To attach to a running container and troubleshoot:

    ##
    # docker-compose exec <service_name> /bin/bash
    ##
    docker-compose exec web /bin/bash
    
  3. If builds keep failing and it makes no-sence, maybe cleanup is required, try:

    docker system prune
    
    # either:
    docker-compose up -d --build --force-recreate
    # or:
    docker-compose up --build --force-recreate
    
  4. If you performed a regular clone instead of a recursive clone, then correct this using the follwing command to get the submodules:

    cd $WAREHOUSE_HOME && git submodule update --init --recursive
    

FAQs

  • What is the difference between docker-compose.local.yml and docker-compose.yml?
    • The docker-compose.local.yml file is a close mirror of docker-compose.yml with a few small differences to ease the life of developers when developing or torubleshooting.
  • How should we install dependencies based on the projects's nodejs version?
    • If you are performing this BEFORE the Dockerfile build, where the following command runs: RUN mv /apps/warehouse/node_modules /apps/node_modules, then use:

      docker-compose run nodejs node --version
      docker-compose run nodejs npm install
      
    • If you are performing this AFTER the Dockerfile build, where the following command runs: RUN mv /apps/warehouse/node_modules /apps/node_modules, then use:

      docker-compose run nodejs node --version
      docker-compose run nodejs npm --prefix /apps/warehouse install
      
  • How should we add NEW dependencies based on the projects's nodejs version?
    • If you are performing this BEFORE the Dockerfile build, where the following command runs: RUN mv /apps/warehouse/node_modules /apps/node_modules, then use:
      docker-compose run nodejs npm install --save-dev --save-exact <someNewModule>
      docker-compose run nodejs npm install --save --save-exact <someNewModule>
      
      # NOTE: If you add a new module then please
      #       make sure to shrinkwrap it using:
      #       docker-compose run nodejs npm shrinkwrap
      
    • If you are performing this AFTER the Dockerfile build, where the following command runs: RUN mv /apps/warehouse/node_modules /apps/node_modules, then use:
      docker-compose run nodejs npm install --prefix /apps/warehouse --save-dev --save-exact <someNewModule>
      docker-compose run nodejs npm install --prefix /apps/warehouse --save --save-exact <someNewModule>
      
      # NOTE: If you add a new module then please
      #       make sure to shrinkwrap it using:
      #       docker-compose run nodejs npm shrinkwrap
      

Remote Dev Machine

  1. Setup dropbox on local machine

  2. Setup dropbox on remote machine

  3. Create a directory on your local machine to house any and all projects meant for remote development: mkdir -p ~/Dropbox/rDev

  4. Go to the directory where you cloned warehouse locally, for example: cd ~/dev/warehouse

  5. Then wire it up to your local Dropbox folder:

    ln -s `pwd` ~/Dropbox/rDev/warehouse
    
  6. When you check the status on your remote machine/droplet via your ssh terminal: ~/bin/dropbox.py status ... you will see that the sync has begun:

    ~/bin/dropbox.py status
    Syncing (239 files remaining)
    Downloading 239 files...
    
  7. From now on whenever you work on your remote machine/droplet via your ssh terminal ... switch to the directory that has the sync enabled: cd ~/Dropbox/rDev/warehouse/ to do your work.

    • prevent remote machine from syncing unnecessary stuff to dropbox:

      cd ~/Dropbox && dropbox exclude add rDev/warehouse/node_modules
      cd ~/Dropbox && dropbox exclude add rDev/warehouse/client/app/bower_components
      cd ~/Dropbox && dropbox exclude add rDev/warehouse-workers/node_modules
      
  8. On your local machine use selective sync via the dropbox UI to prevent the transfer of bulky dependencies back to your local filesystem. Go ahead and exclude node_modules and bower_components etc from being synced back to your machine. This is all done via UI so it should be very easy.

    • dropbox > preferences > account > selective sync > change settings...