How sanisabodakhe/impactchain works
Project type and purpose
• Type: Single-page React application built with Vite, TailwindCSS, and Framer Motion.
• Purpose: Frontend for ImpactChain, a blockchain-enabled CSR platform with AI-powered verification, smart contract automation, and real-time analytics.
File structure
• Top-level files:
• package.json, vite.config.mjs, tailwind.config.js → build & tooling
• index.html → SPA entry point
• Public folder: static assets, manifest, robots.txt
• src folder:
• index.jsx / App.jsx / Routes.jsx → SPA bootstrapping & routing
• components/ → shared UI primitives (Button, Input, Breadcrumb, etc.)
• pages/ → feature modules:
– ai-verification-interface
– authentication
– corporate-dashboard
– csr-project-marketplace
– landing-page
– ngo-project-management
– ngo-projects
• services/projectService.js → HTTP or Web3 calls to backend/API/smart contracts
• utils/ → helper functions (navigation, classnames)
• styles/ → Tailwind + custom CSS
Extract architecture insights from README
• Client → React SPA with routes per user persona (corporate, NGO, verifier).
• Backend / Smart Contracts: off-chain API + on-chain smart contracts (Ethereum), IPFS for evidence storage.
• AI Verification Engine: image & document analysis, NLP, confidence scoring.
• Blockchain Network: smart contracts for fund locking/release, ERC-721 Impact Tokens.
• External Services: MetaMask / WalletConnect, IPFS gateway, blockchain RPC nodes.
Main components
a. Users / Clients
• Corporate Donor (browser + wallet)
• NGO Project Manager (browser + wallet)
• Verifier (browser + wallet)
b. Frontend SPA
• React/Vite application
• Pages & UI components
• State & routing layer (React Router in Routes.jsx)
• Service layer (projectService.js)
c. API Layer (Off-chain backend)
• REST/GraphQL API
• Authentication & authorization (JWT / Web3 signature)
• Project & milestone management endpoints
d. AI Verification Engine
• Image analysis (Computer Vision)
• Document NLP
• ML confidence scoring & fraud detection
• Audit trail logging
e. Blockchain Network
• Smart Contracts (fund escrow, milestone triggers, token minting)
• Impact Tokens (ERC-721)
• Wallet integration (MetaMask, WalletConnect)
f. Storage
• IPFS (evidence & documents)
• Off-chain Database (project metadata, user profiles, analytics)
g. Analytics & Notification
• Real-time dashboards (Recharts)
• WebSocket or polling for live updates
Relationships & data flows
1. User Interaction → React SPA (UI components → pages)
2. SPA → API Layer via HTTPS / Web3 calls
3. API → Database for CRUD
4. SPA → IPFS to upload evidence (via IPFS gateway API)
5. API → AI Engine to process evidence
6. AI Engine → API returns verification decision
7. API → Smart Contracts (on blockchain RPC) to lock / release funds and mint tokens
8. Blockchain → API / Events triggers notifications / updates
9. SPA listens for events or polls for status → updates UI
Architectural patterns & principles
• Modular SPA: feature-based folder structure for pages & components
• Clear separation: UI layer (components & pages), service layer (API/Web3), external systems
• Microservice-style: AI engine decoupled from business API
• Event-driven fund release: on-chain events feed back to off-chain systems
• Progressive enhancement: responsive design, wallet integration fallback