Giter Site home page Giter Site logo

raghavaro / fstack-ethdapp-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rrecuero/fstack-ethdapp-template

0.0 2.0 0.0 860 KB

Template to create universal eth dapps powered by React/Redux/Drizzle/Open Zeppelin/ Infura / Aragon

License: GNU General Public License v3.0

JavaScript 95.64% HTML 3.42% CSS 0.94%

fstack-ethdapp-template's Introduction

Seamless Full Stack Dapp Template

Javascript Fatigue + Cloud Fatigue + Web3 Fatigue?

Here is the magic pill to solve all your symptoms.

Starter kit to develop universal Dapps with upgradeable smart contracts and powerful user interfaces.

Requirements

  • Install latest Node (8+) & npm

  • Install babel npm install --global babel-cli

  • Install eslint npm install -g eslint

  • Install Truffle

npm install -g truffle

  • Install Ganache

npm install -g ganache-cli

  • Install create-react-app

npm install -g create-react-app

  • Install heroku (on MacOs) and create the app
brew install heroku/brew/heroku
heroku create -b heroku/nodejs -a <name>

Add mongodb to your heroku.

  • Set env variables for the backend and frontend. Override them in heroku.

Quick Start

Run npm install in every folder:

cd client && npm install
cd ethwrapper && npm install
cd backend && npm install

Run garnache, backend and frontend in different terminals:

ganache-cli -b 3
cd backend && npm run dev
cd client && npm run start

The dApp should be running here http://localhost:3000.

Deploying to heroku

git push heroku master

Inspirations

Technologies used

  • React/Redux + Drizzle
  • Smart Contracts: Truffle, Ganache, OpenZeppelin, Aragon
  • Backend: Node JS, Express

Folder Organization

  • ethwrapper/: Contains standard truffle set up. See below for more
  • client/: React/Redux frontend app. Node package.
  • backend/: Node API backend. Node package.

How the project was created (FYI)

  1. Ran truffle init inside the ethwrapper folder. The default Truffle directory structure contains the following:
  • contracts/: Contains the Solidity source files for our smart contracts. There is an important contract in here called Migrations.sol, which we'll talk about later.
  • migrations/: Truffle uses a migration system to handle smart contract deployments. A migration is an additional special smart contract that keeps track of changes.
  • test/: Contains both JavaScript and Solidity tests for our smart contracts
  • truffle-config.js: Truffle configuration file
  • truffle.js: Another Truffle configuration file (soon to be deprecated)
  1. Initialized the client with create-react-app by running:

npx create-react-app client

  1. Linked the compiled contracts from truffle to be consumed by the frontend:
// For MacOS and Linux
cd src
ln -s ../../ethwrapper/build/contracts contracts
  1. Installed Drizzle in the client
npm install drizzle --save
npm install drizzle-react --save
npm install drizzle-react-components --save
  1. Added initial contracts and test to ethwrapper and set config in truffle.js.
  2. Created packages for backend and ethwrapper folders
  3. Installed openzeppelin
npm install --save-exact openzeppelin-solidity
  1. Installed SASS
npm install node-sass --save
  1. Install font-awesome
npm install --save font-awesome

// In index.js
import 'font-awesome/css/font-awesome.min.css';
  1. Installs bulma
npm install --save bulma

// In index.js
import 'bulma/css/bulma.css';
  1. Install react-router and react-router-dom
npm install react-router
npm install react-router-dom

// Modify app.js and create the router
  1. Install backend packages. See package.json for reference.

  2. Used single heroku app setup for both apps

TODO

  • No address error

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.