Skip to content

anlowee/vguardbft

 
 

Repository files navigation

V-Guard applied in SCM (Supply Chain Management) system.

Contributors: Dixi Yao, Kai Shen, Xiaochong Wei

Introduction

Supply chains move products/services from origin to consumer through sourcing, manufacturing, packaging, transportation, and distribution. The tracking of goods and services is critical to identify bottlenecks and inefficiencies, ensure timely delivery, maintain customer satisfaction, improve security, and comply with regulations. By monitoring the movement of products or services, companies can optimize their operations, mitigate potential risks such as theft or fraud, and gain valuable insights into their supply chain.

We propose a solution for tracking goods and services in supply chain system by using V-Guard, which is designed for V2X network and can fit well for supply chain since trucks are main transportation power of the system.

Features

Viechle visualization

We use google map to visualize the viechle's location and route, also mark the location of each participant in the supply chain. Viechle visualization When you click the marker of a viechle, you can see the detail information of the viechle at the bottom of the page, including:

  • Cargo ID: the index of the cargo.
  • Cargo type: the type of the cargo the truck is carrying.
  • Cargo amount: the amount of the cargo the truck is carrying.
  • From: the location where the truck is from.
  • To: the location where the truck is going to.
  • Progress: the progress of the truck's route.
  • Is booked: whether the truck is booked for the next shippment.

This can help the participants to know better the location of the truck and the progress of the truck's route.

Database dashboard

Here is the database dashboard page: Database dashboard

  • All Items in DB shows all the items in the database in real-time.
  • Add Item supports cargo item addition for all inputs, and then it will refresh the All Items in DB panel.
  • Delete Item will delete cargo item based on the cargo ID, and then refresh the All Items in DB panel.

Database backend

We provide a database backend in the infrastructure layer to support the data collection for V-Guard. The database is developed on the basis of the sqlite3. It is developed in the dpapi.py and the whole database is named vguard.db.

For the V-Guard, we provide two interfaces through the database and the V-Guard to support managing transactions from moving temporary storage to the permanent storage, and deleting from the permanent storage. The related information of the transactions are stored in the TABLE Tx and we can use the class DB_hanlder to manage transactions between the V-Guard and database. Functions MoveToPerm and DeletePerm correspond to the sm.MoveToPerm(&tx) and sm.DeletPerm(&tx) interfaces in V-Guard.

Besides this, we also developed an interface for managing detailed information about each transaction, which is the information of each cargo in our setting. It is stored in the TABLE cargo. The detailed attributes include

  • ID: A unique ID which is used as KEY in the table.
  • CargoType: The type of the cargo.
  • CargoAmount: The amount of the cargo, which is an integer.
  • FromAddr: The address where the cargo is sent out.
  • ToAddr: The address where ther cargo is sent to.
  • BoothIndex: The booth index where the current transaction of the cargo is stored.
  • Distance: The distance the cargo will go through.
  • Progress: Approximately how much distance the cargo has gone through.
  • ETA: A timestamp for when the cargo set out.
  • IsBooked: A boolean value indicating whether the cargo is booked. For the cargos, we provide the interface including adding cargo, deleting cargo, modifying cargo information and query related information about existing cargos.

We also support the database by adding a Flask server so that the frontend can interact with the database and V-Guard through these APIs we developed.

Quick Start

For the backend, you can follow these steps to run the database:

  • create a new conda environment: conda create --name ece1770 python=3.9
  • activate the environment: conda activate ece1770
  • install required packages: pip install -r requirements.txt
  • run the database: python dbapi.py

For frontend, you can follow these steps to run the project:

  • Enter the frontend directory: cd web
  • Install dependencies: npm install
  • Run the project: npm start, then you can visit the project at http://localhost:3000

About

1770 course project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 60.9%
  • JavaScript 20.4%
  • Python 12.3%
  • CSS 4.0%
  • HTML 1.8%
  • Shell 0.6%