jajukajulz / tendersubmissionregistry

Ethereum dApp for for tracing tender document submissions on Blockchain.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tender Submission Registry

Tender Submission Registry (TSR) is a Blockchain powered (Ethereum DApp) procurement platform for tracing tender document submissions. TSR is used to Digitally sign tender documents (in zip format) at submission time and Verify authenticity of submissions during tender vetting process.

Online version available at https://tendersubmissionregistry.herokuapp.com/

Alt text

User Stories

Company A publishes a tender for services that they require. Company B is a service provider that can render the services that Company A requires. Company B gathers the required documentation to submit a formal and legal tender application (i.e. application to render the services required for a fee). The Tender Officer at Company B is responsible for submitting the required tender documents as a single zip file via the web app. Company B Tender Officer logs into the Tender Submission Registry (TSR) web app. They upload the ZIP file to the app, as well as corresponding details such as Name, Surname and the Tender that Company B is bidding for.

The TSR app processes the Company B submission i.e. hash of the ZIP file (SHA256), Submitter Name & Surname, Submitter ID, Company B Supplier ID and the Tender being applied for. This data is stored on the blockchain. The ZIP file itself can be stored on Company A's fileserver / local network.

An administrator at Company A can then at the time of vetting the tender applications then re-upload the files to verify that they have not been tampered with whilst stored on the Company A network. In addition, by verifying the ZIP file submissions, Compnay A can also confirm that the Tender Applications were made on time and not after the expiry date.

TSR helps to prevent fraud by both companies applying for tenders as well as employees working for the compnay that has put out the tender.

As such, TSR has 3 main use cases:

  • Confirm timely submission of required tender documents

    • Confirm Tender Documents are submitted before bid close datetime.
  • Track submission of tender documents

    • Easily track who submitted a Tender Document pack (ZIP file). Details include Name, Surname and ID of individual of submitted the documents on behalf of the supplier company.
  • Confirm authenticity of Tender Document pack (ZIP file)

    • At the time of vetting/reviewing tender applications and corresponding document packs (ZIP files), TSR can be used to confirm that the ZIP files that the tender issuing company has on record have not been tampered with post online submission.

Documentation

Additional documentation in the following files:

Installation (Development Environment)

In order to run TSR, an environment with the following is required:

  • Node.js
  • Truffle Framework
  • Web3.js
  • Bootstrap
  • MetaMask (MetaMask is an extension for accessing Ethereum enabled distributed applications, or "Dapps" in your browser! The extension injects the Ethereum web3 API into every website's javascript context, so that dapps can read from the blockchain.)
  1. Install Truffle globally. Truffle is the most popular smart contract development, testing, and deployment framework.
$npm install -g truffle 
  1. Install node dependencies.
$npm install
  1. Start Ganache and Create a Workspace (or open an existing one).

  2. Confirm TenderRegistry smart contract compiles successfully.

$truffle compile

If compile fails because .secret does not exist, you will need to create a Wallet (e.g. using MetaMask) and store the seed phrase/mnemonic in a .secret file in your project root. Make sure the .secret is gitignored!

  1. Run tests for TenderRegistry smart contract.
$truffe test
$truffle test --network development
  1. Deploy TenderRegistry smart contract to Ganache (assumes Ganache is running).

truffle migrate will run all migrations located within your project's migrations directory. If your migrations were previously run successfully, truffle migrate will start execution from the last migration that was run, running only newly created migrations. If no new migrations exists, truffle migrate won't perform any action at all.

$truffle migrate

The --reset flag will force to run all your migrations scripts again. Compiling if some of the contracts have changed. You have to pay gas for the whole migration again.

$truffle migrate --reset

The --all flag will force to recompile all your contracts. Even if they didn't change. It is more time compiling all your contracts, and after that it will have to run all your deploying scripts again.

$truffle migrate --compile-all --reset

If for some reason truffle fails to acknowledge a contract was modified and will not compile it again, delete the build/ directory. This will force a recompilation of all your contracts and running all your deploy scripts again.

  1. Update truffle-config.js development network with NetworkID, Host and Port values from your local Blockchain in Ganache.

  2. Optionally, you can create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example

APP_ENV=staging
APP_NAME=custom environment app
DB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3

You can then access the variables in your code using process.env e.g. console.log(process.env.APP_ENV)

  1. Start the web server (Express) and navigate to http://localhost:3000/ in your browser.
$npm run dev

Other

  1. To run all tests
$ truffle test
  1. Access deployed contract from CLI
$ truffle console
$ CONTRACTNAME.deployed().then(function(instance) { app = instance })
$ app.CONTRACTFUNCTION()
  1. Add a new migration
$touch 2_deploy_contract.js
  1. Create infura project at https://infura.io (Infura gives you access to test network). This project will give you an ID that you will use in truffle-config.js infura means you do not have to sync an ether node or ropsten node to deploy directly.

  2. Get test ether from https://faucet.ropsten.be/ (you will need to create an Ethereum ropsten account on MetaMask then use the address on the faucet). e.g. 0x4B67D20a4F27d248aF0462C23F8C193f073517FB

  3. Update truffle-config.js with ropsten. This will deploy from the metamask accounts, by default account 0 so specify which one you want.

  4. Deploy to ropsten.

$truffle migrate --network ropsten --compile-all --reset
  1. Check contract on ropsten etherscan https://ropsten.etherscan.io/address/0x650168110ADa1f089D443904c6759b7349576A0d

Production Deployment

  1. To deploy to a production server there is no need to first bundle and uglify then deploy
$npm run start

Supported Browsers

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
IE11, Edge Supported Supported Supported Supported Supported Supported

About

Ethereum dApp for for tracing tender document submissions on Blockchain.

License:MIT License


Languages

Language:JavaScript 66.1%Language:HTML 22.2%Language:Solidity 10.8%Language:CSS 0.9%