Developed for the Smart India Hackathon (SIH)
BlueChain is an end-to-end, blockchain-powered Blue Carbon Monitoring, Reporting, and Verification (MRV) platform. It combines satellite Earth observation (Sentinel-2 via Google Earth Engine), automated IPCC carbon sequestration modeling, an immutable verification workflow, and on-chain tokenization on Polygon to eliminate greenwashing and accelerate coastal restoration finance.
| Capability | Description |
|---|---|
| π°οΈ AI Explorer & Geospatial Mapping | Interactive Leaflet-powered satellite map with polygon boundary drawing, real-time vegetation indices (NDVI, NDWI, EVI, MNDWI), and automatic carbon potential estimation. |
| π‘οΈ Role-Based Access Control (RBAC) | Dedicated portal views and permissions for Admin, Government Official (Verifier), NGO Representative, and Company Buyer. |
| π Full Lifecycle Project State Machine | Complete review state transitions (Pending β Under Review β Correction Required β Verified or Rejected) with full verifier feedback integration. |
| π NGO Edit & Resubmit Workflow | When corrections are requested, NGOs review the verifier's feedback, update permitted project metadata, and resubmit directly back to the assigned verifier without losing assignment context. |
| π Tamper-Proof Protected Fields | Critical fields (status, assigned_verifier, verifier_notes, verified_at, active, created_by) are strictly protected at the API level against unauthorized direct modifications. |
| βοΈ Web3 Carbon Credit Minting | Verified projects can be minted directly onto Polygon Amoy / local Hardhat EVM contracts by authorized verifiers or admins. |
| π Carbon Credit Marketplace | Public registry browsing, live credit pricing, MetaMask wallet integration, credit purchase execution, and permanent token retirement. |
| π Dynamic Analytical Dashboards | Role-tailored dashboard statistics, real-time credit issuance summaries, project state breakdowns, and PDF MRV report downloads. |
flowchart TB
subgraph Client["Frontend Client (React + Vite + TypeScript)"]
UI["Web Portal (Dashboard, AI Explorer, Marketplace, Review Queue)"]
MetaMask["MetaMask Wallet (Web3 Provider)"]
end
subgraph BackendGateway["Django REST API (Port 8000)"]
Auth["JWT Auth & Role Guard"]
ProjMgr["Project & Company Manager"]
Workflow["Verification State Machine Engine"]
TxMgr["Carbon Transaction Ledger"]
PDF["MRV Report Generator"]
end
subgraph AIService["AI & Remote Sensing Engine (FastAPI - Port 8001)"]
GEE["Google Earth Engine API"]
Sentinel["Sentinel-2 Multispectral Ingestion"]
NDVI["Spectral Indices (NDVI, NDWI, EVI)"]
CarbonEst["IPCC Wetland Carbon Biomass Estimator"]
end
subgraph DecentralizedLayer["Decentralized Storage & Blockchain"]
IPFS["Pinata IPFS Gateway (Metadata & Reports)"]
HardhatNode["Hardhat Node / Polygon Network (Port 8545)"]
Contract["CarbonLedger.sol (ERC-20 Token & Registry)"]
end
UI -->|REST API / JWT| Auth
UI -->|Web3 RPC / Ethers.js| MetaMask
MetaMask -->|Contract Calls| Contract
Auth --> ProjMgr
ProjMgr --> Workflow
Workflow --> TxMgr
TxMgr --> PDF
UI -->|Geospatial Analysis| AIService
AIService --> GEE
GEE --> Sentinel
Sentinel --> NDVI --> CarbonEst
TxMgr -->|Pin Report CIDs| IPFS
TxMgr -->|Sync Mint & Transfer Events| Contract
Contract --> HardhatNode
The verification pipeline enforces a strict state machine across all roles:
stateDiagram-v2
[*] --> Pending: NGO Registers Project
Pending --> UnderReview: Admin Assigns Verifier
state UnderReview {
[*] --> InReview
InReview --> VerifierReview: Inspect Satellite MRV & Ground Data
}
UnderReview --> Verified: Verifier Approves (verified_at set, active=True)
UnderReview --> CorrectionRequired: Verifier Requests Changes (Notes Required)
UnderReview --> Rejected: Verifier Rejects (active=False, Notes Required)
CorrectionRequired --> UnderReview: NGO Edits Metadata & Resubmits
Verified --> Minted: Verifier/Admin Mints ERC-20 Credits
Minted --> Marketplace: Credits Listed for Purchase
Marketplace --> Retired: Buyer Retires Credits
Rejected --> [*]
Retired --> [*]
djangorestframework-simplejwt (JWT Access & Refresh Tokens)django-cors-headersearthengine-api), Copernicus Sentinel-2 Level-2A^0.8.20, OpenZeppelin ContractsBlueChain/
βββ ai-service/ # FastAPI Remote Sensing & Carbon Modeling Service
β βββ api/ # REST API routers & schemas
β β βββ routes.py # Point & polygon analysis endpoints
β βββ carbon/ # IPCC carbon density & biomass calculators
β βββ gee/ # Google Earth Engine Sentinel-2 connectors
β βββ models/ # Pydantic request & response models
β βββ ndvi/ # Spectral index calculators (NDVI, NDWI, EVI, MNDWI)
β βββ app.py # FastAPI application initialization & GEE startup
β βββ requirements.txt # AI service Python dependencies
β
βββ backend/ # Django REST Framework Central API
β βββ api/ # Main BlueChain application
β β βββ migrations/ # Database schema migrations
β β βββ models.py # Company, User/Profile, CarbonTransaction, PricingConfig
β β βββ serializers.py # DRF serializers & validation rules
β β βββ views.py # ViewSets, review actions, resubmit, & minting views
β β βββ urls.py # Sub-router API endpoint mapping
β β βββ permissions.py # RBAC role permissions
β β βββ pinata.py # IPFS pinning client & fallback handler
β βββ clapi/ # Django project configuration & settings
β β βββ settings.py # App settings, DB config, JWT & CORS setup
β β βββ urls.py # Root URL router (/api/v1/)
β βββ manage.py # Django CLI entrypoint
β βββ requirements.txt # Backend Python dependencies
β
βββ blockchain/ # Hardhat EVM & Smart Contract Environment
β βββ contracts/ # Solidity smart contracts
β β βββ CarbonLedger.sol # ERC-20 token, registry, & verification contract
β βββ scripts/ # Deployment and transaction scripts
β β βββ deploy.js # Contract deployment script
β β βββ mintCreditsAmoy.js # Credit minting script
β β βββ transferCreditsAmoy.js
β βββ hardhat.config.ts # Hardhat configuration (Solidity compiler & networks)
β βββ package.json # Blockchain development dependencies
β
βββ frontend/ # React 19 + Vite Frontend Application
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ Header.tsx # Navigation bar with role-based routing
β β β βββ ProtectedRoute.tsx # Route security & RBAC guard
β β β βββ StatusBadge.tsx # Color-coded workflow badge component
β β β βββ NGOEditResubmitModal.tsx # NGO metadata correction modal
β β β βββ VerifierReviewModal.tsx # Verifier approval/rejection modal
β β β βββ ui/ # Radix UI library components
β β βββ contexts/ # React AuthContext (JWT session management)
β β βββ lib/ # API client utilities (apiFetch, token handling)
β β βββ pages/ # Main application views
β β β βββ LandingPage.tsx # Hero landing page
β β β βββ Dashboard.tsx # Role-tailored dashboard
β β β βββ AdminDashboard.tsx # Admin verifier assignment & user management
β β β βββ VerifierDashboard.tsx # Independent verification queue
β β β βββ Marketplace.tsx # Carbon credit marketplace & purchasing
β β β βββ AiExplorer.tsx # Geospatial satellite map analysis
β β β βββ ProjectRegistration.tsx # NGO project onboarding
β β β βββ Profile.tsx # User profile, wallet, & project list
β β β βββ Login.tsx # Authentication entry
β β β βββ Register.tsx # Public registration page
β β βββ App.tsx # Main application router
β β βββ main.tsx # React DOM entrypoint
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite build & proxy settings
β
βββ docs/ # Architecture & API documentation
βββ .env.example # Environment variable templates
βββ pnpm-workspace.yaml # PNPM monorepo workspace definition
βββ README.md # Project documentation
v18.0.0+ or v20.0.0+v9.0.0+ (Run npm install -g pnpm)3.10+ or 3.12+# Navigate to the backend directory
cd backend
# Create and activate a Python virtual environment
python -m venv .venv
# On Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate
# Install required dependencies
pip install -r requirements.txt
# Run migrations to initialize SQLite/PostgreSQL
python manage.py migrate
# (Optional) Create a superuser for Django admin
python manage.py createsuperuser
# Start the Django development server (runs on port 8000)
python manage.py runserver 8000
# Open a new terminal and navigate to ai-service
cd ai-service
# Create and activate virtual environment
python -m venv .venv
# On Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# (Optional) Authenticate with Google Earth Engine
earthengine authenticate
# Start the FastAPI AI service (runs on port 8001)
uvicorn app:app --host 127.0.0.1 --port 8001 --reload
Note: If Google Earth Engine credentials are not configured, the service automatically runs in high-fidelity IPCC fallback mode for local testing without breaking any frontend workflows.
# Open a new terminal and navigate to blockchain
cd blockchain
# Install blockchain dependencies
pnpm install
# Start a local Hardhat Ethereum node (runs on port 8545)
pnpm hardhat node
In a separate terminal, deploy the CarbonLedger.sol contract to the local network:
cd blockchain
pnpm hardhat run scripts/deploy.js --network localhost
Copy the deployed contract address and add it to your .env files.
# Open a new terminal and navigate to frontend
cd frontend
# Install frontend dependencies
pnpm install
# Start the Vite development server (runs on http://localhost:5173)
pnpm dev
Open your browser and navigate to http://localhost:5173.
Copy the example environment configurations to their respective directories:
backend/.env)DEBUG=True
SECRET_KEY=your-django-secret-key-here
ALLOWED_HOSTS=localhost,127.0.0.1
WEB3_PROVIDER_URL=http://127.0.0.1:8545
CONTRACT_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
PINATA_API_KEY=your-pinata-api-key
PINATA_SECRET_API_KEY=your-pinata-secret-key
PINATA_JWT=your-pinata-jwt-token
AI_SERVICE_URL=http://127.0.0.1:8001
ai-service/.env)GEE_PROJECT_ID=carbonledger-503508
GOOGLE_APPLICATION_CREDENTIALS=./auth/gee-credentials.json
MAPBOX_ACCESS_TOKEN=your-mapbox-token
frontend/.env)VITE_API_URL=http://127.0.0.1:8000/api/v1
VITE_AI_SERVICE_URL=http://127.0.0.1:8001
VITE_BLOCKCHAIN_RPC=http://127.0.0.1:8545
VITE_CONTRACT_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
All backend endpoints are prefixed with /api/v1/:
POST /api/v1/register/ β Register a new account (NGO Representative or Company Buyer).POST /api/token/ β Obtain JWT access and refresh tokens.POST /api/token/refresh/ β Refresh expired JWT access token.GET /api/v1/me/ β Retrieve the currently authenticated profile and assigned role.GET /api/v1/CarbonLedger/ β List projects (scoped by role for NGOs/Buyers; platform-wide for Admin/Verifier; verified only for public marketplace).POST /api/v1/CarbonLedger/ β Register a new blue carbon project (NGO only; initial status Pending).GET /api/v1/CarbonLedger/<id>/ β Retrieve detailed project metadata and verifier feedback notes.PATCH /api/v1/CarbonLedger/<id>/ β Update permitted project metadata (protected fields blocked).GET /api/v1/CarbonLedger/<id>/report/ β Download generated PDF MRV report.GET /api/v1/admin/users/ β List and create platform users (Admin only).POST /api/v1/admin/projects/<id>/assign-verifier/ β Assign a Government Official to a Pending project (transitions to Under Review).POST /api/v1/projects/<id>/review/ β Submit verifier review (action: "approve" | "request_correction" | "reject", with mandatory notes).POST /api/v1/projects/<id>/resubmit/ β NGO resubmission of a Correction Required project (transitions to Under Review).POST /api/v1/company/<id>/mint/ β Mint on-chain carbon credits for a Verified project (assigned Verifier or Admin only).GET /api/v1/pricing/ β Get or update carbon credit benchmark price configuration.POST /api/v1/CarbonLedgerTransactions/ β Execute a credit purchase (transaction_type: "Recieve") or retirement.GET /api/v1/dashboard-stats/ β Real-time analytical statistics aggregated by user role.GET /health β Service status and Earth Engine connection state.POST /api/v1/analyze/point β Point coordinate satellite analysis (NDVI mean, canopy cover %, carbon tonnes).POST /api/v1/analyze β GeoJSON polygon boundary analysis and spatial carbon heatmaps.| Feature / Action | Admin | Government Official (Verifier) | NGO Representative | Company Buyer | Public (Guest) |
|---|---|---|---|---|---|
| Browse Marketplace | β | β | β | β | β |
| Use AI Explorer | β | β | β | β | β |
| Register New Project | β | β | β | β | β |
| Edit Project Metadata | β (All) | β | β (Own Only) | β | β |
| Assign Verifier | β | β | β | β | β |
| Review Project (Approve / Reject / Correction) | β | β (Assigned Only) | β | β | β |
Resubmit Project (Correction Required) | β | β | β (Own Only) | β | β |
| Direct Status Override (PATCH) | β (Blocked) | β (Blocked) | β (Blocked) | β (Blocked) | β (Blocked) |
| Mint Carbon Credits | β | β (Assigned Only) | β | β | β |
| Purchase Carbon Credits | β | β | β | β | β |
Access /admin Dashboard | β | β | β | β | β |
Access /verifier Review Queue | β | β | β | β | β |
The codebase includes comprehensive static analysis and automated verification suites:
cd backend
# Check system models and dependencies
python manage.py check
# Verify database migrations integrity
python manage.py makemigrations --check
python manage.py migrate --plan
cd frontend
# TypeScript static type check (0 errors)
pnpm tsc --noEmit
# Production bundle build test
pnpm build
cd blockchain
# Compile Solidity contracts
pnpm hardhat compile
# Run Hardhat test suite
pnpm hardhat test
Developed with pride for the Smart India Hackathon (SIH).
develop (git checkout -b feature/your-feature-name).pnpm tsc --noEmit) before opening a pull request..env files to git.This project is licensed under the MIT License β see the LICENSE file for details.
Developed for the Smart India Hackathon (SIH)
BlueChain is an end-to-end, blockchain-powered Blue Carbon Monitoring, Reporting, and Verification (MRV) platform. It combines satellite Earth observation (Sentinel-2 via Google Earth Engine), automated IPCC carbon sequestration modeling, an immutable verification workflow, and on-chain tokenization on Polygon to eliminate greenwashing and accelerate coastal restoration finance.
| Capability | Description |
|---|---|
| π°οΈ AI Explorer & Geospatial Mapping | Interactive Leaflet-powered satellite map with polygon boundary drawing, real-time vegetation indices (NDVI, NDWI, EVI, MNDWI), and automatic carbon potential estimation. |
| π‘οΈ Role-Based Access Control (RBAC) | Dedicated portal views and permissions for Admin, Government Official (Verifier), NGO Representative, and Company Buyer. |
| π Full Lifecycle Project State Machine | Complete review state transitions (Pending β Under Review β Correction Required β Verified or Rejected) with full verifier feedback integration. |
| π NGO Edit & Resubmit Workflow | When corrections are requested, NGOs review the verifier's feedback, update permitted project metadata, and resubmit directly back to the assigned verifier without losing assignment context. |
| π Tamper-Proof Protected Fields | Critical fields (status, assigned_verifier, verifier_notes, verified_at, active, created_by) are strictly protected at the API level against unauthorized direct modifications. |
| βοΈ Web3 Carbon Credit Minting | Verified projects can be minted directly onto Polygon Amoy / local Hardhat EVM contracts by authorized verifiers or admins. |
| π Carbon Credit Marketplace | Public registry browsing, live credit pricing, MetaMask wallet integration, credit purchase execution, and permanent token retirement. |
| π Dynamic Analytical Dashboards | Role-tailored dashboard statistics, real-time credit issuance summaries, project state breakdowns, and PDF MRV report downloads. |
flowchart TB
subgraph Client["Frontend Client (React + Vite + TypeScript)"]
UI["Web Portal (Dashboard, AI Explorer, Marketplace, Review Queue)"]
MetaMask["MetaMask Wallet (Web3 Provider)"]
end
subgraph BackendGateway["Django REST API (Port 8000)"]
Auth["JWT Auth & Role Guard"]
ProjMgr["Project & Company Manager"]
Workflow["Verification State Machine Engine"]
TxMgr["Carbon Transaction Ledger"]
PDF["MRV Report Generator"]
end
subgraph AIService["AI & Remote Sensing Engine (FastAPI - Port 8001)"]
GEE["Google Earth Engine API"]
Sentinel["Sentinel-2 Multispectral Ingestion"]
NDVI["Spectral Indices (NDVI, NDWI, EVI)"]
CarbonEst["IPCC Wetland Carbon Biomass Estimator"]
end
subgraph DecentralizedLayer["Decentralized Storage & Blockchain"]
IPFS["Pinata IPFS Gateway (Metadata & Reports)"]
HardhatNode["Hardhat Node / Polygon Network (Port 8545)"]
Contract["CarbonLedger.sol (ERC-20 Token & Registry)"]
end
UI -->|REST API / JWT| Auth
UI -->|Web3 RPC / Ethers.js| MetaMask
MetaMask -->|Contract Calls| Contract
Auth --> ProjMgr
ProjMgr --> Workflow
Workflow --> TxMgr
TxMgr --> PDF
UI -->|Geospatial Analysis| AIService
AIService --> GEE
GEE --> Sentinel
Sentinel --> NDVI --> CarbonEst
TxMgr -->|Pin Report CIDs| IPFS
TxMgr -->|Sync Mint & Transfer Events| Contract
Contract --> HardhatNode
The verification pipeline enforces a strict state machine across all roles:
stateDiagram-v2
[*] --> Pending: NGO Registers Project
Pending --> UnderReview: Admin Assigns Verifier
state UnderReview {
[*] --> InReview
InReview --> VerifierReview: Inspect Satellite MRV & Ground Data
}
UnderReview --> Verified: Verifier Approves (verified_at set, active=True)
UnderReview --> CorrectionRequired: Verifier Requests Changes (Notes Required)
UnderReview --> Rejected: Verifier Rejects (active=False, Notes Required)
CorrectionRequired --> UnderReview: NGO Edits Metadata & Resubmits
Verified --> Minted: Verifier/Admin Mints ERC-20 Credits
Minted --> Marketplace: Credits Listed for Purchase
Marketplace --> Retired: Buyer Retires Credits
Rejected --> [*]
Retired --> [*]
djangorestframework-simplejwt (JWT Access & Refresh Tokens)django-cors-headersearthengine-api), Copernicus Sentinel-2 Level-2A^0.8.20, OpenZeppelin ContractsBlueChain/
βββ ai-service/ # FastAPI Remote Sensing & Carbon Modeling Service
β βββ api/ # REST API routers & schemas
β β βββ routes.py # Point & polygon analysis endpoints
β βββ carbon/ # IPCC carbon density & biomass calculators
β βββ gee/ # Google Earth Engine Sentinel-2 connectors
β βββ models/ # Pydantic request & response models
β βββ ndvi/ # Spectral index calculators (NDVI, NDWI, EVI, MNDWI)
β βββ app.py # FastAPI application initialization & GEE startup
β βββ requirements.txt # AI service Python dependencies
β
βββ backend/ # Django REST Framework Central API
β βββ api/ # Main BlueChain application
β β βββ migrations/ # Database schema migrations
β β βββ models.py # Company, User/Profile, CarbonTransaction, PricingConfig
β β βββ serializers.py # DRF serializers & validation rules
β β βββ views.py # ViewSets, review actions, resubmit, & minting views
β β βββ urls.py # Sub-router API endpoint mapping
β β βββ permissions.py # RBAC role permissions
β β βββ pinata.py # IPFS pinning client & fallback handler
β βββ clapi/ # Django project configuration & settings
β β βββ settings.py # App settings, DB config, JWT & CORS setup
β β βββ urls.py # Root URL router (/api/v1/)
β βββ manage.py # Django CLI entrypoint
β βββ requirements.txt # Backend Python dependencies
β
βββ blockchain/ # Hardhat EVM & Smart Contract Environment
β βββ contracts/ # Solidity smart contracts
β β βββ CarbonLedger.sol # ERC-20 token, registry, & verification contract
β βββ scripts/ # Deployment and transaction scripts
β β βββ deploy.js # Contract deployment script
β β βββ mintCreditsAmoy.js # Credit minting script
β β βββ transferCreditsAmoy.js
β βββ hardhat.config.ts # Hardhat configuration (Solidity compiler & networks)
β βββ package.json # Blockchain development dependencies
β
βββ frontend/ # React 19 + Vite Frontend Application
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ Header.tsx # Navigation bar with role-based routing
β β β βββ ProtectedRoute.tsx # Route security & RBAC guard
β β β βββ StatusBadge.tsx # Color-coded workflow badge component
β β β βββ NGOEditResubmitModal.tsx # NGO metadata correction modal
β β β βββ VerifierReviewModal.tsx # Verifier approval/rejection modal
β β β βββ ui/ # Radix UI library components
β β βββ contexts/ # React AuthContext (JWT session management)
β β βββ lib/ # API client utilities (apiFetch, token handling)
β β βββ pages/ # Main application views
β β β βββ LandingPage.tsx # Hero landing page
β β β βββ Dashboard.tsx # Role-tailored dashboard
β β β βββ AdminDashboard.tsx # Admin verifier assignment & user management
β β β βββ VerifierDashboard.tsx # Independent verification queue
β β β βββ Marketplace.tsx # Carbon credit marketplace & purchasing
β β β βββ AiExplorer.tsx # Geospatial satellite map analysis
β β β βββ ProjectRegistration.tsx # NGO project onboarding
β β β βββ Profile.tsx # User profile, wallet, & project list
β β β βββ Login.tsx # Authentication entry
β β β βββ Register.tsx # Public registration page
β β βββ App.tsx # Main application router
β β βββ main.tsx # React DOM entrypoint
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite build & proxy settings
β
βββ docs/ # Architecture & API documentation
βββ .env.example # Environment variable templates
βββ pnpm-workspace.yaml # PNPM monorepo workspace definition
βββ README.md # Project documentation
v18.0.0+ or v20.0.0+v9.0.0+ (Run npm install -g pnpm)3.10+ or 3.12+# Navigate to the backend directory
cd backend
# Create and activate a Python virtual environment
python -m venv .venv
# On Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate
# Install required dependencies
pip install -r requirements.txt
# Run migrations to initialize SQLite/PostgreSQL
python manage.py migrate
# (Optional) Create a superuser for Django admin
python manage.py createsuperuser
# Start the Django development server (runs on port 8000)
python manage.py runserver 8000
# Open a new terminal and navigate to ai-service
cd ai-service
# Create and activate virtual environment
python -m venv .venv
# On Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# (Optional) Authenticate with Google Earth Engine
earthengine authenticate
# Start the FastAPI AI service (runs on port 8001)
uvicorn app:app --host 127.0.0.1 --port 8001 --reload
Note: If Google Earth Engine credentials are not configured, the service automatically runs in high-fidelity IPCC fallback mode for local testing without breaking any frontend workflows.
# Open a new terminal and navigate to blockchain
cd blockchain
# Install blockchain dependencies
pnpm install
# Start a local Hardhat Ethereum node (runs on port 8545)
pnpm hardhat node
In a separate terminal, deploy the CarbonLedger.sol contract to the local network:
cd blockchain
pnpm hardhat run scripts/deploy.js --network localhost
Copy the deployed contract address and add it to your .env files.
# Open a new terminal and navigate to frontend
cd frontend
# Install frontend dependencies
pnpm install
# Start the Vite development server (runs on http://localhost:5173)
pnpm dev
Open your browser and navigate to http://localhost:5173.
Copy the example environment configurations to their respective directories:
backend/.env)DEBUG=True
SECRET_KEY=your-django-secret-key-here
ALLOWED_HOSTS=localhost,127.0.0.1
WEB3_PROVIDER_URL=http://127.0.0.1:8545
CONTRACT_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
PINATA_API_KEY=your-pinata-api-key
PINATA_SECRET_API_KEY=your-pinata-secret-key
PINATA_JWT=your-pinata-jwt-token
AI_SERVICE_URL=http://127.0.0.1:8001
ai-service/.env)GEE_PROJECT_ID=carbonledger-503508
GOOGLE_APPLICATION_CREDENTIALS=./auth/gee-credentials.json
MAPBOX_ACCESS_TOKEN=your-mapbox-token
frontend/.env)VITE_API_URL=http://127.0.0.1:8000/api/v1
VITE_AI_SERVICE_URL=http://127.0.0.1:8001
VITE_BLOCKCHAIN_RPC=http://127.0.0.1:8545
VITE_CONTRACT_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
All backend endpoints are prefixed with /api/v1/:
POST /api/v1/register/ β Register a new account (NGO Representative or Company Buyer).POST /api/token/ β Obtain JWT access and refresh tokens.POST /api/token/refresh/ β Refresh expired JWT access token.GET /api/v1/me/ β Retrieve the currently authenticated profile and assigned role.GET /api/v1/CarbonLedger/ β List projects (scoped by role for NGOs/Buyers; platform-wide for Admin/Verifier; verified only for public marketplace).POST /api/v1/CarbonLedger/ β Register a new blue carbon project (NGO only; initial status Pending).GET /api/v1/CarbonLedger/<id>/ β Retrieve detailed project metadata and verifier feedback notes.PATCH /api/v1/CarbonLedger/<id>/ β Update permitted project metadata (protected fields blocked).GET /api/v1/CarbonLedger/<id>/report/ β Download generated PDF MRV report.GET /api/v1/admin/users/ β List and create platform users (Admin only).POST /api/v1/admin/projects/<id>/assign-verifier/ β Assign a Government Official to a Pending project (transitions to Under Review).POST /api/v1/projects/<id>/review/ β Submit verifier review (action: "approve" | "request_correction" | "reject", with mandatory notes).POST /api/v1/projects/<id>/resubmit/ β NGO resubmission of a Correction Required project (transitions to Under Review).POST /api/v1/company/<id>/mint/ β Mint on-chain carbon credits for a Verified project (assigned Verifier or Admin only).GET /api/v1/pricing/ β Get or update carbon credit benchmark price configuration.POST /api/v1/CarbonLedgerTransactions/ β Execute a credit purchase (transaction_type: "Recieve") or retirement.GET /api/v1/dashboard-stats/ β Real-time analytical statistics aggregated by user role.GET /health β Service status and Earth Engine connection state.POST /api/v1/analyze/point β Point coordinate satellite analysis (NDVI mean, canopy cover %, carbon tonnes).POST /api/v1/analyze β GeoJSON polygon boundary analysis and spatial carbon heatmaps.| Feature / Action | Admin | Government Official (Verifier) | NGO Representative | Company Buyer | Public (Guest) |
|---|---|---|---|---|---|
| Browse Marketplace | β | β | β | β | β |
| Use AI Explorer | β | β | β | β | β |
| Register New Project | β | β | β | β | β |
| Edit Project Metadata | β (All) | β | β (Own Only) | β | β |
| Assign Verifier | β | β | β | β | β |
| Review Project (Approve / Reject / Correction) | β | β (Assigned Only) | β | β | β |
Resubmit Project (Correction Required) | β | β | β (Own Only) | β | β |
| Direct Status Override (PATCH) | β (Blocked) | β (Blocked) | β (Blocked) | β (Blocked) | β (Blocked) |
| Mint Carbon Credits | β | β (Assigned Only) | β | β | β |
| Purchase Carbon Credits | β | β | β | β | β |
Access /admin Dashboard | β | β | β | β | β |
Access /verifier Review Queue | β | β | β | β | β |
The codebase includes comprehensive static analysis and automated verification suites:
cd backend
# Check system models and dependencies
python manage.py check
# Verify database migrations integrity
python manage.py makemigrations --check
python manage.py migrate --plan
cd frontend
# TypeScript static type check (0 errors)
pnpm tsc --noEmit
# Production bundle build test
pnpm build
cd blockchain
# Compile Solidity contracts
pnpm hardhat compile
# Run Hardhat test suite
pnpm hardhat test
Developed with pride for the Smart India Hackathon (SIH).
develop (git checkout -b feature/your-feature-name).pnpm tsc --noEmit) before opening a pull request..env files to git.This project is licensed under the MIT License β see the LICENSE file for details.