A complete blockchain-based document verification system with role-based access control, IPFS integration, and visual workflow.
DocChain is a decentralized application that handles digital certificate generation and verification processes using blockchain technology, IPFS storage, and QR codes.
- π Owner: System administrator who verifies universities and companies
- π Student: Upload documents for university verification
- ποΈ University: Verify student documents (requires owner approval)
- π’ Company: Check document authenticity (requires owner approval)
- π Multi-role access control with blockchain-based permissions
- π Document hash verification using SHA-256 + IPFS
- π¨ Visual workflow interface with step-by-step process
- π Progress indicators for file uploads
- π IPFS integration for decentralized file storage
- π Real-time verification status tracking
- π± Responsive design for all devices
- π― Batch document processing for universities
- π QR code integration for easy verification
- Node.js v16+
- MetaMask browser extension
- Git
# Clone repository
git clone https://github.com/Nish12345944/DocChain.git
cd DocChain
# Install all dependencies
npm run install-all# Terminal 1: Start blockchain
npm run start-blockchain
# Terminal 2: Deploy contract
npm run deploy-local
# Terminal 3: Start frontend
npm run start-frontend-
Add Hardhat Local Network:
- Network Name:
Hardhat Local - RPC URL:
http://127.0.0.1:8545 - Chain ID:
31337 - Currency:
ETH
- Network Name:
-
Import Test Account:
Private Key: 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d -
Access Application:
- Open:
http://localhost:3008 - Connect MetaMask
- Start testing!
- Open:
- Use Account #0 (contract owner)
- Verify university and company registrations
- Register as Student (auto-approved)
- Upload documents with visual workflow:
- Step 1: Select and process file
- Step 2: Choose university
- Step 3: Submit to blockchain
- Grant company access to documents
- Register as University
- Wait for owner approval
- Verify student documents by comparing file hashes
- Batch process multiple documents
- Register as Company
- Wait for owner approval
- Verify documents by:
- File upload (hash comparison)
- QR code scanning
- Document ID lookup
DocChain/
βββ blockchain/ # Smart contracts & deployment
β βββ contracts/
β β βββ DocChain.sol # Main contract with multi-role system
β βββ scripts/
β β βββ deploy.js # Deployment script
β βββ hardhat.config.js # Hardhat configuration
βββ frontend/ # React application
β βββ src/
β β βββ components/ # UI components
β β β βββ StudentDashboard.js
β β β βββ UniversityDashboard.js
β β β βββ CompanyDashboard.js
β β β βββ OwnerDashboard.js
β β β βββ FileUpload.js
β β β βββ RoleRegistration.js
β β βββ utils/ # Utility functions
β β β βββ contract.js # Contract interaction
β β β βββ crypto.js # Hash calculations
β β β βββ ipfs.js # IPFS integration
β β β βββ wallet.js # Wallet connection
β β βββ App.js # Main application
β βββ package.json
βββ README.md
- Frontend: React 18, CSS3, Responsive Design
- Blockchain: Solidity ^0.8.20, Hardhat, Ethers.js v6
- Storage: IPFS for files, Ethereum for hashes
- Wallet: MetaMask integration
- Security: SHA-256 hashing, Role-based access control
// Multi-role system
enum UserRole { None, Student, University, Company }
// Document structure with dual hashes
struct Document {
uint256 documentId;
address studentAddress;
string documentHash; // SHA-256 of file
string ipfsHash; // IPFS CID
address universityAddress;
VerificationStatus status;
uint256 timestamp;
mapping(address => bool) companyAccess;
}# Update .env with your keys
SEPOLIA_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID
PRIVATE_KEY=your_private_key_here
# Deploy to testnet
npm run deploy-sepolia
# Build frontend
npm run build-frontend- Smart Contract: Deploy to Ethereum mainnet
- Frontend: Deploy to Vercel/Netlify
- IPFS: Use Pinata or dedicated IPFS node
# Run smart contract tests
npm test
# Test different roles
# 1. Register as Student (Account #1)
# 2. Register as University (Account #2)
# 3. Owner approves University (Account #0)
# 4. Student uploads document
# 5. University verifies document
# 6. Company checks verification- Visual workflow steps
- File upload with progress
- Document management
- Pending document verification
- Batch processing tools
- Hash comparison interface
- Document verification by upload
- QR code scanning
- Verification status display
- Immutable Records: All verifications stored on blockchain
- Hash Verification: SHA-256 ensures document integrity
- Access Control: Role-based permissions
- Decentralized Storage: IPFS prevents single point of failure
- Transparent Process: All actions are publicly verifiable
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin for secure smart contract libraries
- Hardhat for development framework
- IPFS for decentralized storage
- React community for UI components
For support, email: support@docchain.dev or join our Discord community.
Built with β€οΈ using React, Solidity, and Ethereum