Skip to content

AbdeltwabMF/devault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Devault

A Blockchain-based, self-hosted, and end-to-end encrypted cloud storage.


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

โš ๏ธ Active development. Unstable. Breaking changes. You get the point. โš ๏ธ

๐Ÿ“œ Table of Contents

๐ŸŽ‰ About the Project

Devault stands for DEcentralized VAULT

๐Ÿ“ท Screenshots

landpage landpage

๐ŸŽจ Color Reference

๐ŸŽค What is Devault

Devault is a decentralized, self-hosted, and end-to-end encrypted alternative to proprietary and centralized cloud storage.

๐Ÿ” Why Devault

๐Ÿ‘Ž The Problem with Traditional Cloud Storage

  • Data loss
  • Data hack
  • Data surveillance

๐Ÿ‘ The Solution with Devault

  • 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.

๐Ÿ™ˆ Features

  • Decentralized
  • Blockchain based
  • End-to-end encryption/decryption
  • Self-hosted
  • Open-source

๐Ÿ” How Devault Works

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.

๐Ÿ› ๏ธ Tech Stack and Tools

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

๐Ÿชœ Source Code Directory Structure

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
    1. __tests__: contains all the unit tests
    1. artifacts: produced by hardhat after compiling the smart contracts and containing smart contracts ABIs.
    1. components: contains all the React components.
    1. contracts: contains all the smart contracts source code.
    1. docker-compose.yml: docker-compose file for serving the production build.
    1. Dockerfile: docker file for building and running next.js app used by docker-compose
    1. docs: contains all the source code documentation.
    1. hardhat.config.js: hardhat config file
    1. jest.config.js: jest config file
    1. next.config.js: next.js config file
    1. out: produced by npm run build2 and contains a static site.
    1. package.json: npm package manager config file
    1. pages: contains all pages routes
    1. public: contains all the assets (ex. images, fonts...)
    1. scripts: contains all the scripts used to automate the development process (ex. deploy, logger...)
    1. SECURITY: defining which version receives updates.
    1. styles: contains all page styles.
    1. .github: contains automated workflows (CI/CD).
    1. utils: contains all javascript functions used by other components.

๐Ÿšดโ€โ™‚๏ธ Getting Started

๐ŸŸก Prerequisites

๐Ÿ“ฆ Package Manager

This project uses npm as a package manager

pacman -S npm

๐Ÿ”‘ Environment Variables

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:

    1. create infura account
    1. create a new Ethereum node
    1. copy the private key to .env
    1. copy ropsten url to .env

SMART_CONTRACT_ADDRESS_ROPSTEN

This variable will be set later by the deployment script

๐Ÿ”ง Run for Development

  • 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 Tests

  • 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

โœจ Deployment | Hosting

  • 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

๐Ÿค” Usage

    1. Create an Ethereum wallet using metamask extension.
    1. Open devault website.
    1. Click connect wallet and follow the steps.
    1. Make sure you're on the ropsten network. (settings > advanced > show test networks)
    1. Go to ropsten faucet and paste your address to get some ethers. (used for transactions)
    1. Navigate to The Vault tab.
    1. Pick a file and press upload.
    1. Give a passphrase to encrypt the file. (you can use different passphrases for different files).
    1. Once the file is successfully uploaded it will appear on the same page with the option to download.
    1. When downloading give the same passphrase you entered when uploading the file.
    1. The file is now being downloaded.

๐Ÿ’ก FAQ

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.

โ›‘๏ธ Future Work

  • 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.

โ™ฅ๏ธ Community

The Devault community can be found on:

Where you can ask questions, suggest new ideas, and get support.

๐Ÿ’Ž Acknowledgements

๐Ÿญ Softwares

๐Ÿ‘ท Engineers

๐Ÿ“š Tutorials

View

๐Ÿฃ Contributors

Abdeltwabmf
Abd El-Twab M. Fakhry

โš ๏ธ License

Licensed under the GPL-v3 License.