How vidyutchakrabarti/tracex works
Project Type and Purpose
• Full-stack decentralized application (DApp) for evidence management in courts
• Next.js 13 “app” directory (React · server and client components)
• On-chain anchor of evidence hashes, off-chain metadata, Google/Firebase services
Main Architectural Components
• Frontend (Next.js React UI)
• Backend (Next.js Serverless API routes)
• Off-chain Database (MongoDB via utils/dbConnect.js or Firestore via utils/firebase.ts)
• Ethereum (Sepolia testnet) – smart contracts, const/contract-abi.ts
• Validation Service
– Python agents (tracex_agents) scrape events from Sepolia
– Sink to Google BigQuery
– Next.js /api/auditTrail routes query BigQuery to validate evidence hashes
• External Services
– Firebase Auth & Cloud Storage
– Google Maps & Earth Engine
– Gemini AI, Agents ADK, TTS, Translate
– BigQuery
Relationships & Data Flows
• User → Frontend UI → Backend API → DB / Blockchain
• Validation Request (/api/auditTrail) → BigQuery → Sepolia → compare → response
• Python Agent (cron/worker) → Sepolia → BigQuery (continuous ingestion)
• File uploads → Firebase Storage → metadata in DB → on-chain hash write via EthereumService
Important Architectural Patterns
• Serverless API (Next.js Route Handlers)
• Cron/Agent-based ingestion (Python)
• Event sourcing on blockchain + store & forward to BigQuery
• Real-time & batch validation: API queries BigQuery; Agent writes continuously