Skip to content

IsinBlockchainTeam/KrostChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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


πŸ“¦ 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/IsinBlockchainTeam/KrostChain.git
cd KrostChain

2. Install dependencies

Frontend

cd frontend
npm install

Backend

cd backend
./mvnw install

Smart Contract

cd contracts
npm install

πŸš€ Run the Application (Locally)

0. Start the MySQL Database (via Docker)

Make sure you have Docker installed, then run:

docker run --name krostchain-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

cd blockchain
npx hardhat node

2. Deploy the contract to localhost

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

3. Copy the deployed contract address

It will appear in the terminal output (e.g. 0x...)

4. Update the frontend config

  • Open: frontend/src/config/config.ts
  • Replace the contractAddress with the one from step 3

🌐 Deploy on Sepolia Testnet

1. Edit .env inside /contracts

Make sure it contains:

PRIVATE_KEY=<your Sepolia private key>
INFURA_API_KEY=a10fdf5acfcb4352828dc0b7a6a27b64
ETHERSCAN_API_KEY=13S52KAKXZC6YQW3Y8X9E5ESP3WSSFZ81T

2. Deploy the contract to Sepolia

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

3. Update the frontend config

  • Open: frontend/src/config/config.ts
  • Replace the contractAddress with the new Sepolia address

4. (Optional) Verify the contract on Etherscan

npx hardhat verify --network sepolia <contractAddress>

✨ Upgrade the Smart Contract (if needed)

If you made changes to the contract and need to upgrade the deployed proxy, run:

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

πŸ” Make sure the address in .env (under PROXY_ADDRESS) is correct before running.


🌐 Notes

  • The frontend uses VITE_INFURA_API_KEY (set in frontend/.env)
  • The PROXY_ADDRESS is saved in .env for reference but not used automatically
  • You can switch between local and Sepolia by editing PRIVATE_KEY and the deployment network

πŸ§ͺ 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Γ²

About

Document Certification Platform on Blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published