GithubHelp home page GithubHelp logo

kerala-blockchain-academy / aircraft-seats-booker Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 6.0 7.8 MB

Aircraft Seats Booker

JavaScript 97.56% CSS 0.11% HTML 2.34%
ethereum blockchain solidty dapp nodejs web3js truffle

aircraft-seats-booker's Introduction

Flight Seats Booker

The aim of this project is to revamp the flight booking, check-in and boarding pass processes, distributing flight-seats and boarding passes to passengers as ERC721 Non-Fungible Tokens.

Airline Use-Cases

  1. Create Flight. Provide details such as flight number, origin, destination, departure time, Airline details, and number of seats.

  2. Create and Add Seats to Seating Class. Airlines supply seat numbers and corresponding seat prices for each cabin in the flight.

  3. Withdraw Fees. Airlines can withdraw their fees from passengers' seat bookings, similar to a payment-approval system.

  4. Cancel Seat. Airline can cancel a passenger's seat booking which repossesses their ERC721 seat and triggers a refund to be queued for the passenger.

Hardcoded for demonstration.

Passenger Use-Cases

  1. Book Seat. Passengers can book available flight seats and receive ERC721 seats for their booking.

  2. Check-In. Passengers can check-in for flights which returns their ERC721 seat to the airline. The passenger supplies a IPFS hash for their passport-scan image in this check-in operation.

  3. Cancel Seat Bookings. Passengers can also cancel their seat booking, which returns their ERC721 Seat to the airline and triggers a refund to be queued for the passenger.

Software Packages Used

  1. NodeJS - v9.0.0 (install latest)

  2. NPM - v5.5.1 (install latest)

  3. Truffle - v4.1.13 (install exact version)

  4. Solidity (solc-js) - v0.4.24 (install exact version)

  5. IPFS - v0.4.18 (install latest)

sudo ./install.sh
ipfs init
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST", "OPTIONS"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
  1. Ganache-CLI - v6.2.5 (install latest)

Demo Installation and Setup

A local running IPFS instance is required, along with node version 9, npm, ganache-cli, truffle v4.1.13, solc v0.4.24, and metamask.

Steps to execute:

Open 3 terminals in the project folder and then -

  1. Terminal 1 (leave it running)
ganache-cli
  1. Terminal 2 (leave it running)
ipfs daemon
  1. Terminal 3
npm install
npm run build
truffle migrate --network development --reset --compile-all
npm run dev

The final command npm run dev will start a locally running lite-server instance which will serve the flight booking, checkin and boarding pass UI flows to interact with the contract deployed on local ganache network.

Steps to demo

First log into metamask using the same seed phrase from your local running ganache-cli instance. Then switch to another one of the ganache accounts in metamask instead of the default account. The default account is used by the contract owner to create a single flight and airline belonging to this account, and thus you cannot proceed through the flight booking using that same default account.

  • First screen shows a list of flights to be selected. Select book flight for any one.
  • Select a seat (confirm transaction in metamask for cost of seat)
  • View Seat booking with ERC721 Token ID
  • Immediately proceed to checkin. Select Check In For Flight
  • Choose an image file on your local machine to submit to IPFS as your passport-scan. Choose file and then select Upload Passport to IPFS
  • Select Complete Checkin.
  • View your boarding pass, complete with 2D QRCode, ERC721 Boarding Pass ID and link to passport-scan image in IPFS.

aircraft-seats-booker's People

Contributors

husna696 avatar sumu10 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aircraft-seats-booker's Issues

Metamask connection issue

when I clicked on select seat,i didn't get metamask notification,instead it is showing account:null.Can you please give me a solution for that?
we are using 8545 port in our project, metamask account and ganache-cli is also listening to port8545

Metamask issue

when I clicked on select seat,i didn't get metamask notification,instead it is showing account:null.Can you please give me a solution for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.