How dingshandeng/askabird works
AskABird is a Tucson-focused biodiversity app whose main workflow lets a visitor explore a map, ask a local bird about a location, assess a proposed construction site, find safer alternatives, and generate an impact report. The current React app delegates these capabilities to Supabase Edge Functions, which use eBird data, shared scoring logic, Gemini, and Supabase services. The README documents capabilities whose frontend wiring is not shown in excerpts; those links are marked dashed. The Python backend is retained as a separate legacy implementation, not presumed to power the current app.
Main entry points: App.tsx Route shell · Index.tsx Bird map · Optimize.tsx Site optimizer · index.ts Regional biodiversity
Components 25
Web experience
- Route shell
app/src/App.tsx - Bird map
app/src/pages/Index.tsx - Map display
app/src/components/MapView.tsx - Bird chat
app/src/components/BirdChat.tsx - Site optimizer
app/src/pages/Optimize.tsx - Impact results
app/src/components/ImpactResult.tsx - Site report
app/src/pages/Report.tsx - Our story
app/src/pages/OurStory.tsx - Authentication
app/src/pages/Auth.tsx
Edge services
- Site analysis
app/supabase/functions/analyze-site/index.ts - Biodiversity scoring
app/supabase/functions/_shared/biodiversity.ts - Safer alternatives
app/supabase/functions/suggest-alternatives/index.ts - Bird response
app/supabase/functions/bird-chat/index.ts - Nearby species
app/supabase/functions/nearby-birds/index.ts - Regional biodiversity
app/supabase/functions/region-biodiversity/index.ts - Report generation
app/supabase/functions/generate-report/index.ts
Data and integrations
- eBird API
- Gemini API
- Supabase services
app/src/integrations/supabase/client.ts
Legacy backend
- Legacy API
archive/backend/main.py - Legacy impact model
archive/backend/ml_model.py - Legacy data ingestion
archive/backend/data_ingestion.py - Legacy species grid
archive/backend/species_grid.py - Synthetic data
archive/backend/mock_data.py
Other components
- Visitor
Connections 28
- Visitor → Route shell: opens app
app/src/App.tsx - Route shell → Bird map: routes to
app/src/App.tsx - Route shell → Authentication: routes to
app/src/App.tsx - Route shell → Site optimizer: routes to
app/src/App.tsx - Route shell → Site report: routes to
app/src/App.tsx - Route shell → Our story: routes to
app/src/App.tsx - Bird map → Map display: shows map
- Bird map → Bird chat: opens chat
- Bird chat → Bird response: requests reply
- Bird response → Gemini API: generates response
- Site optimizer → Site analysis: requests score
- Site analysis → Biodiversity scoring: uses scoring
app/supabase/functions/analyze-site/index.ts - Site optimizer → Safer alternatives: requests options
- Safer alternatives → Biodiversity scoring: uses scoring
app/supabase/functions/suggest-alternatives/index.ts - Site optimizer → Impact results: shows results
- Site report → Report generation: requests report
- Report generation → Gemini API: writes report
- Bird map → Regional biodiversity: loads heatmap
- Bird map → Nearby species: looks up birds
- Nearby species → eBird API: fetches sightings
- Regional biodiversity → eBird API: fetches observations
- Regional biodiversity → Supabase services: reads cache
app/supabase/functions/region-biodiversity/index.ts - Authentication → Supabase services: uses auth
- Legacy API → Legacy impact model: predicts impact
archive/backend/main.py - Legacy data ingestion → eBird API: fetches sightings
archive/backend/data_ingestion.py - Legacy species grid → Legacy data ingestion: uses sightings
archive/backend/species_grid.py - Legacy impact model → Legacy data ingestion: uses data
archive/backend/ml_model.py - Legacy impact model → Synthetic data: uses fallback
archive/backend/ml_model.py