Giter VIP home page Giter VIP logo

zerodollarhomepage's Introduction

publication Archived Repository
The code of this repository was written to illustrate the blog post The Blockchain Explained to Web Developers, Part 2: In Practice
This code is not intended to be used in production, and is not maintained.

ZeroDollarHomePage

Install

Requirements:

# install npm dependencies and Selenium (for tests)
make install

Configuration

Github oAuth

You'll need to create a Github application at https://github.com/settings/developers then copy/paste the Client Id and Client Secret into your configuration file (development.js or production.js):

oauth: {
    githubClientId: 'Your Client ID',
    githubClientSecret: 'Your Client Secret',
},

Github API

For the application to have access to the Github API, you'll need to provide a way to authenticate with Github in the configuration file (development.js or production.js).

This can be:

  • A login/password to an account which can access the repositories on which you configured the hooks
  • An access token (Follow the instructions to create one) created from an account with access to the repositories on which you configured the hooks

Github hooks

You'll need to setup the Github hooks for the repositories you want to be watched by the application.

  • Go to your repository settings, Webhooks & services
  • Add a new webhook by entering [API_URL]:3420/github/callback in the Payload URL field (Port 3420 is important!)
  • Leave the secret field empty (verification is not implemented yet. PR are welcome !)
  • Select the Just the push event. option

That's it. Repeat for every repositories you want to bind.

### Ethereum

Create a file named .ethereum and put your default ethereum account address in it.

Starts a private ethereum network for development by running:

make start-ethereum

A miner must be running on this network to allow contracts deployment and blockchain operations through those contracts. Starts the miner by running:

make run-ethereum-miner

Deploying the contract is done by running:

make deploy-contracts-ethereum

Develop

# start servers (node and webpack via pm2)
make run-dev
# both servers will run in the background
# the Node server uses nodemon and will restart on code change
# the frontend is served by webpack dev server with hot reload

# you can restart either the api or the frontend by hand
make restart-api
make restart-frontend

Browse the app:

# stop servers (node and webpack)
make stop-dev

Note: for stability purposes, it's a good practice to not upgrade your project dependencies using major updates. It's why you should locally run npm set prefix='~' and not add dependencies prefixed with a carret ^ without good reason.

Test

# tests run in the "test" environment and don't empty the "development" database
make test

# alternately, you can run any of the individual test suites:
make test-api-unit
make test-api-functional
make test-frontend-unit
make test-frontend-functional
make test-isomorphic-unit
make test-ethereum

API (and common lib) unit tests using:

API functional tests using:

Frontend unit tests using:

Frontend fonctional tests using:

Deployment

See deployment instructions.

Managing servers with PM2

dev and tests servers are managed with PM2. So, It's possible to :

# display the 'front dev' server's logs
make log-frontend-dev
# display the 'api dev' server's logs
make log-api-dev

# display the list of all servers
make servers-list
# display the monitoring for all servers
make servers-monitoring
# stop all servers
make servers-stop-all
# stop all servers, delete them, and clear their logs.
make servers-clear-all

zerodollarhomepage's People

Contributors

alexisjanvier avatar djhi avatar fzaninotto avatar kmaschta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zerodollarhomepage's Issues

Block the ability to claim a private PR

Currently, if an github access token has access to a private repo (such as marmelab), and if you type the good informations in the claim's URL, we can claim an ad for a private PR.

Increase space on the server

I0502 04:02:39.275864 9314 downloader.go:267] Synchronisation failed: write /home/ubuntu/.ethereum/chaindata/528724.log: no space left on device

Zero Dollar does not work currently.

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.