orizuru

by financialforcedev

GitHub Readme.md

Orizuru Sample App

Build Status

For Dreamforce '17, FinancialForce has been prototyping a Force-Heroku application with the aim of demonstrating the best features of both Force.com and Heroku.

We are part of two Dreamforce sessions in which we will share our experiences:

The latter includes a simple application, also available on GitHub, that contains the basic principles of the Force-Heroku architecture.

Orizuru aims to build upon these principles, making a more substantial step forward. This sample app implements the Orizuru framework to solve a real world business problem.

Use Case

The Problem

Our organization has invested in the Salesforce (Force.com) platform as it's CRM. We deliver paper products (copier paper, paper cups, gift wrapping, Orizuru Origami kits) to shops, schools, businesses and homes in the Bay area. We have multiple drivers to make deliveries.

Our problem is that we want to create efficient delivery routes - dividing our deliveries among our drivers in the most cost effective way - and make best use of the CRM capabilities of Force.com.

In essence, this is a generalization of the well known Travelling Salesman Problem (TSP): the Vehicle Routing Problem. A difficult problem to solve, which is potentially computationally demanding.

Architecture

Architecture

Implementation

Full details of the implementation can be found in the Implementation section of the Wiki.

Getting Started

To get started, follow the Getting Started steps in the Wiki.

Code Overview

This project builds upon the Orizuru framework, a Node.js library that streamlines strongly typed communication between Heroku dynos, and Force.com.

One of our requirements was that the project should be deployed from one GitHub repository, hence the src folder contains all the code.

The code has been structured in the following way:

  • src
    • apex
      • contains the Force.com application code that can be deployed via SFDX.
    • java
      • contains the Java code used within the Route Solver dyno.
    • node
      • contains the Node.js code used for the web and worker dynos.
      • This is further split into:
        • lib
          • the Node.js code that builds upon the Orizuru framework.
          • Each file in the root folder constructs a new dyno.
          • Each sub-folder contains the service files for the associated dyno.
          • The shared folder contains shared resources.
        • res
          • the resources for the Node.js code.
        • spec
          • the test files.