How c-6-sih/bluecarbon-registry-mrv works
Purpose and Runtime
BLUE CARBON is a Vite-built React/TypeScript single-page application for a blue-carbon platform. Its feature set spans user access, carbon assets/wallets, verification, registry, GIS, IoT simulation, marketplace, community, and administration. Browser entry points are index.html, src/main.tsx, and the application shell src/App.tsx.
Application Composition and Navigation
src/App.tsx is the central composition point for routes, shared layout, and feature-page selection. Page-level modules represent the main product domains: src/pages/LandingPage.tsx, src/pages/Dashboard.tsx, and src/pages/AdminPanel.tsx. Supporting navigation and cross-route UX live in src/components/Navbar.tsx, src/components/RouteGuards.tsx, and src/components/ScrollToTop.tsx.
Stateful Domain Contexts
React context is the primary client-side state boundary. Authentication and authorization are handled through src/contexts/AuthContext.tsx and consumed by route protection in src/components/RouteGuards.tsx. Domain state is segmented into data, forum/community, gamification, IoT, language, and notifications: src/contexts/DataContext.tsx, src/contexts/ForumContext.tsx, and src/contexts/IoTContext.tsx. This suggests browser-local orchestration rather than a visible backend integration layer.
Carbon Asset and Verification Workflow
The core asset lifecycle is represented by dedicated views: data intake at src/pages/DataUpload.tsx, validation or review at src/pages/VerificationWorkflow.tsx, registration at src/pages/Registry.tsx, and user holdings/value at src/pages/CarbonWallet.tsx. The expected control flow is upload → verification → registry/wallet visibility, with DataContext serving as the shared application-state boundary.
Spatial and IoT Data Features
Spatial and sensor-oriented experiences are isolated as major product modules: src/pages/GISMapping.tsx and src/pages/IoTSimulation.tsx. IoT state is owned by src/contexts/IoTContext.tsx; mapping and simulation pages consume or present that state alongside uploaded/registered carbon project information. No map, sensor, or external API provider is identifiable from the supplied tree.
Marketplace and Community
User-facing engagement surfaces include trading/discovery in src/pages/Marketplace.tsx, community interaction in src/pages/CommunityPortal.tsx, and incentive state in src/contexts/GameificationContext.tsx. Community-specific state is bounded in src/contexts/ForumContext.tsx, separating it from carbon-record and authentication concerns.
Localization, PWA, and UI Platform
Localization is centrally managed by src/contexts/LanguageContext.tsx, selected through src/components/LanguageSwitcher.tsx, with translations in src/locales/en.json, src/locales/hi.json, src/locales/ta.json, and src/locales/te.json. The frontend uses Tailwind/PostCSS and a local reusable component set under src/components/ui. PWA-facing behavior is represented by public/manifest.json and src/components/PWAInstallPrompt.tsx; deployment is a static Vite browser build, with no server, database, or external service integration evident in the repository tree.
Main entry points: App.tsx Application Shell · DataContext.tsx Data Context · VerificationWorkflow.tsx Verification Workflow · Registry.tsx Registry
Components 21
Browser Runtime
- Vite Entry
src/main.tsx - Application Shell · Composes routes, layout, and feature pages.
src/App.tsx - Navigation & Route UX
src/components/Navbar.tsx - Route Guards
src/components/RouteGuards.tsx - Admin Panel
src/pages/AdminPanel.tsx - Language Switcher · Selects translations from bundled locale files.
src/components/LanguageSwitcher.tsx - PWA Install Prompt
src/components/PWAInstallPrompt.tsx
Client State
- Auth Context · Owns browser-side authentication and authorization state.
src/contexts/AuthContext.tsx - Data Context · Shared state boundary for carbon project records.
src/contexts/DataContext.tsx - IoT Context · Owns simulated sensor state.
src/contexts/IoTContext.tsx - Forum Context
src/contexts/ForumContext.tsx - Gamification Context
src/contexts/GameificationContext.tsx - Language Context
src/contexts/LanguageContext.tsx
Carbon Lifecycle
- Data Upload
src/pages/DataUpload.tsx - Verification Workflow
src/pages/VerificationWorkflow.tsx - Registry
src/pages/Registry.tsx - Carbon Wallet
src/pages/CarbonWallet.tsx - GIS Mapping
src/pages/GISMapping.tsx - IoT Simulation
src/pages/IoTSimulation.tsx
Engagement Features
- Marketplace
src/pages/Marketplace.tsx - Community Portal
src/pages/CommunityPortal.tsx
Connections 25
- Vite Entry → Application Shell: mounts
- Application Shell → Navigation & Route UX: shared layout
- Application Shell → Route Guards: protects routes
- Route Guards → Auth Context: reads access state
- Application Shell → Data Upload: routes to
- Application Shell → Verification Workflow: routes to
- Application Shell → Registry: routes to
- Application Shell → Carbon Wallet: routes to
- Application Shell → GIS Mapping: routes to
- Application Shell → IoT Simulation: routes to
- Application Shell → Marketplace: routes to
- Application Shell → Community Portal: routes to
- Application Shell → Admin Panel: routes to
- Application Shell → Language Switcher: renders
- Application Shell → PWA Install Prompt: renders
- Data Upload → Data Context: stores records
- Data Context → Verification Workflow: supplies submissions
- Verification Workflow → Registry: approved records
- Registry → Carbon Wallet: registered holdings
- Data Context → GIS Mapping: project data
- IoT Context → IoT Simulation: drives simulation
- IoT Context → GIS Mapping: sensor data
- Forum Context → Community Portal: community state
- Gamification Context → Community Portal: incentives
- Language Context → Language Switcher: selected language