GithubHelp home page GithubHelp logo

eccentricexit / iuvo Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 0.0 2.38 MB

Dapp built for educational purposes demonstrating upgradable pattern, uPort, IPFS. Deploys Kleros arbitrable contracts.

JavaScript 58.80% HTML 0.76% CSS 0.02% Solidity 40.41% Shell 0.01%
uport kleros ethereum solidity ipfs react material-ui

iuvo's Introduction



iuvo



The decentralized health services marketplace. Built for educational purposes.

On iuvo, you can hire doctors or put your services up on a list to be hired.

IMPORTANT: Secure smart contract upgradability is hard and evolving quickly. Many patterns are now deprecated due to security vulnerabilties and the one used here is probably one of them. Be responsible.

Table of Contents

What is this?

This is an app (built for educational purposes) and market place to work as a meeting point between anyone who:

  • Wants to hire a doctor for an appointment;
  • Wants to display themselves as a doctor available for hiring.

See the "User stories" section of this document for a better overview.

Features:

  • Upgradable pattern;
  • uPort integration;
  • IPFS integration;
  • Kleros integration;
  • Circuit breaks;
  • Acess restrictions;
  • EthPM package usage;
  • Automated tests;
  • Material UI.

Note for the reviewer: You will need some test ether to hire doctors.

User stories

  • As a user, I can log into the dapp with uPort on my smartphone and see a list of doctors.

  • As a user, I can click on a doctor from a list to see details about that doctor. This view allows me to hire that doctor or see his terms of service contract.

  • When a doctor is hired, a new Kleros arbitrable transaction contract is deployed. I can see the contract address on the appointment in the Appointments list.

  • When someone clicks to "See contract" on the doctor view, a new tab is opened with the doctor's data from an ipfs gateway.

  • As a user, I can place my services for hiring by creating a profile. Once that is done, I can see myself on the list of doctors.

  • As a doctor, I can delete my doctor profile so my services are no longer listed on the list of doctors.

  • As a user, I can see a list of appointments with details of where the contract is deployed and who the arbitrator is.

Install

Simply run npm install

Tests

  1. ganache-cli in one terminal;
  2. truffle test in another.

This project was built using the Truffle Framework, with tests written with mocha and chai so they can be found inside the test folder.

Usage

The frontend depends on uPort and usage depends on weather:

  1. You want to interact with the contracts already deployed on Rinkeby testnet;
  2. You want to interact with your own, newly deployed contracts instances to Rinkeby;
  3. You want to interact with contracts on your own testnet.

If you are a reviewer, you want option 1: interact with the contracts already deployed. See the next section.

Interacting with the deployed contracts

Note for the reviewer: This is what you want to grade this project.

This project's frontend uses uPort's infrastructure for interaction and authentication. This means that:

  • You don't need Metamask, but you do need a smartphone with uPort installed.
  • You will interact with the contracts already deployed on Rinkeby.

See below on how to use the frontend with your own instances of the contracts.

Simply run npm start to serve the frontend.

Regarding uPort: For now, uPort QRCodes can get quite big. Just zoom out if one doesn't fit your screen.

Regarding ipfs addresses: Ipfs hash fields for profile picture and contract come pre-filled and locked. If this were to be used in production, we would allow the user to set this field.

Interacting with new contracts

For new contracts we have two options: deploy on a local testnet and deploy on rinkeby.

Local testnet:

If you choose to deploy locally, you will have to interact with the contracts directly through the truffle console. This is because the frontend requires uPort's infrastructure and smart contracts.

Also note that to hire a doctor, you need to pass the function an address of an arbitrator. This can be any address if you don't plan on raising a dispute (you probably don't).

Rinkeby testnet:

If you choose to deploy the contracts to Rinkeby, you get the benefit of using the frontend. But you need to update it's configuration with your own dapp data and infura api key on truffle.js (for truffle migrations):

  1. See uPort's documentation on how to register.
  2. Update src/util/connectors.js
  3. npm start

Screenshots

License

MIT © 2018 Matheus Alencar

iuvo's People

Contributors

eccentricexit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.