Skip to content

antoniomarroffino/Blockchain-DocumentCertification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

75 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— KrostChain – Document Certification Platform on Blockchain

A web platform for certifying and revoking documents through smart contracts on Ethereum.
It includes a dashboard, notification panel, wallet integration, role management, and audit trail.



πŸ” Features

KrostChain allows users to securely manage the certification and revocation of documents on the Ethereum blockchain.

πŸ‘€ As a registered user, you can:

  • Upload and certify documents
  • View your certified documents and their history
  • Receive notifications for updates and expirations
  • Revoke documents with a reason
  • Download certification proofs

πŸ›‘οΈ As an admin or verifier, you can:

  • View all documents submitted by users
  • Monitor the activity of verifiers and manage permissions
  • Deploy and upgrade the smart contract if needed

All documents are hashed and timestamped, ensuring authenticity, traceability, and immutability through blockchain technology.

πŸ“¦ Tech Stack

  • βš™οΈ Backend: Java + Quarkus + REST
  • 🧠 Smart Contract: Solidity + OpenZeppelin + Hardhat
  • 🌐 Frontend: React + Tailwind + Ethers.js
  • πŸ§ͺ Test: Vitest + React Testing Library + TanStack Query

βš™οΈ Setup Instructions

1. Clone the repository

git clone https://github.com/antoniomarroffino/Blockchain-DocumentCertification.git
cd fanto-marroffino

2. Install dependencies

Frontend

cd frontend
npm install

Backend

cd backend
./mvnw install

Smart Contract

cd blockchain
npm install

πŸš€ Run the Application (Locally)

0. Start the MySQL Database (via Docker)

docker run --name blockchainDocuments-mysql \
  -e MYSQL_ROOT_PASSWORD=1234 \
  -e MYSQL_DATABASE=blockchainDocuments \
  -p 3306:3306 \
  -d mysql:latest

πŸ“ These credentials must match your backend application.properties.


1. Start Hardhat Node

cd blockchain
npx hardhat node

2. Deploy the Smart Contract (on localhost)

npx hardhat run scripts/deploy.ts --network localhost

3. Start the Backend

cd backend
mvn clean package 
cd ./target/backend-api-client 
npm i 
npm link 
cd ../..
./mvnw quarkus:dev

4. Start the Frontend

cd frontend
npm link @dti-isin/backend-api-client
npm run dev

Then open http://localhost:3000 in your browser.


🚒 Deployment Guide

πŸ“ Deploy on Localhost (for development)

  1. Start a local Hardhat node
  2. Deploy the smart contract to localhost
  3. Copy the deployed address and update frontend/src/config/config.ts

🌐 Deploy on Sepolia Testnet

  1. Edit .env inside /contracts:
PRIVATE_KEY=<your Sepolia private key>
INFURA_API_KEY=...
ETHERSCAN_API_KEY=...
  1. Deploy the contract:
npx hardhat run scripts/deploy.ts --network sepolia
  1. Update the frontend config
  2. (Optional) Verify on Etherscan
npx hardhat verify --network sepolia <contractAddress>

✨ Upgrade the Smart Contract (if needed)

npx hardhat run scripts/upgrade.ts --network sepolia

πŸ” Ensure PROXY_ADDRESS in .env is correct


πŸ“ Notes

  • Frontend uses VITE_INFURA_API_KEY from frontend/.env
  • You can switch networks by editing .env variables

πŸ§ͺ Testing Instructions

Frontend

cd frontend
npm run test

Backend

cd backend
./mvnw test

Smart Contracts

cd contracts
npx hardhat test

πŸ“Έ Screenshots

πŸ“„ All documents page

All documents page

🧾 Document details (certifications/revocations)

Document details

πŸ‘€ Profile page

Profile page

πŸ›‘οΈ Admin Dashboard

Admin view

πŸ“© Upload document

Upload document


πŸ‘₯ Authors

Antonio Marroffino

Luca FantΓ²


πŸ“œ License

This project was developed for educational purposes as part of the Bachelor's degree in Computer Engineering at SUPSI.

About

πŸ”— A full-stack platform to certify and revoke documents on Ethereum using smart contracts. Built with Quarkus, React, and Solidity, it includes role management, audit trails, and wallet integration.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages