Skip to content

This outlines the project codebase for IS213 ESD - G5T7 - AY2021/2022 Semester 2

Notifications You must be signed in to change notification settings

juanjaho/IS213-driver-app

 
 

Repository files navigation


Logo

This outlines the project codebase for AY2021/2022 Semester 2 IS213 ESD - G5T7

Table of Contents
  1. About The Project
  2. Built With
  3. Getting Started
  4. Usage
  5. Scenario 1
  6. Scenario 2
  7. Scenario 3
  8. Container Orchestration
  9. Kubernetes Deployment
  10. Acknowledgments

About The Project

NinjaTruck aims to be the last mile delivery management solution for delivery drivers. The application covers the most essential features a delivery driver will need when carrying out their day to day responsibilities of delivering a parcel to customers.

Technical Diagrams

Logo Logo

(back to top)

Built With

Frontend

API Gateway

Backend

Message Brokers

DevOps

Deployment

External APIs used

(back to top)

Getting Started

Configuring Backend

Make sure you have a clean environment with no other containers as it can possibly conflict with this project’s ports mapping, image or container naming/labeling. Make sure that the Kong container and image is also deleted along with its network to set up a new kong configuration.

  1. From the directory ./IS213-driver-app, open the terminal and enter docker compose up
  2. Access http://localhost:1337 in a browser to create an admin user for Konga
Username: admin
Email:    <your email address>
Password: adminadmin
  1. Sign in to continue
  2. Connect Konga to Kong by creating a new connection
Name: default
Kong Admin URL: http://kong:8001
  1. Go to Snapshots located on bottom right of the sidebar
  2. Select IMPORT FROM FILE and import ./tools/kongSnapshot.json
  3. Click on DETAILS for the new snapshot created which ends with Ninjatruck
  4. Select RESTORE, tick all of the boxes, and click on IMPORT OBJECTS

(back to top)

Prerequisites

  • Docker - 20.10.13
  • Node - 16.13.0

Ensure you are running the same version by running the packages with --version in the terminal

(back to top)

Usage

  1. Open folder in vscode and open terminal
  2. Install required dependencies
  $ cd Frontend
  $ npm install
  1. Launch NinjaTruck Application
  $ quasar dev
  1. In browser, tap f12 to open console (as platform is only compatible for mobile)

(back to top)

Scenario 1

Driver logs in and views his dashboard

Logo
Logo

Additional Points

  1. KONG is used as our API Gateway mainly for security implementation. Kong keeps the internal microservices from being directly exposed to external clients. 3 Plugins was also used to configure Kong:
  • Kong’s Bot detection and rate limiting was used to prevent any bot attacks, DoS attack, and limit login attempts in case an attacker tries to brute force through the login.
  • Key-auth plugin was also used to add another layer of security by allowing only users with an api key belonging to Driver type consumer to access the microservices through kong.
  1. Driver microservice is coded in Java SpringBoot. This is to highlight that the microservices are language agnostic.
  2. To handle exceptions in business logic, Error handling is implemented if username or password is incorrect when logging in. User will be notified of the incorrect username or password

(back to top)

Scenario 2

Driver views map of all his parcels for delivery

Logo
Logo

(back to top)

Scenario 3

Driver completes a delivery of a parcel and marks it as either completed or failed

Logo
Logo

Additional Points

  1. Used Kafka as our message broker between Update Parcel Status and SMS microservice. Kafka is designed for holding and distributing large volumes of messages. Considering how there are hundreds of thousands of parcels delivered daily, kafka would be a good choice to handle the large amount of messages.
  2. Kafka uses their own custom kafka protocol.
  3. SMS microservice is built with Node.js. This is to highlight that the microservices are language agnostic.
  4. To handle exceptions in business logic, Error handling is implemented if delivery has not been fulfilled.

(back to top)

Container Orchestration

  • Each of the services in the red box represents a kubernetes pod containing our services.
  • Our Kong gateway acts as an entry point between the clients and our pods. With kubernetes, there is now the capability to scale our services easily.
  • With the use of either vertical or horizontal Pod Autoscaler, and their auto load-balancer, scaling through kubernetes is made much easier compared to load balancing and scaling in a pure docker environment.
Logo

(back to top)

Kubernetes Deployment

  • Utilized Tanzu Community edition to provision and set up our aws infrastructure, and deploy our Kubernetes management cluster onto an ec2 instance, which would contain our downloaded packages and tooling.
  • From there, we created our workload cluster to run in another ec2 instance which would contain our application. To monitor our workload cluster, we use octant which helps to display the lifecycle of our pods in the cluster and the logs.
Logo
Logo

(back to top)

Acknowledgments

(back to top)

About

This outlines the project codebase for IS213 ESD - G5T7 - AY2021/2022 Semester 2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 68.3%
  • JavaScript 14.3%
  • Java 11.7%
  • Dockerfile 5.7%