DeDrive 3.0 is a decentralized file sharing system, where you can upload, view share and revoke access to your files on the blockchain through IPFS
LIVE WEBSITE => here
This project consist of 2 directories the, the server(root directory) and the client for our front-end as follows:
client/
: contains all the subfolders and files for our react frontendcontracts/
: Contains the Solidity smart contract files.scripts/
: Contains JavaScript scripts to deploy and interact with the smart contracts.test/
: Contains test scripts to test the functionality of the smart contracts.hardhat.config.js
: Configuration file for Hardhat setup.index.js
: Node js proxy server file to proxy our request from the client to the endpoint and vice versaREADME.md
: This file.
and was developed with ❤️ using the following softwares:
- React
- Ethers
- Node (Express)
- Solidity
- Hardhat
- IPFS
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- Nodejs
- You'll know you've installed nodejs right if you can run:
node --version
and get an ouput like:vx.x.x
- You'll know you've installed nodejs right if you can run:
- Yarn instead of
npm
- You'll know you've installed yarn right if you can run:
yarn --version
and get an output like:x.x.x
- You might need to install it with
npm
orcorepack
- You'll know you've installed yarn right if you can run:
git clone https://github.com/chidubesteve/DeDrive-3.0.git
cd DeDrive-3.0
yarn
cd client && npm install && npm start
or
npm i
cd client && npm install && npm start
This will spin up our react app in the front end.
- Run your local blockchain with the lottery code
In a different terminal / command line
npx hardhat node
or
yarn hardhat node
- Add hardhat network to your metamask/wallet
- Get the RPC_URL of your hh node (usually
http://127.0.0.1:8545/
) - Go to your wallet and add a new network. See instructions here.
- Network Name: Hardhat-Localhost
- New RPC URL: http://127.0.0.1:8545/
- Chain ID: 31337
- Currency Symbol: ETH (or GO)
- Block Explorer URL: None
Ideally, you'd then import one of the accounts from hardhat to your wallet/metamask.
- you can run the node proxy server in the root directory by
In a different terminal / command line
npm run dev
or yarn dev
-
Head over to Pinata (Pinata is an IPFS and farcaster service provider provider) to get your api keys . Create a .env file and add them. NEVER PUSH YOUR KEYS TO REPO!!
-
Go to UI and have fun!
Head over to your localhost and upload, view and share your files
I have written test for the contract in the test
folder
- you can run the tests by
npx hardhat test
or a specific test by adding a --grep flag followed by the name of the test eg:npx hardhat test --grep "it should do this"
Feel free to write more test cases 😀😀and you can also change the visibility of state variables in the contract to access the default getter and functions crested by solidity compiler
- Build your static code.
yarn build or npm run build
If you you spot a bug in the code, or have a suggestion to improve the code efficiency and wan to contribute to open source, feel free to create a PR!
If you appreciated this, feel free to to ⭐ this repo and follow me
Twitter LinkedIn
(PS: if you want a tutorial on how to build ts from scratch. send me a DM 😉 (If i get enough requests i'll))
Made with ❤ from me!