Code Monkey home page Code Monkey logo

cafu-tech's Introduction

cafu-tech

Designed a solution to decrease the contact rate in case of pilot-related incidents and delays the customer deliveries.

Architecture & Functionality

  • For high level ARCHITECTURE DIAGRAM refer Link
  • PILOT USER:
    • first we'll create the pilot user with PILOT role that consists of CREATE and READ permission module of AUDIO MESSAGE.
    • Then pilot user will login and then create the message and he'll be able to create the message due to CREATE permission of AUDIO MESSAGE module.
    • Message was created and dumped into the database with assignedTo field which is pilot driver id and name.
  • CUSTOMER USER:
    • first we'll create the customer user with CUSTOMER role that consists of READ permission only for module of AUDIO MESSAGE.
    • Then customer user will login with JWT and then on order we have driver assigned so we'll have the id or name and then lookup the message with read permission from message service. He/she can fetch message as many times as they can.
    • Customer will not be able to create the message because it doesnot have CREATE permission for AUDIO MESSSAGE module.

Tech and Modules Used

Nodejs, MongoDB, Joi, Swagger, Docker, AWS, JWT, Npm

Pre-requisites

  • Node.js > 10.x - Install node with nvm if not installed
  • npm - Install all the modules with npm i
  • Kill any process running on port 3012

Starting App

  • running app on the local environment
  • Run npm run start-local
  • On prod we'll be using docker

Folder Structure!

  • [config] - contains the config for different environments!.
  • [db] - contains the json for users, roles, message, modules etc...
  • [private] - all the common utils, server creation, common handler, error handler, logger are added in this which can later on moved to different repository
  • [src] - contains different folder and each folder can be convereted into microservice. $ cd src/service-name
    • [controllers] - api methods and Joi validations required for an api (req, res, next)
    • [dbQueryBuilder] - interacting with the database include common search, creation,updates
    • [handlers] - all the business logic
    • [helpers] - common methods used throught the service
    • [models] - database schema designing
    • [service] - contains the mapper objects
    • [vars] - variables declarations
  • [babe-start.sh]- neccessary commans for deployment on server

cafu-tech's People

Contributors

db-sc avatar

Watchers

James Cloos 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.