This repository contains the full decentralized application (DApp) for CrowdFunder, including both the smart contract backend and the React frontend. The smart_contract
folder holds the Solidity smart contracts and Hardhat configuration, while the client
folder contains the React application for interacting with the smart contracts.
Before you begin, ensure you have the following installed:
-
Clone this repository and navigate into it:
git clone https://your-repository-url.git cd your-repository-directory
-
Install dependencies in both the smart contract and client directories:
# Install dependencies for the smart contract cd smart_contract npm install # Install dependencies for the client cd ../client npm install
- Copy the
.env.example
file to a new file named.env
and fill in the necessary environment variables:PRIVATE_KEY=<Your-Sepolia-Wallet-Private-Key> ETHERSCAN_API=<Your-Etherscan-API-Key>
- Navigate to the
smart_contract
folder and run the following command to compile the smart contract:npx hardhat compile
- To deploy the contract to the Sepolia network:
Note the contract address output by this script; you'll need it for the client setup.
npx hardhat run scripts/deploy.js --network sepolia
- In the
client
directory, navigate to thesrc/constants/index.jsx
file. - Open the file and update it with the contract address you obtained during the deployment.
- Make sure you are still in the
client
directory. - Start the React development server:
This will launch the application on http://localhost:3000.
npm start
- Ensure your MetaMask is connected to the Sepolia network.
- Use the React application to interact with your deployed smart contract.