This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react"; | |
| import axios from "axios"; | |
| let endpoint = "http://localhost:4000"; | |
| class Message extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state= { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { BrowserRouter as Router, Route } from "react-router-dom"; | |
| import './App.css'; | |
| import message from "./message"; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <Router> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # using node alpine as base image | |
| FROM node:alpine | |
| # working dir ./app | |
| WORKDIR /app | |
| # Copy react package.json | |
| COPY ./package.json . | |
| # install dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # using node alpine as base image | |
| FROM node:alpine | |
| # working dir ./app | |
| WORKDIR /app | |
| # Install the prerequisites to install the web3 and other ethereum npm packages | |
| RUN apk update && apk upgrade && apk add --no-cache bash git openssh | |
| RUN apk add --update python krb5 krb5-libs gcc make g++ krb5-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| ganache: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile.ganache | |
| ports: | |
| - "8545:8545" | |
| dapp: | |
| build: . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Styles from this codepen: | |
| https://codepen.io/official_naveen/pen/rgknI | |
| */ | |
| body { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package middleware | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "../models" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package router | |
| import ( | |
| "../middleware" | |
| "github.com/gorilla/mux" | |
| ) | |
| // Router is exported and used in main.go | |
| func Router() *mux.Router { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react"; | |
| import axios from "axios"; | |
| import { Card, Header, Form, Input, Icon } from "semantic-ui-react"; | |
| let endpoint = "http://localhost:8080"; | |
| class ToDoList extends Component { | |
| constructor(props) { | |
| super(props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const peeTimeCalculator = ( | |
| currentEffHr, | |
| currentEffMins, | |
| lastInHr, | |
| lastInMins, | |
| avgHrs = 7, | |
| avgMins = 0 | |
| ) => { | |
| let totalMins = currentEffHr * 60 + currentEffMins; | |
| let lastLogin = lastInHr * 60 + lastInMins; |