# c-6-sih/bluecarbon-registry-mrv architecture

> Architecture diagram of the GitHub repository c-6-sih/bluecarbon-registry-mrv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/c-6-sih/bluecarbon-registry-mrv
- Repository: https://github.com/c-6-sih/bluecarbon-registry-mrv

## Overview

#### 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: [`src/App.tsx`](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/App.tsx) (Application Shell), [`src/contexts/DataContext.tsx`](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/DataContext.tsx) (Data Context), [`src/pages/VerificationWorkflow.tsx`](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/VerificationWorkflow.tsx) (Verification Workflow), [`src/pages/Registry.tsx`](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/Registry.tsx) (Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Browser Runtime"]
  node_entry["Vite Entry<br/>browser entry<br/>[main.tsx]"]
  node_app["Application Shell<br/>React router composition<br/>[App.tsx]"]
  node_navigation["Navigation &amp; Route UX<br/>shared components<br/>[Navbar.tsx]"]
  node_route_guards["Route Guards<br/>access control<br/>[RouteGuards.tsx]"]
  node_admin["Admin Panel<br/>administration page<br/>[AdminPanel.tsx]"]
  node_localization["Language Switcher<br/>localization UI"]
  node_pwa["PWA Install Prompt<br/>PWA UI"]
end

subgraph group_state["Client State"]
  node_auth["Auth Context<br/>React context<br/>[AuthContext.tsx]"]
  node_data["Data Context<br/>React context<br/>[DataContext.tsx]"]
  node_iot_state["IoT Context<br/>React context<br/>[IoTContext.tsx]"]
  node_forum["Forum Context<br/>React context<br/>[ForumContext.tsx]"]
  node_gamification["Gamification Context<br/>React context"]
  node_language["Language Context<br/>React context"]
end

subgraph group_carbon["Carbon Lifecycle"]
  node_upload["Data Upload<br/>lifecycle page<br/>[DataUpload.tsx]"]
  node_verification["Verification Workflow<br/>lifecycle page"]
  node_registry["Registry<br/>lifecycle page<br/>[Registry.tsx]"]
  node_wallet["Carbon Wallet<br/>holdings page<br/>[CarbonWallet.tsx]"]
  node_gis["GIS Mapping<br/>spatial page<br/>[GISMapping.tsx]"]
  node_iot_simulation["IoT Simulation<br/>sensor page<br/>[IoTSimulation.tsx]"]
end

subgraph group_engagement["Engagement Features"]
  node_marketplace["Marketplace<br/>trading page<br/>[Marketplace.tsx]"]
  node_community["Community Portal<br/>community page"]
end

node_entry -->|"mounts"| node_app
node_app -->|"shared layout"| node_navigation
node_app -->|"protects routes"| node_route_guards
node_route_guards -->|"reads access state"| node_auth
node_app -->|"routes to"| node_upload
node_app -->|"routes to"| node_verification
node_app -->|"routes to"| node_registry
node_app -->|"routes to"| node_wallet
node_app -->|"routes to"| node_gis
node_app -->|"routes to"| node_iot_simulation
node_app -->|"routes to"| node_marketplace
node_app -->|"routes to"| node_community
node_app -->|"routes to"| node_admin
node_app -->|"renders"| node_localization
node_app -->|"renders"| node_pwa
node_upload -->|"stores records"| node_data
node_data -->|"supplies submissions"| node_verification
node_verification -->|"approved records"| node_registry
node_registry -->|"registered holdings"| node_wallet
node_data -->|"project data"| node_gis
node_iot_state -->|"drives simulation"| node_iot_simulation
node_iot_state -->|"sensor data"| node_gis
node_forum -->|"community state"| node_community
node_gamification -->|"incentives"| node_community
node_language -->|"selected language"| node_localization

click node_entry "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/main.tsx"
click node_app "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/App.tsx"
click node_navigation "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/Navbar.tsx"
click node_route_guards "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/RouteGuards.tsx"
click node_auth "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/AuthContext.tsx"
click node_data "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/DataContext.tsx"
click node_iot_state "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/IoTContext.tsx"
click node_forum "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/ForumContext.tsx"
click node_gamification "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/GameificationContext.tsx"
click node_language "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/LanguageContext.tsx"
click node_upload "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/DataUpload.tsx"
click node_verification "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/VerificationWorkflow.tsx"
click node_registry "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/Registry.tsx"
click node_wallet "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/CarbonWallet.tsx"
click node_gis "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/GISMapping.tsx"
click node_iot_simulation "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/IoTSimulation.tsx"
click node_marketplace "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/Marketplace.tsx"
click node_community "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/CommunityPortal.tsx"
click node_admin "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/AdminPanel.tsx"
click node_localization "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/LanguageSwitcher.tsx"
click node_pwa "https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/PWAInstallPrompt.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_app,node_navigation,node_route_guards,node_admin,node_localization,node_pwa toneBlue
class node_auth,node_data,node_iot_state,node_forum,node_gamification,node_language toneAmber
class node_upload,node_verification,node_registry,node_wallet,node_gis,node_iot_simulation toneMint
class node_marketplace,node_community toneRose
```

## Components

### Browser Runtime

- [Vite Entry](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/main.tsx): browser entry · `src/main.tsx`
- [Application Shell](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/App.tsx): React router composition · Composes routes, layout, and feature pages. · `src/App.tsx`
- [Navigation & Route UX](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/Navbar.tsx): shared components · `src/components/Navbar.tsx`
- [Route Guards](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/RouteGuards.tsx): access control · `src/components/RouteGuards.tsx`
- [Admin Panel](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/AdminPanel.tsx): administration page · `src/pages/AdminPanel.tsx`
- [Language Switcher](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/LanguageSwitcher.tsx): localization UI · Selects translations from bundled locale files. · `src/components/LanguageSwitcher.tsx`
- [PWA Install Prompt](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/components/PWAInstallPrompt.tsx): PWA UI · `src/components/PWAInstallPrompt.tsx`

### Client State

- [Auth Context](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/AuthContext.tsx): React context · Owns browser-side authentication and authorization state. · `src/contexts/AuthContext.tsx`
- [Data Context](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/DataContext.tsx): React context · Shared state boundary for carbon project records. · `src/contexts/DataContext.tsx`
- [IoT Context](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/IoTContext.tsx): React context · Owns simulated sensor state. · `src/contexts/IoTContext.tsx`
- [Forum Context](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/ForumContext.tsx): React context · `src/contexts/ForumContext.tsx`
- [Gamification Context](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/GameificationContext.tsx): React context · `src/contexts/GameificationContext.tsx`
- [Language Context](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/contexts/LanguageContext.tsx): React context · `src/contexts/LanguageContext.tsx`

### Carbon Lifecycle

- [Data Upload](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/DataUpload.tsx): lifecycle page · `src/pages/DataUpload.tsx`
- [Verification Workflow](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/VerificationWorkflow.tsx): lifecycle page · `src/pages/VerificationWorkflow.tsx`
- [Registry](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/Registry.tsx): lifecycle page · `src/pages/Registry.tsx`
- [Carbon Wallet](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/CarbonWallet.tsx): holdings page · `src/pages/CarbonWallet.tsx`
- [GIS Mapping](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/GISMapping.tsx): spatial page · `src/pages/GISMapping.tsx`
- [IoT Simulation](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/IoTSimulation.tsx): sensor page · `src/pages/IoTSimulation.tsx`

### Engagement Features

- [Marketplace](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/Marketplace.tsx): trading page · `src/pages/Marketplace.tsx`
- [Community Portal](https://github.com/c-6-sih/bluecarbon-registry-mrv/blob/main/src/pages/CommunityPortal.tsx): community page · `src/pages/CommunityPortal.tsx`

## Connections

- 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
