bhuwanadhikari / rahat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rahat - Blockchain-based Aid Distribution

Rahat is a blockchain-based digital relief distribution management platform for humanitarian agencies to support marginalized communities. It issues, manages and monitors relief distribution in the form of digital tokens. It creates a transparent, efficient and cheaper way to distribute cash or goods. It mobilizes the local community encouraging financial resilience and freedom. For more information please visit https://rahatapp.com.

Rahat’s main features are:

  • Dashboard for aid agencies to issue relief tokens to recipients & to onboard local community vendors. Agencies can audit all transactional information real-time.
  • Mobile based wallet app for local vendors to initiate & record relief token transaction in a blockchain network & cash transfer from banks.
  • A SMS feature for recipients to receive their token and/or assigned digital card with QR code to buy relief products from participating local merchants.
  • Transaction data in blockchain network to verify the flow of tokens.
  • A platform for local authorities & aid agencies to connect.

Getting started

This is a web-based application with node-js as backend and uses truffle as a tool to compile. It uses MongoDB as a database for regular non-blockchain data persistence and solidity smart contract to execute transactions on Ethereum blockchain.

Pre-requisite

To run Rahat in your system please make user you have following app and libraries installed.

  • Node-js --version == 10.18.1
  • Yarn --version == 1.21.1
  • MongoDB --version >= 4.2.8
  • Truffle --version == 5.1.22

Complete Rahat Package

Currently, Rahat consists four applications. For complete aid distribution process all four applications have to be installed and setup.

  1. Rahat Server: This is the main server (this project) which provides API services for other applications. It also contains source code for solidity smart contracts that needs to be compliled and deployed to Ethereum network of your choice. Please deploy this application before deploying other projects.

  2. Agency Dashboard (https://github.com/esatya/rahat-agency): This project is react-based dashboard for managing Rahat for agencies. It utilizes API to connect to the server and can directly communicate with Ethereum network using Metamask. After installing the server, you can use this app to setup Rahat in user-friendly way.

  3. OTP Server (https://github.com/esatya/rahat-otp). It is a stand alone server to manage OTP that it sent to beneficiary phone during a transaction. This service adds hash of OTP to the smart-contract that should match with the OTP sent by the vendor to complete the transaction. Use your favorite SMS service like Twilio, GOIP as plugins to send SMS.

  4. Vendor Web-based App (https://github.com/esatya/rahat-vendor) This is a mobile friendly vendor user interface that can request fund from beneficiary account after beneficiary provide OTP to the vendor. It is a fully functioning mobile wallet that vendor can use to transfer fund to the bank or back to the agency to redeem local currency.

Rahat - System Workflow

Installing Rahat Server

To setup this software on your machine locally, first clone this repository to your local machine and create a folder named ‘config’ on root of this repository and add local.json file. Click the link to see the sample.

If you are trying this in your local machine, please install Ganache

  1. Install required dependencies and compile smart contracts yarn setup

  2. Start the server yarn start

  3. Now, in your browser go to http://localhost:3800/documentation to see API endpoints that are available.

  4. Please install Rahat Agency (https://github.com/esatya/rahat-agency) to manage using User Interface.

Coding Styles

This repository uses eslint to enforce air-bnb coding styles.

Important: for Production

When you deploy Rahat for production. Please make sure you backup the server's private key securely in an offline wallet, as it will contain some Ethers to perform various server tasks tasks.

Contributing

Everyone is very welcome to contribute on the codebase of Rahat. Please reach us in Gitter in case of any query/feedback/suggestion.

For more information on the contributing procedure, see Contribution

About

License:Other


Languages

Language:JavaScript 89.2%Language:Solidity 10.8%