Skip to content

Abhishek-B-R/DecenTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DecenTrack

DecenTrack is a fully decentralized uptime monitoring platform that leverages Ethereum smart contracts, validator-based reporting, and real-world browser checks to ensure accurate uptime data from across the globe. All uptime data and validator interactions are recorded immutably on the blockchain.


🧠 Features

  • 🌐 Decentralized Uptime Monitoring β€” Validators check website availability from their browser and log results on-chain.
  • πŸ” Ethereum Smart Contracts β€” Uptime data and validator interactions are stored trustlessly on Sepolia testnet.
  • πŸ’Ό Wallet Integration β€” Users can interact via their Ethereum wallets using Web3Modal.
  • πŸ“ˆ Validator Reward System β€” Validators are incentivized based on uptime check submissions.
  • πŸͺ„ Modern UI β€” Built with Tailwind CSS and Shadcn components for beautiful and accessible interfaces.
  • πŸ§‘β€πŸ’» Secure Auth β€” Clerk is used for role-based user authentication.

πŸ—οΈ Tech Stack

Layer Technologies
Frontend Next.js, React 19, Tailwind CSS, Shadcn/UI, Radix UI, Clerk
Backend Node.js, Express (for relayers or backend logic if used)
Blockchain Ethereum, Sepolia Testnet, Solidity, Hardhat, Ethers.js
WebSockets ws library for real-time communication between validators and the monitoring network
Email & SMS Nodemailer and Twilio used for optional notifications

πŸ”§ Smart Contracts

  • Written in Solidity
  • Compiled and deployed using Hardhat
  • Verified with Hardhat Verify
  • Gas usage measured via hardhat-gas-reporter
  • Type bindings generated using TypeChain
  • Coverage measured using solidity-coverage

Notable Smart Contract Functions:

  • registerWebsite(string url)
  • removeWebsite(uint id)
  • logUptime(uint id, uint latency, bool status)
  • withdrawEarnings()

🌐 Ethereum & Sepolia

  • The project is deployed on the Sepolia testnet for development.
  • Interactions use Ethers.js v6 and Hardhat Toolbox.
  • Supports validator registration and rewards distribution in ETH.

πŸ–ΌοΈ UI & Components

Frameworks & Libraries

  • Next.js 15.3.0
  • React 19
  • Tailwind CSS 4.1.4
  • tailwindcss-animate for animations
  • Web3Modal for wallet integration
  • Lucide React for clean and modern icons

Authentication

  • @clerk/nextjs for user sign-in, sign-up, and session management.

UI Library: Shadcn + Radix UI

Fully customizable and accessible components using:

Shadcn Components Used:

  • alert-dialog.tsx
  • alert.tsx
  • badge.tsx
  • button.tsx
  • card.tsx
  • dialog.tsx
  • dropdown-menu.tsx
  • input.tsx
  • label.tsx
  • loading-spinner.tsx
  • select.tsx
  • skeleton.tsx
  • table.tsx
  • tooltip.tsx

These components are styled with Tailwind, using clsx and class-variance-authority for conditional styles.


πŸ“¦ Dependencies

Runtime

  • @clerk/nextjs, next, react, tailwindcss, web3modal, ethers, twilio, nodemailer, ws

UI/Styling

  • @radix-ui/react-*, lucide-react, clsx, class-variance-authority, tailwind-merge, tailwindcss-animate

Type Safety and Utilities

  • @types/* for TypeScript support across all used packages
  • typescript v5+

πŸ§ͺ Dev & Testing Tools

  • Hardhat Toolbox for local blockchain development
  • TypeChain for type-safe contract calls
  • dotenv for managing environment variables
  • Chai for contract test assertions
  • ESLint for code quality
  • Solidity Coverage for test coverage reporting

πŸ”Œ WebSocket Validator Integration

  • Validators connect via WebSocket to listen for uptime check tasks.
  • Upon receiving a task, they verify website status and respond with latency and result.
  • Uses ws library for managing WebSocket connections.

🧩 Project Structure

/contracts        β†’ Solidity smart contracts
/pages            β†’ Next.js frontend routes
/components/ui    β†’ Shadcn/Radix UI components
/context          β†’ Wallet + Clerk Auth context
/scripts          β†’ Hardhat deploy + command scripts
/validator        β†’ Uptime checkers run as validators
/hub              β†’ Manages validator pool + assignments

βš™οΈ Deployment

  • Smart contracts deployed via Hardhat to Sepolia.
  • Frontend hosted on Vercel or similar platforms.
  • Environment variables managed securely using .env and dotenv.

βœ… Getting Started

πŸ“¦ Installation

1. Clone the Repo

git clone https://github.com/your-username/DecenTrack.git
cd DecenTrack

2. Use pnpm for package management. Make sure you have it installed globally:

npm install -g pnpm
pnpm install

3. Copy the example env file:

cp .env.example .env

πŸš€ Deployment (Sepolia)

1. Compile Contracts

pnpm hardhat compile

2. Deploy to Sepolia

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

⚠️ After deployment, update the deployed contract address in: /context/contractAddress.ts

πŸ” Hardhat Console

You can interact with your contract manually using the Hardhat console:

pnpm hardhat console --network sepolia

For a list of pre-built commands, refer to:

scripts/allCommands.js

πŸ’» Running the Full Project

Start all services (hub, validator, and Next.js site):

pnpm run startAll

Or to run the Next.js frontend alone:

pnpm dev

πŸ§ͺ Testing & Development Tools

  • Hardhat Toolbox for compiling, testing, and deploying.

  • TypeChain for type-safe contract interaction.

  • Solidity Coverage to monitor test coverage.

  • hardhat-gas-reporter to track gas usage.

πŸ™ Acknowledgements

  • Ethereum.org β€” Blockchain platform
  • Sepolia Testnet β€” For smart contract testing
  • Hardhat β€” Ethereum development environment
  • Ethers.js β€” Interact with Ethereum
  • Web3Modal β€” Wallet connector
  • Clerk.dev β€” Authentication system
  • Twilio β€” SMS Notifications
  • Nodemailer β€” Email alerts
  • Shadcn UI β€” UI components
  • Radix UI β€” Headless UI primitives
  • Tailwind CSS β€” Styling utility framework
  • Vercel β€” Hosting platform for frontend

✨ Author

Developed with ❀️ by Abhishek B R

About

A Decentralised Website Uptime Monitoring System. Created using advanced technologies like NextJs,Clerk,Hardhat,Shadcn,etc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors