If you have any improvements, do not hesitate to post an issue or make a pull request.
Your support is very much appreciated! star on GitHub
- About the Project
- Source Code Directory Structure
- Getting Started
- Usage
- FAQ
- Future Work
- Community
- Acknowledgements
- Tutorials
- Contributors
- License
Devault
stands for DEcentralized VAULT
Devault is a decentralized, self-hosted, and end-to-end encrypted alternative to proprietary and centralized cloud storage.
- Data loss
- Data hack
- Data surveillance
- No third party can access your files or prevent you from accessing them.
- It prevents the censorship of the data.
- It's nearly impossible to hack AES-256-CBC encryption or even the blockchain.
- It prevents the data from being tampered with.
- It breaks apart the users’ files and distributes them across multiple nodes on the network.
- The smart contract is upgradeable, so the data is never lost when there is a bug fix.
- Decentralized
- Blockchain based
- End-to-end encryption/decryption
- Self-hosted
- Open-source
When you upload a file:
- The file gets encrypted using AES-256-CBC encryption.
- The encrypted file is split into pieces.
- The chunks are distributed across the network nodes.
- The root hash will be stored in your wallet on the blockchain.
When you download a file:
- The root hash will be retrieved from your wallet on the blockchain.
- The root hash will be used to retrieve the file chunks.
- The retrieved chucks will be combined and decrypted to represent the original file.
The tools used in this project.
Tool | Description | |
---|---|---|
Neovim | IDE | |
Next.js | Full stack framework | |
Hardhat | Framework for developing, testing, linting and deploying smart contracts | |
Solidity | The smart contract language | |
Metamask | Web3 provider | |
Ethers.js | Library for interacting with the Ethereum blockchain | |
Ropsten | Testnet for deploying smart contracts | |
Infura | Blockchain node as a service to deploy the smart contracts through it | |
IPFS | Storing, retrieving and sharing the encrypted files | |
Jest | Unit testing and code coverage | |
Etherscan | Verifying transactions and blocks | |
Vercel | Production deployment | |
Docker | Deploying and shipping the app for production |
A quick look at the top-level files and directories:
.
├── __tests__
├── artifacts
├── components
├── contracts
├── docker-compose.yml
├── Dockerfile
├── docs
├── hardhat.config.js
├── jest.config.js
├── next.config.js
├── out
├── package.json
├── pages
├── public
├── scripts
├── SECURITY.md
├── styles
├── .github
└── utils
-
- __tests__: contains all the unit tests
-
- artifacts: produced by hardhat after compiling the smart contracts and containing smart contracts ABIs.
-
- components: contains all the React components.
-
- contracts: contains all the smart contracts source code.
-
- docker-compose.yml: docker-compose file for serving the production build.
-
- Dockerfile: docker file for building and running next.js app used by docker-compose
-
- docs: contains all the source code documentation.
-
- hardhat.config.js: hardhat config file
-
- jest.config.js: jest config file
-
- next.config.js: next.js config file
-
- out: produced by
npm run build2
and contains a static site.
- out: produced by
-
- package.json: npm package manager config file
-
- pages: contains all pages routes
-
- public: contains all the assets (ex. images, fonts...)
-
- scripts: contains all the scripts used to automate the development process (ex. deploy, logger...)
-
- SECURITY: defining which version receives updates.
-
- styles: contains all page styles.
-
- .github: contains automated workflows (CI/CD).
-
- utils: contains all javascript functions used by other components.
This project uses npm
as a package manager
pacman -S npm
To run this project, you will need to add the following environment variables to your .env
file
PRIVATE_KEY
ROPSTEN_URL
To generate those keys you will need to:
-
- create infura account
-
- create a new Ethereum node
-
- copy the private key to .env
-
- copy ropsten url to .env
SMART_CONTRACT_ADDRESS_ROPSTEN
This variable will be set later by the deployment script
- Clone the repo
git clone https://github.com/AbdeltwabMF/devault.git
cd devault
- Install dependencies
npm ci
- Run the development server and local blockchain node.
npm run deploy localhost
- Navigate to
http://localhost:3000
🟢 Now you're good to go
- Run the smart contracts test
npx hardhat test
- Generates a code coverage report for smart contracts test
npx hardhat coverage
- Run the whole project tests
npm run test
- Deploy using source code and docker
git clone https://github.com/AbdeltwabMF/devault.git
cd devault
docker-compose up --build --force-recreate -d
- Deploy using official docker image hosted on docker hub
docker container run -p 3000:3000 -d abdeltwabmf/devault
- Deploy using vercel
npm i -g vercel
vercel --prod
- Deploy using static site generation
The generated static site will be in the out
directory (ex. use nginx
to serve it)
npm run build2
-
- Create an Ethereum wallet using metamask extension.
-
- Open devault website.
-
- Click connect wallet and follow the steps.
-
-
-
Go to ropsten faucet and paste your address to get some ethers. (used for transactions)
-
-
- Navigate to The Vault tab.
-
- Pick a file and press upload.
-
- Give a passphrase to encrypt the file. (you can use different passphrases for different files).
-
- Once the file is successfully uploaded it will appear on the same page with the option to download.
-
- When downloading give the same passphrase you entered when uploading the file.
-
- The file is now being downloaded.
Why metamask?
- It's the most popular wallet out there, and it's the only wallet supported by the current version of devault.
Is it possible to upload files without ethers?
- No, you should have some ethers to be able to write files' metadata to the blockchain.
What happens when I switch to another account
- The files that is related to that account will be retrieved instead of the previous one.
- Arabic version.
- Client-side encryption/decryption.
- Upload a file.
- Delete a file.
- Download a file.
- Secure file sharing.
- Delete selected files.
- Search files.
- Change passphrase.
- Compress files before uploading.
- Sort files based on (date, size, name...)
- Upload folders.
- Download selected files.
The Devault
community can be found on:
Where you can ask questions, suggest new ideas, and get support.
View
- How Blockchain works
- Understanding the cryptographic part of the Blockchain
- Data structures used in Blockchain
- Acronyms and glossaries
- The smart contract development & security
- The front end (JavaScript & React)
- The IPFS protocol
Abd El-Twab M. Fakhry |
Licensed under the GPL-v3 License.