Skip to content

Weirdo-001/VaultHUB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ VaultHub β€” Web3 Secure Storage

Decentralized file vault β€” Secured by Ethereum, pinned to IPFS, zero intermediaries.

VaultHub is a premium Web3 application that lets you upload files to IPFS via Pinata and record ownership immutably on the Ethereum blockchain. Grant granular access to other wallet addresses, view shared vaults, and manage your files with complete controlβ€”all on-chain, all transparent.


🎯 What is VaultHub?

VaultHub combines the permanence of IPFS storage with the transparency of blockchain verification. Your files are yours aloneβ€”nobody else can access or modify them unless you explicitly grant permission.

Core Benefits

  • πŸ” Complete Control β€” You own your data, nobody else
  • πŸ”— Blockchain Verified β€” Every action recorded on Ethereum
  • πŸ“Œ Permanent Storage β€” Files pinned to IPFS forever
  • 🎯 Granular Sharing β€” Share access per wallet address
  • πŸ’¨ Zero Intermediaries β€” Decentralized, no servers, no backdoors

πŸš€ Quick Start

Prerequisites

  • Node.js 16+ and npm
  • MetaMask or Web3-capable wallet
  • Ethereum on Sepolia testnet (or local Hardhat network)

1. Install dependencies

# Root (Hardhat + smart contracts)
npm install

# Frontend (React + Web3)
cd client && npm install

2. Configure environment

Create client/.env:

REACT_APP_PINATA_API_KEY=your_pinata_api_key
REACT_APP_PINATA_SECRET_KEY=your_pinata_secret_key
REACT_APP_CONTRACT_ADDRESS=0xYourDeployedContractAddress

3. Deploy Smart Contract

For Sepolia Testnet:

npx hardhat run scripts/deploy-sepolia.js --network sepolia
# Copy the printed contract address into your .env

For local Hardhat node:

# Terminal 1: Start local blockchain
npx hardhat node

# Terminal 2: Deploy to localhost
npx hardhat run scripts/deploy.js --network localhost

4. Start the frontend

cd client && npm start

The app will open at http://localhost:3000


πŸ— Architecture

Component Technology
Blockchain Ethereum (Sepolia / Hardhat)
Smart Contract Solidity 0.8.9
Storage IPFS via Pinata
Frontend React 18 + ethers.js v5
Deployment Vercel (auto-deploy on push)
Styling CSS3 (Indigo/Black theme)

✨ Features

πŸ“€ File Upload

  • Drag & drop or click to upload
  • Files automatically pinned to IPFS
  • Upload recorded on-chain with one transaction
  • Real-time transaction notifications

πŸ—„ Vault Management

  • View all your uploaded files
  • Soft-delete files (marking as deleted in contract)
  • Copy permanent IPFS links
  • Manage file metadata on-chain

🀝 Access Control

  • Share Access β€” Grant wallet addresses permission to view your vault
  • Revoke Access β€” Remove permission anytime
  • Shared With section β€” See which addresses have access to your files
  • Cross-Vault Viewing β€” View any vault you have permission for

πŸ”” Real-Time Feedback

  • Transaction notifications (success/error/pending)
  • Toast alerts for all actions
  • Live blockchain verification status
  • Auto-refresh of vault contents

πŸ“ Project Structure

VaultHub/
β”œβ”€β”€ contracts/
β”‚   └── Upload.sol                # Smart contract (ABI + logic)
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ deploy.js                 # Local deployment
β”‚   └── deploy-sepolia.js         # Sepolia testnet deployment
β”œβ”€β”€ hardhat.config.js
└── client/
    β”œβ”€β”€ public/                   # Static assets
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ App.js                # Main application shell
    β”‚   β”œβ”€β”€ App.css               # Theme & global styles (Indigo/Black)
    β”‚   β”œβ”€β”€ index.css             # CSS variables
    β”‚   └── components/
    β”‚       β”œβ”€β”€ FileUpload.js      # Upload zone component
    β”‚       β”œβ”€β”€ FileUpload.css
    β”‚       β”œβ”€β”€ Display.js         # Vault contents viewer
    β”‚       β”œβ”€β”€ Display.css
    β”‚       β”œβ”€β”€ Modal.js           # Share access modal
    β”‚       β”œβ”€β”€ Modal.css
    β”‚       β”œβ”€β”€ TransactionPanel.js   # Real-time notifications
    β”‚       β”œβ”€β”€ TransactionPanel.css
    β”‚       β”œβ”€β”€ SharedWithMe.js     # Shared addresses viewer
    β”‚       β”œβ”€β”€ SharedWithMe.css
    β”‚       └── artifacts/         # Contract ABIs (auto-generated)
    └── package.json

πŸ”— Smart Contract

Key Functions

Upload a file:

add(address _user, string url)

Delete a file:

remove(uint256 index)  // Marks file as deleted (soft-delete)

View your vault:

display(address _user) -> string[] // Returns active files only

Grant access:

allow(address user)

Revoke access:

disallow(address user)

See who has access:

shareAccess() -> Access[]  // Returns access list

Data Structure

struct UploadedFile {
  string url;      // IPFS hash
  bool deleted;    // Soft deletion flag
}

struct Access {
  address user;    // Wallet address
  bool access;     // Permission status
}

🎨 UI/UX Features

Premium Design

  • Color Scheme: Pure black backgrounds (#0a0a0a), Indigo primary (#6366f1), Purple accents (#a78bfa)
  • Animations: Smooth transitions, glowing effects, slide-in notifications
  • Responsive: Works on desktop, tablet, mobile
  • Glass Morphism: Frosted glass effect on cards and modals
  • Dark Mode: Built-in, optimized for web3 interfaces

Components Included

  • Top navigation bar with wallet connection
  • Upload zone with drag-and-drop support
  • Vault contents grid with file management
  • Share access modal with Ethereum address input
  • Transaction notification panel
  • Shared vaults viewer
  • Footer with project info

🌐 Deployment

Vercel (Production)

  1. Connect GitHub repo to Vercel
  2. Set environment variables in Vercel settings:
    • REACT_APP_PINATA_API_KEY
    • REACT_APP_PINATA_SECRET_KEY
    • REACT_APP_CONTRACT_ADDRESS
  3. Push to master branch β†’ auto-deploys
  4. Access your live app via Vercel URL

Manual Build

cd client
npm run build
# Build output in client/build/

πŸ›  Development

Environment Variables

For development (client/.env):

REACT_APP_PINATA_API_KEY=pk_test_xxxxx
REACT_APP_PINATA_SECRET_KEY=sk_test_xxxxx
REACT_APP_CONTRACT_ADDRESS=0x1234567890123456789012345678901234567890

Local Testing

# Terminal 1: Hardhat local blockchain
npx hardhat node

# Terminal 2: Deploy contract locally
npx hardhat run scripts/deploy.js --network localhost

# Terminal 3: React dev server
cd client && npm start

Connect MetaMask to Local Network

  1. Open MetaMask
  2. Settings β†’ Networks β†’ Add Network
  3. Network Name: Hardhat
  4. RPC URL: http://127.0.0.1:8545
  5. Chain ID: 31337
  6. Currency: ETH

πŸ“Š Contract Deployment Addresses

Sepolia Testnet:

  • See your latest deployment output or check Vercel environment variables

Local Hardhat:

  • Printed in terminal after running deploy.js

πŸ”’ Security Notes

  • Private keys: Never commit .env files with real keys
  • File hashes: IPFS links are permanentβ€”verify before sharing
  • Wallet security: Only grant access to trusted addresses
  • Gas costs: Test on testnet before mainnet deployment

πŸ“ License

MIT License β€” Feel free to fork, modify, and build!


🀝 Contributing

Found a bug? Have a feature idea? Open an issue or submit a PR!

VaultHub β€” Your files. Your rules. Forever. πŸ”

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors