Implement production FloodIntel frontend with real backend data - #1
Open
jashwanth-cloud wants to merge 1 commit into
Open
jashwanth-cloud wants to merge 1 commit into
jashwanth-cloud wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebuilds the FloodIntel frontend with all required routes, an honest data-driven UI backed by the existing FastAPI backend, and a real interactive Leaflet map, replacing the previous single-file mockup homepage with fabricated statistics.
Problem
The existing homepage (
app/page.tsx) was a large, self-contained mockup with hardcoded risk levels, fake rainfall/alert numbers, a decorative "map" made of CSS shapes, and non-functional buttons. Other routes (/map,/alerts,/history,/report,/emergency) were empty placeholder files, and there were no real components for language selection, offline handling, AI chat, or map rendering. This did not meet the goal of a serious, data-honest flood intelligence platform.Solution
Introduced a shared
AppShelllayout with real Next.js routing/navigation, and built out each required route (/,/map,/risk,/alerts,/history,/report,/emergency,/assistant) as focused, composable components that pull live data from a centralized API client, showing honest loading/error/unavailable states instead of fake values.Key Changes
AppShellwith responsive nav, mobile menu,LanguageSelector, andOfflineBannerFloodMapcomponent using React-Leaflet/OpenStreetMap with dynamic client-side loading to avoid hydration issues, used on Home and/mapLocationSearch(GPS + text search routing to/map) andStatusCardfor current flood detection status with loading/error/retry statesapp/page.tsxas a clean dashboard: hero, risk overview cards, map preview, forecast/history sections — all sourced fromuseFloodDatahook with no hardcoded metrics/riskpage separating "Current Detection" from "Future Forecast" (marked unavailable) plus risk-factor and validation sections/alerts,/history,/emergencypages with honest "unavailable"/static-guidance states instead of fabricated content/reportpage with photo upload, GPS location, severity/description form, localStorage queueing, and online/offline-aware submission messagingAIChatcomponent wired to the existing/assistantendpoint with message history, retry, clear conversation, and language awarenesslib/api.tsto useNEXT_PUBLIC_API_URL, addedgetFloodAdvisory/getFloodValidation, and updatedlib/types.tsto match actual backend response shape (dataset,prediction,area,risk,validation)useFloodDatahook for shared loading/success/error state and refresh handlingglobals.cssandlayout.tsx, removing unused Geist fonts/metadata and adding shared utility classes (.card,.eyebrow, focus-visible styles)Tip
This PR wasn't reviewed by Quality Agent. Enable it in Project Settings to get AI-powered code review on every PR.
To clone this PR locally use the Github CLI with command
gh pr checkout 1You can tag me at @BuilderIO for anything you want me to fix or change