Skip to content

star-warrior/HydroFi-hackout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ HydroFi - Green Hydrogen Credit System

A full-stack MERN application for managing green hydrogen production, certification, and carbon credit trading.

Node.js MongoDB React EthereumJavaScript

πŸ‘€ Take a look

Screen Shot 2025-09-02 at 12 52 02 PM

Heropage


πŸ› οΈ Features

  • πŸ” User Authentication: Secure JWT-based authentication with role-based access
  • πŸ“Š Role-Based Dashboards: Tailored interfaces for each user type
  • ⛓️ Blockchain Integration: ERC-1155 smart contracts for green hydrogen credits
  • πŸ’° Token Management: Mint, transfer, and retire carbon credits
  • πŸ”„ Real-time Data: Dynamic dashboard content based on user roles
  • πŸ”‘ Transfer by Identifier: Transfer tokens using username or factory ID
  • πŸ“œ Audit Trail: Complete transaction history and ownership tracking
  • πŸ“± Responsive Design: Modern UI compatible with all devices

⛓️ Blockchain Features

  • 🌐 ERC-1155 Multi-Token Standard: Efficient batch operations & metadata support
  • πŸ’¨ Green Hydrogen Credits: Each token represents verified green hydrogen production
  • πŸ•΅οΈ Ownership Tracking: Full history of token creation, transfers & retirement
  • 🏭 Factory-Based Minting: Tokens linked to specific production facilities
  • πŸ›‘ Pausable Contract: Emergency stop functionality for compliance
  • πŸ—‚οΈ Metadata Storage: Rich token info including production details

πŸ”„ How This Website Works

🎯 Complete Workflow Overview

HydroFi operates as a comprehensive ecosystem for green hydrogen credit management, connecting producers, buyers, regulators, and certification bodies in a transparent, blockchain-powered marketplace.

🏭 Producer Workflow

  1. πŸ” Registration & Setup

    • Producer registers with factory details
    • System auto-generates unique Factory ID (e.g., ABCD3057723X)
    • Receives dedicated wallet address for blockchain operations
    • Profile includes production capacity, location, and certifications
  2. ⚑ Production & Minting

    • Producer completes hydrogen production cycle
    • Mints ERC-1155 tokens representing verified green hydrogen credits
    • Each token contains immutable metadata: production date, quantity, factory ID
    • Blockchain records creation timestamp and producer identity
  3. πŸ“Š Dashboard Management

    • Monitor active credit inventory in real-time
    • Track production statistics and historical data
    • View token ownership history and transfer records
    • Access compliance reports and certification status
  4. πŸ’Ό Credit Trading

    • Transfer credits using username/Factory ID (simplified) or wallet addresses
    • Set transfer conditions and recipient verification
    • Real-time transaction notifications and confirmations
    • Maintain audit trail for regulatory compliance

πŸ›οΈ Admin/Regulatory Workflow

  1. πŸ” System Oversight

    • Advanced search across all tokens, factories, and transactions
    • Real-time monitoring of market activity and compliance
    • Export capabilities for regulatory reporting and analysis
    • User management and role-based access control
  2. πŸ“ˆ Analytics & Reporting

    • Market intelligence with production trends and trading patterns
    • Compliance tracking with automated violation detection
    • Statistical dashboards showing system-wide metrics
    • Custom reports for stakeholders and government agencies
  3. πŸ›‘οΈ Fraud Prevention

    • Blockchain verification of all transactions and ownership
    • Double-spending prevention through token retirement
    • Identity verification and factory authentication
    • Suspicious activity alerts and investigation tools

πŸ—ΊοΈ Interactive Map Feature

πŸ“ Global Production Visualization

  • Interactive world map showing green hydrogen production facilities
  • Real-time data points with production capacity and status indicators
  • Factory clustering in high-density regions with zoom capabilities
  • Regional statistics showing production volumes and market activity

🎯 Map Functionality

  • Click-to-explore factory details, production history, and certifications
  • Filter options by production capacity, certification status, and activity level
  • Trade route visualization showing credit transfer patterns between regions
  • Market heat maps indicating high-activity trading zones

πŸ“Š Geographic Intelligence

  • Regional compliance tracking with jurisdiction-specific requirements
  • Supply chain mapping from production to end-use consumption
  • Logistics optimization for physical hydrogen delivery coordination
  • Market penetration analysis by geographic region

🧠 Trade Intelligence System

πŸ“ˆ Smart Analytics Engine

  • Machine learning algorithms analyzing trading patterns and market trends
  • Price discovery mechanisms based on supply, demand, and quality metrics
  • Predictive modeling for future market conditions and pricing
  • Risk assessment tools for credit quality and counterparty evaluation

πŸ’‘ Intelligent Insights

  • Market recommendations for optimal trading timing and strategies
  • Quality scoring based on production methods, certifications, and history
  • Demand forecasting using historical data and industry trends
  • Portfolio optimization suggestions for buyers and investors

πŸ”„ Automated Features

  • Smart notifications for market opportunities and price alerts
  • Automated compliance checking for regulatory requirements
  • Trade matching algorithms connecting buyers with suitable sellers
  • Dynamic pricing recommendations based on real-time market data

οΏ½ Business Intelligence Dashboard

  • Real-time market metrics including volume, pricing, and activity
  • Trend analysis with interactive charts and historical comparisons
  • Performance benchmarking against industry standards and competitors
  • Custom KPI tracking for individual organizations and market segments

πŸ”— Integration Ecosystem

  • API connectivity for third-party systems and enterprise integration

  • Webhook notifications for real-time updates and automation

  • Data export capabilities for external analytics and reporting

  • Compliance integration with regulatory systems and standards

  • πŸ” User Authentication: Secure JWT-based authentication with role-based access

  • πŸ“Š Role-Based Dashboards: Tailored interfaces for each user type

  • ⛓️ Blockchain Integration: ERC-1155 smart contracts for green hydrogen credits

  • πŸ’° Token Management: Mint, transfer, and retire carbon credits

  • πŸ”„ Real-time Data: Dynamic dashboard content based on user roles

  • πŸ”‘ Transfer by Identifier: Transfer tokens using username or factory ID

  • πŸ“œ Audit Trail: Complete transaction history and ownership tracking

  • πŸ“± Responsive Design: Modern UI compatible with all devices


⛓️ Blockchain Features

  • 🌐 ERC-1155 Multi-Token Standard: Efficient batch operations & metadata support
  • πŸ’¨ Green Hydrogen Credits: Each token represents verified green hydrogen production
  • πŸ•΅οΈ Ownership Tracking: Full history of token creation, transfers & retirement
  • 🏭 Factory-Based Minting: Tokens linked to specific production facilities
  • πŸ›‘ Pausable Contract: Emergency stop functionality for compliance
  • πŸ—‚οΈ Metadata Storage: Rich token info including production details

οΏ½ How This Website Works

🎯 Complete Workflow Overview

HydroFi operates as a comprehensive ecosystem for green hydrogen credit management, connecting producers, buyers, regulators, and certification bodies in a transparent, blockchain-powered marketplace.

🏭 Producer Workflow

  1. πŸ” Registration & Setup

    • Producer registers with factory details
    • System auto-generates unique Factory ID (e.g., ABCD3057723X)
    • Receives dedicated wallet address for blockchain operations
    • Profile includes production capacity, location, and certifications
  2. ⚑ Production & Minting

    • Producer completes hydrogen production cycle
    • Mints ERC-1155 tokens representing verified green hydrogen credits
    • Each token contains immutable metadata: production date, quantity, factory ID
    • Blockchain records creation timestamp and producer identity
  3. πŸ“Š Dashboard Management

    • Monitor active credit inventory in real-time
    • Track production statistics and historical data
    • View token ownership history and transfer records
    • Access compliance reports and certification status
  4. πŸ’Ό Credit Trading

    • Transfer credits using username/Factory ID (simplified) or wallet addresses
    • Set transfer conditions and recipient verification
    • Real-time transaction notifications and confirmations
    • Maintain audit trail for regulatory compliance

πŸ›οΈ Admin/Regulatory Workflow

  1. πŸ” System Oversight

    • Advanced search across all tokens, factories, and transactions
    • Real-time monitoring of market activity and compliance
    • Export capabilities for regulatory reporting and analysis
    • User management and role-based access control
  2. πŸ“ˆ Analytics & Reporting

    • Market intelligence with production trends and trading patterns
    • Compliance tracking with automated violation detection
    • Statistical dashboards showing system-wide metrics
    • Custom reports for stakeholders and government agencies
  3. πŸ›‘οΈ Fraud Prevention

    • Blockchain verification of all transactions and ownership
    • Double-spending prevention through token retirement
    • Identity verification and factory authentication
    • Suspicious activity alerts and investigation tools

πŸ—ΊοΈ Interactive Map Feature

πŸ“ Global Production Visualization

  • Interactive world map showing green hydrogen production facilities
  • Real-time data points with production capacity and status indicators
  • Factory clustering in high-density regions with zoom capabilities
  • Regional statistics showing production volumes and market activity

🎯 Map Functionality

  • Click-to-explore factory details, production history, and certifications
  • Filter options by production capacity, certification status, and activity level
  • Trade route visualization showing credit transfer patterns between regions
  • Market heat maps indicating high-activity trading zones

πŸ“Š Geographic Intelligence

  • Regional compliance tracking with jurisdiction-specific requirements
  • Supply chain mapping from production to end-use consumption
  • Logistics optimization for physical hydrogen delivery coordination
  • Market penetration analysis by geographic region

🧠 Trade Intelligence System

πŸ“ˆ Smart Analytics Engine

  • Machine learning algorithms analyzing trading patterns and market trends
  • Price discovery mechanisms based on supply, demand, and quality metrics
  • Predictive modeling for future market conditions and pricing
  • Risk assessment tools for credit quality and counterparty evaluation

πŸ’‘ Intelligent Insights

  • Market recommendations for optimal trading timing and strategies
  • Quality scoring based on production methods, certifications, and history
  • Demand forecasting using historical data and industry trends
  • Portfolio optimization suggestions for buyers and investors

πŸ”„ Automated Features

  • Smart notifications for market opportunities and price alerts
  • Automated compliance checking for regulatory requirements
  • Trade matching algorithms connecting buyers with suitable sellers
  • Dynamic pricing recommendations based on real-time market data

πŸ“Š Business Intelligence Dashboard

  • Real-time market metrics including volume, pricing, and activity
  • Trend analysis with interactive charts and historical comparisons
  • Performance benchmarking against industry standards and competitors
  • Custom KPI tracking for individual organizations and market segments

πŸ”— Integration Ecosystem

  • API connectivity for third-party systems and enterprise integration
  • Webhook notifications for real-time updates and automation
  • Data export capabilities for external analytics and reporting
  • Compliance integration with regulatory systems and standards
  • Automated compliance checking for regulatory requirements
  • Trade matching algorithms connecting buyers with suitable sellers
  • Dynamic pricing recommendations based on real-time market data

πŸ“Š Business Intelligence Dashboard

  • Real-time market metrics including volume, pricing, and activity
  • Trend analysis with interactive charts and historical comparisons
  • Performance benchmarking against industry standards and competitors
  • Custom KPI tracking for individual organizations and market segments

πŸ”— Integration Ecosystem

  • API connectivity for third-party systems and enterprise integration
  • Webhook notifications for real-time updates and automation
  • Data export capabilities for external analytics and reporting
  • Compliance integration with regulatory systems and standards

οΏ½πŸ‘₯ User Roles

Role Description
🏭 Green Hydrogen Producer Manage production & mint carbon credits
πŸ›οΈ Regulatory Authority Oversee compliance, audit transactions, advanced search
πŸ›’ Industry Buyer Purchase and manage carbon credit portfolios
βœ… Certification Body Conduct inspections and issue certifications

πŸ’» Technology Stack

Backend

  • Node.js & Express.js
  • MongoDB with Mongoose
  • JWT for authentication
  • bcryptjs for password hashing

Frontend

  • React 18 with Vite
  • React Router for navigation
  • Axios for API calls
  • Context API for state management

βš™οΈ Installation and Setup

Prerequisites

  • Node.js (v16+)
  • MongoDB (local or Atlas)
  • npm or yarn

Blockchain/Smart Contract Setup

cd contracts
npm install

Create .env with:

PRIVATE_KEY=0xac0974... # Replace for production

Start Hardhat local network:

npx hardhat node

Deploy contract:

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

(Optional) List accounts:

npx hardhat run scripts/list-accounts.js --network localhost

Backend Setup

cd backend
npm install

Create .env with:

PORT=5000
MONGODB_URI=mongodb://localhost:27017/hydrofi_db
JWT_SECRET=your_super_secret_jwt_key_here_change_in_production
BLOCKCHAIN_RPC_URL=http://localhost:8545
WALLET_PRIVATE_KEY=0xac0974...
DEFAULT_WALLET_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

Run wallet migration (if needed):

node migrate-wallets.js

Start backend server:

npm run dev

Frontend Setup

cd frontend
npm install
npm run dev

Access app at:


πŸ› οΈ Troubleshooting & Verification

Common Issues

Issue Fix
Contract deployment fails Ensure Hardhat node is running and port 8545 is free
Backend can't connect Verify .env URLs, ensure contract deployed, Hardhat node running
Tokens not appearing Check console errors, unique wallet addresses, emitted events
Transfers fail Verify recipient exists & token ownership, check blockchain stability

Setup Verification

  • βœ… Hardhat node mining activity on transactions
  • βœ… Contract deployed with visible address
  • βœ… Backend logs "Blockchain service initialized successfully"
  • βœ… Frontend registration & login working

πŸ“‘ Development Commands

# Reset blockchain data
cd contracts
npx hardhat clean
npx hardhat node

# Redeploy contract
npx hardhat run scripts/deploy.js --network localhost

# List accounts
npx hardhat run scripts/list-accounts.js --network localhost

πŸ”— API Endpoints

Authentication

Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login user
GET /api/auth/me Get current user (protected)

Dashboard

Endpoint Description
GET /api/dashboard/data Role-based dashboard data (protected)
GET /api/dashboard/producer Producer-specific data (protected)
GET /api/dashboard/regulatory Regulatory data (protected)
GET /api/dashboard/buyer Buyer data (protected)
GET /api/dashboard/certification Certification data (protected)

πŸ“ Usage Guide

  1. πŸ“ Register with selected role & credentials
  2. πŸ” Login to access role-specific dashboard
  3. πŸ“Š View and manage data/actions as per role
  4. πŸ”„ Navigate using the navbar; logout when done

πŸ“‚ Project Structure

HydroFi_Final/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ middleware/auth.js
β”‚   β”œβ”€β”€ models/User.js, Transaction.js
β”‚   β”œβ”€β”€ routes/auth.js, dashboard.js, blockchain.js
β”‚   β”œβ”€β”€ services/blockchainService.js
β”‚   β”œβ”€β”€ contract-data.json, migrate-wallets.js, .env, package.json, server.js
β”œβ”€β”€ contracts/
β”‚   β”œβ”€β”€ contracts/GreenHydrogenCredits.sol
β”‚   β”œβ”€β”€ scripts/deploy.js, list-accounts.js
β”‚   β”œβ”€β”€ artifacts/, cache/, .env, hardhat.config.js, package.json
└── frontend/
    β”œβ”€β”€ src/components/auth/, dashboards/, EnhancedTransferComponent.jsx, WalletHelper.jsx, Home.jsx, Navbar.jsx
    β”œβ”€β”€ contexts/AuthContext.jsx, BlockchainContext.jsx
    β”œβ”€β”€ App.jsx, index.css, main.jsx
    β”œβ”€β”€ index.html, package.json, vite.config.js

πŸ” Security Features

  • πŸ”’ Password hashing with bcryptjs
  • 🧩 JWT-based stateless authentication
  • πŸ›‘οΈ Role-based route protection
  • 🧹 Input validation & sanitization
  • 🌍 CORS configuration

πŸš€ Future Enhancements

  • ⛓️ Real blockchain integration
  • πŸ“ˆ Advanced analytics & reporting
  • πŸ”” Real-time notifications
  • πŸ“ Certificate file uploads
  • πŸ” Advanced search & filtering
  • πŸ“§ Email verification & password reset

🀝 Contributing

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
  3. πŸ’Ύ Commit changes
  4. πŸš€ Push to branch
  5. πŸ”ƒ Create a Pull Request

πŸ“„ License

This project is licensed under the MIT License.
License: MIT


About

Hackout 25 project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •