This repository hosts the code for D-FILE, a decentralized file-sharing platform akin to Google Drive, developed using Hardhat, Solidity (Smart Contracts), and React.js. By leveraging blockchain technology, D-FILE ensures secure, transparent, and decentralized file storage and access control.
Follow these steps to set up and run the D-FILE project on your local machine:
-
Clone the repository:
git clone https://github.com/pushpakrai/Decentralized-Blockchain-File-Sharing-Application.git
-
Navigate to the project directory:
cd Decentralized-Blockchain-File-Sharing-Application -
Install dependencies for the smart contract:
npm install
-
Set up the frontend:
- Navigate to the
clientdirectory:cd client - Install the Node.js dependencies:
npm install
- Navigate to the
-
Start a local blockchain network:
npx hardhat node
-
Deploy the smart contract:
- Compile and deploy the smart contract to the local network:
npx hardhat run --network localhost scripts/deploy.js
- Compile and deploy the smart contract to the local network:
-
Launch the frontend application:
- Navigate to the
clientdirectory:cd client - Start the development server:
npm start
- Navigate to the
-
Access the application: Open your browser and navigate to
http://localhost:3000. Ensure MetaMask is connected to the local blockchain network.
The D-FILE platform employs the following technologies:
- Hardhat: Facilitates smart contract development, testing, and deployment.
- Solidity: Implements the business logic for file storage, access control, and ownership management on the blockchain.
- React.js: Provides an intuitive user interface for interacting with the decentralized file system.
- Pinata: Used for decentralized file storage, ensuring redundancy and security.
The Solidity smart contract handles core functionalities, including:
- File Upload: Links uploaded files to the blockchain and stores metadata securely.
- Access Control: Grants or revokes permissions for specific users.
- Ownership Management: Transfers file ownership securely between users.
- Tamper-Proof Logs: Maintains immutable records of all file-related transactions.
The contract code is in the contracts directory.
The D-FILE frontend, built with React.js, offers:
- User Authentication: Connect your wallet via MetaMask for secure access.
- File Management:
- Upload and view files stored on the blockchain.
- Download files directly from decentralized storage.
- Delete or modify file permissions.
- Access Permissions: Enable or restrict other users' access to specific files.
- Ownership Transfer: Securely transfer file ownership to designated users.
Frontend source code resides in the client directory.
We welcome contributions to enhance the D-FILE project! Here's how to get involved:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Implement changes and commit:
git commit -m "Add feature description" - Push changes to your forked repository:
git push origin feature-name
- Open a pull request, detailing your enhancements or fixes.
This project is licensed under the MIT License. For more details, refer to the LICENSE file.