# hotcometgames/ecoloco architecture

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

- Interactive diagram: https://gitdiagram.com/hotcometgames/ecoloco
- Repository: https://github.com/hotcometgames/ecoloco

## Overview

EcoLoco is a mobile schoolyard biodiversity tool: users identify plants by photo and ZIP code, audit a site’s plants, then review a biodiversity score, local planting recommendations, and a draft advocacy letter. The graph follows the shown app navigation, screen-to-API requests, Flask routes, and service calls. External AI, iNaturalist, and geocoding interactions are represented where excerpts support them; recommendation and letter generation internals are only partly sampled.

Main entry points: [`frontend/services/geminiService.js`](https://github.com/hotcometgames/ecoloco/blob/master/frontend/services/geminiService.js) (API client), [`frontend/navigation/AppNavigator.js`](https://github.com/hotcometgames/ecoloco/blob/master/frontend/navigation/AppNavigator.js) (Screen navigation), [`backend/services/gemini_service.py`](https://github.com/hotcometgames/ecoloco/blob/master/backend/services/gemini_service.py) (Plant AI services), [`frontend/screens/AuditResultsScreen.js`](https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/AuditResultsScreen.js) (Audit results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["App shell<br/>[App.js]"]
  node_navigation["Screen navigation<br/>[AppNavigator.js]"]
  node_home["Home<br/>[HomeScreen.js]"]
  node_identify_ui["Plant identification"]
  node_audit_ui["Plant audit<br/>[AuditScreen.js]"]
  node_results_ui["Audit results"]
  node_recommend_ui["Plant recommendations"]
  node_api_client["API client<br/>[geminiService.js]"]
end

subgraph group_api["Backend API"]
  node_flask["HTTP API<br/>[app.py]"]
end

subgraph group_analysis["Plant analysis"]
  node_plant_ai["Plant AI services<br/>[gemini_service.py]"]
  node_inat["Observation lookup<br/>[inat_service.py]"]
  node_score["Biodiversity scoring<br/>[score_service.py]"]
end

subgraph group_planning["Audit and actions"]
end

node_user(("Student or school"))
node_ai_provider["AI model provider"]
node_inat_service["iNaturalist"]
node_geocoder["ZIP geocoder"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_navigation -->|"routes"| node_home
node_navigation -->|"routes"| node_identify_ui
node_navigation -->|"routes"| node_audit_ui
node_navigation -->|"routes"| node_recommend_ui
node_navigation -->|"routes"| node_results_ui
node_identify_ui -->|"requests identification"| node_api_client
node_audit_ui -->|"requests identification"| node_api_client
node_results_ui -->|"requests score"| node_api_client
node_results_ui -->|"requests recommendations"| node_api_client
node_results_ui -->|"requests letter"| node_api_client
node_recommend_ui -.->|"requests recommendations"| node_api_client
node_api_client -->|"posts requests"| node_flask
node_flask -->|"calls"| node_plant_ai
node_flask -->|"imports service"| node_inat
node_flask -->|"calls"| node_score
node_plant_ai -->|"queries"| node_ai_provider
node_plant_ai -->|"calls"| node_inat
node_plant_ai -.->|"checks observations"| node_inat_service
node_plant_ai -->|"geocodes ZIP"| node_geocoder

click node_app "https://github.com/hotcometgames/ecoloco/blob/master/App.js"
click node_navigation "https://github.com/hotcometgames/ecoloco/blob/master/frontend/navigation/AppNavigator.js"
click node_home "https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/HomeScreen.js"
click node_identify_ui "https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/IdentificationScreen.js"
click node_audit_ui "https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/AuditScreen.js"
click node_results_ui "https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/AuditResultsScreen.js"
click node_recommend_ui "https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/RecommendationScreen.js"
click node_api_client "https://github.com/hotcometgames/ecoloco/blob/master/frontend/services/geminiService.js"
click node_flask "https://github.com/hotcometgames/ecoloco/blob/master/backend/app.py"
click node_plant_ai "https://github.com/hotcometgames/ecoloco/blob/master/backend/services/gemini_service.py"
click node_inat "https://github.com/hotcometgames/ecoloco/blob/master/backend/services/inat_service.py"
click node_score "https://github.com/hotcometgames/ecoloco/blob/master/backend/services/score_service.py"

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_app,node_navigation,node_home,node_identify_ui,node_audit_ui,node_results_ui,node_recommend_ui,node_api_client toneBlue
class node_flask toneAmber
class node_plant_ai,node_inat,node_score toneMint
class node_user,node_ai_provider,node_inat_service,node_geocoder toneIndigo
```

## Components

### Mobile app

- [App shell](https://github.com/hotcometgames/ecoloco/blob/master/App.js): `App.js`
- [Screen navigation](https://github.com/hotcometgames/ecoloco/blob/master/frontend/navigation/AppNavigator.js): `frontend/navigation/AppNavigator.js`
- [Home](https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/HomeScreen.js): `frontend/screens/HomeScreen.js`
- [Plant identification](https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/IdentificationScreen.js): `frontend/screens/IdentificationScreen.js`
- [Plant audit](https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/AuditScreen.js): `frontend/screens/AuditScreen.js`
- [Audit results](https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/AuditResultsScreen.js): `frontend/screens/AuditResultsScreen.js`
- [Plant recommendations](https://github.com/hotcometgames/ecoloco/blob/master/frontend/screens/RecommendationScreen.js): `frontend/screens/RecommendationScreen.js`
- [API client](https://github.com/hotcometgames/ecoloco/blob/master/frontend/services/geminiService.js): `frontend/services/geminiService.js`

### Backend API

- [HTTP API](https://github.com/hotcometgames/ecoloco/blob/master/backend/app.py): `backend/app.py`

### Plant analysis

- [Plant AI services](https://github.com/hotcometgames/ecoloco/blob/master/backend/services/gemini_service.py): `backend/services/gemini_service.py`
- [Observation lookup](https://github.com/hotcometgames/ecoloco/blob/master/backend/services/inat_service.py): `backend/services/inat_service.py`
- [Biodiversity scoring](https://github.com/hotcometgames/ecoloco/blob/master/backend/services/score_service.py): `backend/services/score_service.py`

### Other components

- **Student or school**
- **AI model provider**
- **iNaturalist**
- **ZIP geocoder**

## Connections

- Student or school → App shell: uses (evidence: `App.js`)
- App shell → Screen navigation: renders (evidence: `App.js`)
- Screen navigation → Home: routes (evidence: `frontend/navigation/AppNavigator.js`)
- Screen navigation → Plant identification: routes (evidence: `frontend/navigation/AppNavigator.js`)
- Screen navigation → Plant audit: routes (evidence: `frontend/navigation/AppNavigator.js`)
- Screen navigation → Plant recommendations: routes (evidence: `frontend/navigation/AppNavigator.js`)
- Screen navigation → Audit results: routes (evidence: `frontend/navigation/AppNavigator.js`)
- Plant identification → API client: requests identification (evidence: `frontend/screens/IdentificationScreen.js`)
- Plant audit → API client: requests identification (evidence: `frontend/screens/AuditScreen.js`)
- Audit results → API client: requests score (evidence: `frontend/screens/AuditResultsScreen.js`)
- Audit results → API client: requests recommendations (evidence: `frontend/screens/AuditResultsScreen.js`)
- Audit results → API client: requests letter (evidence: `frontend/screens/AuditResultsScreen.js`)
- Plant recommendations → API client: requests recommendations (evidence: `frontend/screens/RecommendationScreen.js`)
- API client → HTTP API: posts requests (evidence: `frontend/services/geminiService.js`)
- HTTP API → Plant AI services: calls (evidence: `backend/app.py`)
- HTTP API → Observation lookup: imports service (evidence: `backend/app.py`)
- HTTP API → Biodiversity scoring: calls (evidence: `backend/app.py`)
- Plant AI services → AI model provider: queries (evidence: `backend/services/gemini_service.py`)
- Plant AI services → Observation lookup: calls (evidence: `backend/services/gemini_service.py`)
- Plant AI services → iNaturalist: checks observations
- Plant AI services → ZIP geocoder: geocodes ZIP (evidence: `backend/services/gemini_service.py`)
