Skip to content

Koa-Box

A truffle box to serve as the foundation of any Truffle and Koa.js dApp.

This Box Uses NodeJS(Koa JS) to provide API endpoints to the Ethereum Blockchain smart contract so that this smart contract can be used in Android/Ios Apps as well.

  • Production grade lightweight JSON based logging utility
  • configurable env's based on current NODE_ENV
  • Error handling middlewares
  • Easily pluggable controllers and routers
  • The project structure is highly modular and can be directly used or extended for production purpose

Pre-Requisites 1. NodeJS 2. Yarn Or NPM 3. GanacheCLI 4. Truffle

Installation 1. Install Truffle and Ganache CLI globally.

npm install -g truffle
npm install -g ganache-cli
  1. Download the box. This also takes care of installing the necessary dependencies.
truffle unbox manjeet-thadani/koa-trufflebox
  1. Install all the node modules required by running:
    // install all the node modules using npm
    npm install
    
    or if you prefer yarn
    //install all the node modules using yarn
    yarn install
    
  2. Start truffle development console using
    truffle develop
    
  3. Inside the truffle console run compile to compile the contracts
  4. You can see that a new /build folder has been created in the root directory which contains the compiled contracts.

  5. Now these contracts need to be deployed on the Blockchain. For this, run migrate inside the truffle development console

  6. To run the Koa server yarn start or npm start

  7. In the browser window open http://localhost:8081/.

Collaborators 1. MANJEET THADANI 2. CHIRAG MALIWAL