Git Product home page Git Product logo

portfolio's Introduction

Portfolio

Bits and pieces of the Craft Delivery stack

React Native Helper

I came up with this helper while developing the driver dispatcher app

Expo.js apps using a localhost backend over ngrok

React Native Dispatch App

dispatcher folder is very much a work in progress

This project was a chance to try out redux-toolkit

  • State is kept in slices instead of combining reducers
  • Uses Immer
    • no need to use destructuring or worry about mutating state

The main purpose of this app at the moment is to track driver position for use in an Uber style delivery map

TODO features:

  • log location to DynamoDB instead of pg
    • websocket implementation is in Lambda/DynamoDB/CloudFront
    • we don't want to connect to pg from here if we can avoid it
  • dispatch override
    • a human may decide to route orders manually
  • image uploading
  • order checklist
  • order modification
  • canned messages to customer
    • broadcast or targeted
  • order history / queue
  • pay history
  • admin chat

Lambda

These projects are kept as separate git repos in AWS Code Commit. The main Craft Delivery ExpressJS app calls these functions using axios

Rationale

The Craft Delivery ExpressJS app was getting too big to manage with so many dependencies. I decided to spin out some of the bigger chunks to AWS Lambda

AWS and Twilio are huge dependencies and its nice to have these separate from the ExpressJS app

The Stripe library is still needed to sign incoming webhooks

No Database connection

Charger, Mailer and Texter do not connect to the postgres database. This is done for security purposes as well as to minimize open connections. Database relevant feedback is provided via webhook

Webhook init

See index-express.js for how the express app handles incoming webhooks

Projects

express-js folders contain support code from the ExpressJS monolith

  • Charger: Serverless Stripe handling
    • Express Webhook Handling:
      • Incoming payload must be signed
        • verifysig.js
      • We write the incoming response to a table
        • this is then picked up later by via pg-notify
          • event type determines which handler deals the the payload
        • events.js: a list of supported events
        • see index-express.js for pg-notify setup
  • Mailer: Serverless Email Sender
    • it accepts pre-formed HTML
    • next steps will be to move more code / dependencies to Lambda
    • express app send flow:
      • all emails are given an email type
        • we set ReturnPath to {emailType}@craftdelivery.ca
        • ReturnPath is returned in the webhook
          • pardon the dirty hack
        • This way we can categorize the aws notifications by email type
      • USER emails
        • generate html using genmail.js
        • depends on mail.js
      • ADMIN/DEV emails
      • send using sessend.js
        • calls lambda with preformed HTML
  • Texter: Serverless Twilio SMS

portfolio's People

Contributors

craftdelivery avatar

Watchers

 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.