This is a dApp for creating, reading, and voting on proposals using Ethereum smart contract.
Screen.Recording.2023-11-14.at.9.54.14.PM.mov
- Node.js and npm
- Truffle
- Ganache
- Metamask
- Clone the repository:
git clone git@github.com:cryptodev523/dApp-proposal-management.git
- Install the dependencies:
cd dApp-proposal-management
cd backend
npm install
cd ..
cd frontend
npm install
- 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.
- 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.
- Start Ganache and create a workspace with the truffle-config.js file.
Reference: https://trufflesuite.com/docs/ganache/quickstart
- Compile and migrate the smart contracts:
truffle compile
truffle migrate
- Import the Ganache accounts into Metamask using the private keys provided by Ganache.
- Start the local backend server:
cd backend
npm start
- Start the local frontend:
cd frontend
npm start
-
Open your browser and go to http://localhost:3001.
-
Connect Metamask to the local Ethereum blockchain provided by Ganache.
-
Interact with the application through the web interface.
Run the tests with the following command:
cd contracts
truffle test