Git Product home page Git Product logo

whenubelieve / superhero-ethereum-angular Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 16.49 MB

This is an example of DApp (decentralized application). The blockchain part is an Ethereum, Solidity Smart contract, here it is basically the backend (a service). Frontend application is an Angular-cli project. It allows you to review superheroes (add marks, write some feedback), add new superheroes.

License: Apache License 2.0

Makefile 0.78% Shell 0.93% Solidity 6.52% TypeScript 71.40% JavaScript 10.53% CSS 1.43% HTML 8.41%
angular angular8 ethereum dapp solidity truffle superhero makefile

superhero-ethereum-angular's Introduction

Angular 8 Ethereum full stack example application.

This is an example of DApp (decentralized application). The blockchain part is an Ethereum, Solidity Smart contract, here it is basically the backend (a service). Frontend application is an Angular-cli project. It allows you to review superheroes (add marks, write some feedback), add new superheroes. All data is stored on a blockchain: superheroes, reviews.

Disclaimer

This is a learning project. It's not recommended for a production. The Solidity contracts are implemented with experimental flags enabled to simplify the development. I will improve it to make production ready soon. If you would like to help me bringing it ready to production, just let know on [email protected].

Technologies:

  • Ethereum.
  • Solidity.
  • Truffle.
  • Angular cli.
  • Angular 7.
  • Web3.
  • Truffle-contract.
  • TypeScript.
  • JavaScript.

Requirements.

  • Ganache cli.
  • Truffle.
  • MetaMask plugin for your browser or a blockchain based browser like Mist.

Installation.

Simple installation. Run against Ropsten deployment (adding new heroes is restricted to account owner).

  1. git clone https://github.com/DmitriyNoa/angular-ethereum-decentralized-application.git.
  2. cd angular-ethereum-decentralized-application.
  3. npm i.
  4. npm start.

Full local setup. Run against local Ethereum instance.

  1. git clone https://github.com/DmitriyNoa/angular-ethereum-decentralized-application.git.
  2. In a terminal run cd angular-ethereum-decentralized-application.
  3. make install_all.
  4. Open new a terminal tab and run the local Ethereum with: make run_local_ethereum.
  5. Now when local Ganache instance is running we need to deploy the contract to it. In a new terminal tab run: make deploy_to_local_ethereum.
  6. If the deployment has been successful start the angular app with npm run start_local.
  7. The project is now available under http://localhost:4200.
  8. As this is local deployment the app will start with an empty heroes list. To add heroes setup your MetaMask as shown below.

Prepare you browser.

####This step is required if you want to add reviews (perform write operations), or add a superhero when running on local environment.

  1. Install MetaMask plugin for your browser. FireFox, Chrome and Opera are supported. Follow instruction on https://metamask.io/ or get it from your browser store.
  2. If running against local Ehtereum: 2.1. go to terminal tab where you ran "make run_local_ethereum". 2.2. At the beginning of terminal output you should see available accounts list. 2.3. Copy the first one under "Private Keys".
  3. Go to your browser. Click on the MetaMask extension icon. On the top of the plugin window, change the network to http://localhost:8545.
  4. In the plugin window click on the circle in tight top corner -> import account and copy paste the private key, click add. If everything went well you will see your nw account, it should have just a little bit less then 100 test ETH (99.96 ETH). The small amount of ETH was charged for the contract deployment in previous steps. Accounts import

superhero-ethereum-angular's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.