Git Product home page Git Product logo

dapp-js's Introduction

๐Ÿ“ Table of Contents

๐Ÿง About

  • This application allow you to track your amount of Ether and get daily notification form your account in ethereum blockchain .
  • Please Notice That we using the rinkeby test blockchain Network for this application.

๐Ÿ Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You need to install the fellowing software in order to get the application up and running :

  • Node.js and npm.
  • Docker.
  • Kubernetes on cloud.

Development

APP Architecture

Alt text

APP Architecture Explained

The application architecture contain 3 part

  • Node js application that connect to the blockchain network using the web3js as interface via infura
  • the application watch all transaction that happened in the blockchain network ( because all transactions will be broadcast at all node in the blockchain network )
  • when we detect a transaction happened FROM the provided account we execute code to get the Actual balance for that specific account ( using the web3js library ) and use the third party api for messages services (telegram, slack , etc ) to send notification.

everyday at giving time ( you can injected it on the deployment process ) we execute a code to get the actual balance for that account and send a notification ( using messages service ).

Installing

Running the Node.js application

  • Download or clone the project code from https://github.com/abdm64/DAPP-JS.git

  • Install all required npm packages by running npm install from the command line in the app folder (where the package.json is located).

cd app
npm install
  • Before start the application you should change keys in the app/src/config folder (account , tokens etc) in order to get messages from the the application in your slack and telegram channel.

  • Start the application by running npm start from the command line in the app folder, you should see the message: "the application Now is running, start watch your notification".

npm start 
  • Now the application should send you a notification at every transaction happened in your account and will send you daily check of your actual balance

๐Ÿš€ Deployment

Deployment Architecture

Alt text

Deployment Architecture Explained

  • In order to deploy this application in production we need :
    • Docker to build image for this application and push it to the docker hub or private registry .
    • Kubernetes cluster to run the application in production mode from the image that was created .

Docker

Installing

  • Download and install docker in your machine

Build Docker image

  • Build your own docker image and push it to your repo by running "docker build -t my-app-name:v1 . " from the command line in app folder
cd app
docker build -t my-app-name:v1 .

you need to push the image to Docker hub or your own registry .

Run Docker image

  • Run your Docker image for the application by the command line
docker run -e [inject your env variable here] my-app-name:v1

Docker compose

  • Also you can run the application as service by running
docker-compose up 

and the docker-compose.yaml handle all the task for you

  • to drop the running container use the command
docker-compose  down 

Kubernetes GKE

  • you should have access to Kubernetes cluster GKE or you can download and install minikube in your machine

  • Please fellow the instruction in the eth-app.yaml file in the k8s folder to update all information needed ( env var ) in order to the application work on Kubernetes cluster

  • To run the application on Kubernetes cluster ( GKE) just run the fellowing command

kubectl apply -f k8s
  • this will create 3 Kubernetes objects:

    • Deployment for the application with one pod ( running container) insuring high availability for that service.
    • Secret to store all you secret data including tokens password etc
    • Namespace a virtual cluster for all your resource related to this application ( in our case the secret and the deployment )
  • to drop the application just run the command :

kubectl delete  -f k8s

โ›๏ธ Built Using

  • Web3.js - blockchain interface for javascript program.
  • Telegraph - telegram api for javascript program.
  • @slack/web-api - Web Framework for slack api .
  • NodeJs - Server side environment for javascript .
  • Docker - Software platform for building and packaging applications.
  • Kubernetes - Container Orchestration.

โœ๏ธ Author

Made with โค๏ธ by Abdellah

dapp-js's People

Contributors

abdm64 avatar

Watchers

 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.