FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Suvesh108/BlockVerify: BlockVerify uses blockchain to give each product a unique ID, making it easy to track its journey from the factory to your hands. Just scan a QR code or tap with NFC to instantly check if a product is real and see where it’s been keeping things transparent and counterfeit-free. · GitHub

Repository navigation

About

BlockVerify uses blockchain to give each product a unique ID, making it easy to track its journey from the factory to your hands. Just scan a QR code or tap with NFC to instantly check if a product is real and see where it’s been keeping things transparent and counterfeit-free.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

BlockVerify 2.0 — Anti-Counterfeit Product Authenticator and Supply Chain Ecosystem

A modern, full-stack, blockchain-powered product authentication and supply chain tracking platform designed to combat counterfeit products. The platform utilizes Ethereum smart contracts, a React + Vite frontend styled with Tailwind CSS (v4), an Express API backend, and MongoDB storage.


🚀 Key Features

  • Verified Provenance Trail: Complete custody history tracked directly on the Ethereum blockchain from registration to retail sales.
  • Role-Based Dashboards:
    • Manufacturers: Register products on-chain, manage authorized sellers, generate secure SVG/Canvas QR verification codes, and request global product recalls.
    • Sellers: Accept custody of shipped products, manage store inventory, import barcodes, and register consumer retail sales.
    • Consumers: View purchased product history, download digital NFT certificate representations, and submit fraud/counterfeit reports.
    • Administrators: Approve pending manufacturer registrations, manage active users, and review fraud reports flag alerts.
  • Digital Warranties & NFT Certificates: Tokenized consumer product warranty claims and ERC-721 NFT representations of authentic product custody.
  • AI Anomaly & Fraud Detection: Backend heuristic/anomaly detection flagging suspicious transaction rates, duplicate lookup checks, and double-sale attempts.
  • Analytics Dashboard: Live interactive dashboards displaying supply chain statistics, inventory rates, and verification metrics.

🛠️ Tech Stack

Frontend Layer

  • Core Framework: React 19 + Vite (built using ESM modules).
  • Styling Engine: Tailwind CSS v4 (configured via PostCSS with @tailwindcss/postcss).
  • Icons & Assets: Lucide React & Google Material Symbols.
  • Smart Contract Client: Ethers.js v6 for injected browser wallet integrations.
  • QR Scanner: html5-qrcode & qrcode.react.

Backend Service Node

  • Runtime: Node.js (ESM Module type) + Express.
  • Database: MongoDB via Mongoose.
  • Security: Rate-limiting, Helmet security policies, JWT authentication, and role router guards.

Smart Contracts (Blockchain)

  • Development Network: Hardhat Suite.
  • Solidity Version: 0.8.24 (utilizing compiler optimizations and Cancun rules).
  • Contracts:
    • BlockVerify.sol: Logic governing product registry, custody transfers, and provenance trails.
    • BlockVerifyWarranty.sol: Secure creation and claims for digital product warranties.
    • BlockVerifyNFT.sol: Tokenized ERC-721 certificates of authenticity.

📁 Workspace Directory Structure

BlockVerify/
├── contracts/                  # Solidity smart contracts
│   ├── BlockVerify.sol         # Main provenance logic
│   ├── BlockVerifyWarranty.sol # Warranty manager
│   └── BlockVerifyNFT.sol      # ERC-721 NFT certificate
├── scripts/                    # Hardhat deployment scripts
│   └── deploy.js               # Contract deployment and ABI sync script
├── test/                       # Smart contract unit tests
│   └── BlockVerify.test.js     # Chai unit test suite
├── server/                     # Backend API Node
│   ├── config/                 # DB config (db.js)
│   ├── models/                 # Mongoose models (User, Product, Transaction, etc.)
│   ├── routes/                 # API controllers (auth, manufacturer, seller, consumer, admin)
│   ├── utils/                  # Fraud detection heuristics
│   └── server.js               # Express server entry point
├── src/                        # Frontend Application
│   ├── assets/                 # Custom styling and animations
│   ├── components/             # Reusable Glassmorphism UI components
│   ├── context/                # Web3 & JWT Auth contexts
│   ├── contracts/              # Compiled contract ABIs and dynamic address mapping
│   ├── pages/                  # Dashboard screens (Landing, Verify, dashboards)
│   ├── main.jsx                # Application root
│   └── index.css               # Tailwind CSS v4 root import
├── hardhat.config.js           # Hardhat environment settings
├── vite.config.js              # Vite server & proxy configurations
└── package.json                # Project scripts and dependencies

⚙️ Setup and Installation

1. Prerequisites

  • Node.js (v18 or higher recommended)
  • MongoDB running locally or a MongoDB Atlas connection URI
  • MetaMask (or a browser-based Web3 provider)

2. Clone and Install

git clone https://github.com/Suvesh108/BlockVerify.git
cd BlockVerify
npm install

3. Smart Contract Compilation & Deployment

To compile contracts and deploy them locally on a Hardhat network:

# 1. Compile contracts
npx hardhat compile

# 2. Run Hardhat unit tests to verify stability
npx hardhat test

# 3. Spin up local Hardhat node in a separate terminal
npx hardhat node

# 4. Deploy contracts to the local network
npx hardhat run scripts/deploy.js --network localhost

Deployment automatically updates ABIs and contract address references inside the src/contracts/ directory for immediate frontend ingestion.

4. Database Configuration

Create a .env file in the root directory and specify your MongoDB connection (falls back to local mongodb://localhost:27017/blockverify if omitted):

PORT=5000
MONGODB_URI=mongodb://localhost:27017/blockverify
JWT_SECRET=your_jwt_signing_secret_here

5. Running the Application

To run the Express backend API and Vite dev server concurrently, simply run:

npm start

🔒 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Acknowledgments

  • The Ethereum Developer community for Solidity tools and libraries.
  • OpenZeppelin for standardized, secure smart contract templates.

About

BlockVerify uses blockchain to give each product a unique ID, making it easy to track its journey from the factory to your hands. Just scan a QR code or tap with NFC to instantly check if a product is real and see where it’s been keeping things transparent and counterfeit-free.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL