/dApp-proposal-management

dApp with create, read, and vote on proposals

Primary LanguageTypeScript

dApp Proposal Management

This is a dApp for creating, reading, and voting on proposals using Ethereum smart contract.

Demo

Screen.Recording.2023-11-14.at.9.54.14.PM.mov

Prerequisites

  • Node.js and npm
  • Truffle
  • Ganache
  • Metamask

Setup

  1. Clone the repository:
git clone git@github.com:cryptodev523/dApp-proposal-management.git
  1. Install the dependencies:
cd dApp-proposal-management

cd backend
npm install

cd ..
cd frontend
npm install
  1. In the backend directory, create a .env file and add the following variables:
FRONTEND_URL=<your-frontend-url>
WEB3_PROVIDER_URL=<your-web3-provider-url>
CONTRACT_ADDRESS=<your-contract-address>

Replace , , and with your actual frontend URL, Web3 provider URL, and contract address, respectively.

  1. In the frontend directory, create a .env file and add the following variable:
REACT_APP_BE_SERVER=<your-backend-url>

Replace with your actual backend URL.

  1. Start Ganache and create a workspace with the truffle-config.js file.

Reference: https://trufflesuite.com/docs/ganache/quickstart

  1. Compile and migrate the smart contracts:
truffle compile
truffle migrate
  1. Import the Ganache accounts into Metamask using the private keys provided by Ganache.

Running the Application

  1. Start the local backend server:
cd backend
npm start
  1. Start the local frontend:
cd frontend
npm start
  1. Open your browser and go to http://localhost:3001.

  2. Connect Metamask to the local Ethereum blockchain provided by Ganache.

  3. Interact with the application through the web interface.

Testing

Run the tests with the following command:

cd contracts
truffle test