# nishannt-x/amazon_bharat_build_2 architecture

> Architecture diagram of the GitHub repository nishannt-x/amazon_bharat_build_2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nishannt-x/amazon_bharat_build_2
- Repository: https://github.com/nishannt-x/amazon_bharat_build_2

## Overview

FloodFlow is a web app for assessing flood hazards for drivers. The main workflow presents a photo-based scan and a dashboard for flood reports, vehicle context, routing controls, and a map; the dashboard loads the map and vehicle catalog. A separate API endpoint generates vehicle-specific risk advice through AWS Bedrock, with a local fallback. The excerpts do not show the dashboard calling that endpoint or implementing the advertised vision, routing, or chatbot integrations, so those connections are not inferred.

Main entry points: [`src/app/dashboard/page.tsx`](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx) (Flood dashboard), [`src/app/page.tsx`](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/page.tsx) (Quick scan), [`src/app/login/page.tsx`](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/login/page.tsx) (Sign in), [`src/components/MapComponent.tsx`](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/components/MapComponent.tsx) (Flood map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Driver experience"]
  node_landing["Quick scan<br/>[page.tsx]"]
  node_login["Sign in<br/>[page.tsx]"]
  node_dashboard["Flood dashboard<br/>[page.tsx]"]
end

subgraph group_hazards["Hazard and map"]
  node_reports["Flood reports<br/>[page.tsx]"]
  node_scan["Photo analysis UI<br/>[page.tsx]"]
  node_routing["Route controls<br/>[page.tsx]"]
  node_vehicledata["Vehicle catalog<br/>[vehicles.json]"]
  node_map["Flood map<br/>[MapComponent.tsx]"]
end

subgraph group_advisory["Risk advisory"]
  node_riskapi["Risk advisory API<br/>[route.ts]"]
end

node_driver(("Driver"))
node_tiles["OpenStreetMap tiles"]
node_bedrock["AWS Bedrock"]

node_driver -.->|"opens"| node_landing
node_driver -.->|"uses"| node_dashboard
node_landing -->|"links to"| node_login
node_login -->|"redirects to"| node_dashboard
node_dashboard -->|"renders"| node_map
node_dashboard -->|"imports"| node_vehicledata
node_dashboard -->|"manages"| node_reports
node_dashboard -->|"manages"| node_scan
node_dashboard -->|"provides controls"| node_routing
node_map -->|"loads tiles"| node_tiles
node_riskapi -->|"invokes model"| node_bedrock

click node_landing "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/page.tsx"
click node_login "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/login/page.tsx"
click node_dashboard "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx"
click node_reports "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx"
click node_scan "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx"
click node_routing "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx"
click node_vehicledata "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/data/vehicles.json"
click node_map "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/components/MapComponent.tsx"
click node_riskapi "https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/api/bedrock/route.ts"

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_landing,node_login,node_dashboard toneBlue
class node_reports,node_scan,node_routing,node_vehicledata,node_map toneAmber
class node_riskapi toneMint
class node_driver,node_tiles,node_bedrock toneIndigo
```

## Components

### Driver experience

- [Quick scan](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Sign in](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Flood dashboard](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`

### Hazard and map

- [Flood reports](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Photo analysis UI](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Route controls](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Vehicle catalog](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/data/vehicles.json): `src/data/vehicles.json`
- [Flood map](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/components/MapComponent.tsx): `src/components/MapComponent.tsx`

### Risk advisory

- [Risk advisory API](https://github.com/nishannt-x/amazon_bharat_build_2/blob/main/src/app/api/bedrock/route.ts): `src/app/api/bedrock/route.ts`

### Other components

- **Driver**
- **OpenStreetMap tiles**
- **AWS Bedrock**

## Connections

- Driver → Quick scan: opens
- Driver → Flood dashboard: uses
- Quick scan → Sign in: links to (evidence: `src/app/page.tsx`)
- Sign in → Flood dashboard: redirects to (evidence: `src/app/login/page.tsx`)
- Flood dashboard → Flood map: renders (evidence: `src/app/dashboard/page.tsx`)
- Flood dashboard → Vehicle catalog: imports (evidence: `src/app/dashboard/page.tsx`)
- Flood dashboard → Flood reports: manages (evidence: `src/app/dashboard/page.tsx`)
- Flood dashboard → Photo analysis UI: manages (evidence: `src/app/dashboard/page.tsx`)
- Flood dashboard → Route controls: provides controls (evidence: `src/app/dashboard/page.tsx`)
- Flood map → OpenStreetMap tiles: loads tiles (evidence: `src/components/MapComponent.tsx`)
- Risk advisory API → AWS Bedrock: invokes model (evidence: `src/app/api/bedrock/route.ts`)
