Skip to content

AkroutiHamza/FLIGHTINSURRANCE

Repository files navigation

FLIGHTINSURRANCE

An Ethereum distributed app that manages insurance for travelers 🧑‍✈️

Open Source Love PRs Welcome

DApp screenshot

Install

This repository contains Smart Contract code in Solidity (using Truffle), tests (also using Truffle), dApp scaffolding (using HTML, CSS and JS) and server app scaffolding.

Notes: The project has been tested with Truffle v5.0.4, Solidity 0.5.6
__

To install, download or clone the repo, then:
  1. npm install
  2. truffle compile
  3. truffle migrate --reset --network ganache --firstAirline=FIRST_AIRLINE_ADDRESS --numOracles=NUM_OF_ORACLES
  4. npm run server
    Warning: Start the server first because the data contract auhtorization call is made from the server
  5. npm run dapp
    The DApp is runing at http://localhost:8000

Testing

To run truffle tests:
  1. Update the mnemonic in truffle.js with your key seed.
  2. truffle dev
  3. migrate --reset
  4. test
Feature of the tests:
  1. Check the operational status of the contracts;
  2. Funding or ailine;
  3. Register airlines with the multiparty threshold;
  4. Flight registration by airline;
  5. Passenger purchase of insurance;
  6. Check Oracles registration;
  7. Watch for FlightStusInfo event;

Deploy

To build dapp for prod: npm run dapp:prod

Deploy the contents of the ./dapp folder

Using the DApp

Using the DApp is straightforward. Start Metamask, clear the history and use the address of the first ailine.

You can then:
  1. send fund;
  2. register flights,
  3. update the flights lists
  4. purchase insurance for a spcific flight,
  5. update the flight status of a specific flight,
  6. check your balance
  7. claim your insurance payout

Resources

⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐

if (_.isAwesome(thisRepo)) {
  thisRepo.star(); // thanks in advance :p
}

About

An Ethereum distributed app that manages insurance for travelers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published