Skip to content

dev-bootcamp-2019/final-project-DipanshKhandelwal

Repository files navigation

Coffee House

Go on and have some decentralized coffee !!

Abstract

Coffee House is place where you can have and store your snaks and drinks.

Buy it once !! Use it anytime !! It never ends !!

External Contracts Used

  • OpenZeppelin SafeMath
  • OpenZeppelin Ownable

Development

Prerequisites

This is my setup while developing this.

  • OS: Ubuntu 18.04
  • Node.js: 8.14.0
  • npm: 6.5.0
  • truffle: v5.0.2
  • Ganache CLI: v6.2.5

Setup local development instance

  • Clone the project locally
git clone https://github.com/dev-bootcamp-2019/final-project-dipanshkhandelwal
cd final-project-dipanshkhandelwal
  • Start local development blockchain and copy the mnemonic to be used later
ganache-cli -b 3
  • Compile contracts and migrate them to the blockchain
npm i
truffle compile
truffle migrate

Setup the frontend

The frontend is a React app that uses drizzle to interact with the contract.

cd client
npm i
npm start

Run Tests

truffle test

Initial setup

  • Goto localhost:3000 and login into metamask using the mnemonic obtained from ganache.
  • Allow connecting the app to web3
  • Owner's account will be already created and will be the one who initiated the contract.
  • You can then switch to a different metamask account and register/buy etc.

Future work

  • Better handling for users data
  • Two sided store
  • A more friendly page link
  • Integrate drizzle-react
  • Improve UI/UX

Screenshots

Checklist (For ease of reviewer)

  • Project includes a README.md that explains the project.
  • The project is a Truffle project that allows you to easily compile, migrate and test the provided Solidity contracts.
  • Project is commented as outline in the documentation.
  • At least one contract uses a library or inherits from another contract - Actually 3.
  • I can run the app on a dev server locally for testing/grading (connecting to Rinkeby if required).
  • I can visit a URL and interact with the app (can be localhost).
  • The app displays the current ethereum account.
  • I can sign transactions using Metamask (or uPort).
  • The app interface reflects updates to to the contract state.
  • 7 tests written in Javascript or Solidity (or both).
  • Tests are explained with brief code comments.
  • Tests are properly structured.
  • All tests pass 🎉.
  • At least one of the contracts implements a circuit breaker / emergency stop pattern.
  • Project includes a file called design_pattern_desicions.md that explains some of the design decisions made by the author.
  • design_pattern_desicions.md adequately describes the design patterns implemented in the project.
  • Project includes a file called avoiding_common_attacks.md that explains what measures you took to ensure that your contracts are not susceptible to common attacks.
  • The avoiding_common_attacks.md covers at least 3 common attacks and how the app mitigates user risk.
  • Project includes a file called deployed_addresses.txt that describes where the deployed testnet contracts live (which testnet and address).
  • Project uses IPFS to store images for items on sale.
  • The project uses and upgradable design pattern for the smart contracts.
  • At least one contract is written in Vyper or LLL.
  • The app uses uPort for user authentication and/or signing and sending transactions.
  • The app uses the Ethereum Name Service to resolve human readable names to Ethereum addresses (in progress).
  • The project uses an Oracle service such as Oraclize.

ToDo

  • Add user registration form
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Author

Dipansh Khandelwal