# praveen-devarakota/gee-indexing-backend architecture

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

- Interactive diagram: https://gitdiagram.com/praveen-devarakota/gee-indexing-backend
- Repository: https://github.com/praveen-devarakota/gee-indexing-backend

## Overview

This Flask API serves satellite imagery and vegetation time-series data, then offers RAG-based analysis and question answering over supplied time-series records. The main workflow is a client request through registered routes to satellite processing or RAG services; analysis chunks records and indexes embeddings, while chat retrieves relevant context and asks Groq to generate an answer. The sampled source establishes these flows, but not the internals of chunking, prompting, or vector-store persistence beyond their pipeline interfaces.

Main entry points: [`controllers/satellite_controller.py`](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py) (Request controller), [`rag/pipeline.py`](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/pipeline.py) (RAG pipeline), [`services/rag_service.py`](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/services/rag_service.py) (RAG service), [`models/satellite_model.py`](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/models/satellite_model.py) (Sentinel-2 collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API layer"]
  node_app["Flask app<br/>[app.py]"]
  node_routes["Satellite routes"]
  node_controller["Request controller"]
end

subgraph group_satellite["Satellite processing"]
  node_validation["Date validation<br/>[helpers.py]"]
  node_collection["Sentinel-2 collection<br/>[satellite_model.py]"]
  node_composite["Image composites"]
  node_weekly["Weekly composites"]
  node_series["NDVI extraction"]
  node_cleanup["Series cleanup"]
  node_smoothing["NDVI smoothing"]
end

subgraph group_rag["RAG workflows"]
  node_rag_service["RAG service<br/>[rag_service.py]"]
  node_pipeline["RAG pipeline<br/>[pipeline.py]"]
  node_chunking["Time-series chunking<br/>[chunking.py]"]
  node_embedder["Text embeddings<br/>[embedder.py]"]
  node_vector_store[("Vector index<br/>[vector_store.py]")]
  node_prompt["Chat prompt builder<br/>[prompt_builder.py]"]
end

subgraph group_integrations["External integrations"]
  node_earth_engine["Google Earth Engine"]
  node_jina["Jina embeddings API"]
  node_groq["Groq chat API"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_app -->|"registers routes"| node_routes
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"validates dates"| node_validation
node_controller -->|"requests imagery"| node_collection
node_controller -->|"queries imagery"| node_earth_engine
node_collection -->|"filters imagery"| node_earth_engine
node_controller -->|"builds composite"| node_composite
node_controller -->|"creates intervals"| node_weekly
node_weekly -->|"composites scenes"| node_collection
node_controller -->|"extracts NDVI"| node_series
node_series -->|"filters values"| node_cleanup
node_cleanup -->|"smooths values"| node_smoothing
node_controller -->|"requests RAG"| node_rag_service
node_rag_service -->|"runs workflow"| node_pipeline
node_pipeline -->|"chunks records"| node_chunking
node_pipeline -->|"embeds chunks"| node_embedder
node_embedder -->|"requests vectors"| node_jina
node_pipeline -->|"builds and saves index"| node_vector_store
node_pipeline -->|"loads and searches"| node_vector_store
node_pipeline -->|"embeds question"| node_embedder
node_rag_service -->|"builds chat prompt"| node_prompt
node_rag_service -->|"generates answer"| node_groq

click node_app "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/app.py"
click node_routes "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/routes/satellite_routes.py"
click node_controller "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py"
click node_validation "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/utils/helpers.py"
click node_collection "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/models/satellite_model.py"
click node_composite "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py"
click node_weekly "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py"
click node_series "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py"
click node_cleanup "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py"
click node_smoothing "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py"
click node_rag_service "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/services/rag_service.py"
click node_pipeline "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/pipeline.py"
click node_chunking "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/chunking.py"
click node_embedder "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/embedder.py"
click node_vector_store "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/vector_store.py"
click node_prompt "https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/prompt_builder.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_routes,node_controller,node_client toneBlue
class node_validation,node_collection,node_composite,node_weekly,node_series,node_cleanup,node_smoothing toneAmber
class node_rag_service,node_pipeline,node_chunking,node_embedder,node_vector_store,node_prompt toneMint
class node_earth_engine,node_jina,node_groq toneRose
```

## Components

### API layer

- [Flask app](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/app.py): `app.py`
- [Satellite routes](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/routes/satellite_routes.py): `routes/satellite_routes.py`
- [Request controller](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py): `controllers/satellite_controller.py`

### Satellite processing

- [Date validation](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/utils/helpers.py): `utils/helpers.py`
- [Sentinel-2 collection](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/models/satellite_model.py): `models/satellite_model.py`
- [Image composites](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py): `controllers/satellite_controller.py`
- [Weekly composites](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py): `controllers/satellite_controller.py`
- [NDVI extraction](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py): `controllers/satellite_controller.py`
- [Series cleanup](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py): `controllers/satellite_controller.py`
- [NDVI smoothing](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/controllers/satellite_controller.py): `controllers/satellite_controller.py`

### RAG workflows

- [RAG service](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/services/rag_service.py): `services/rag_service.py`
- [RAG pipeline](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/pipeline.py): `rag/pipeline.py`
- [Time-series chunking](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/chunking.py): `rag/chunking.py`
- [Text embeddings](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/embedder.py): `rag/embedder.py`
- [Vector index](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/vector_store.py): `rag/vector_store.py`
- [Chat prompt builder](https://github.com/praveen-devarakota/gee-indexing-backend/blob/main/rag/prompt_builder.py): `rag/prompt_builder.py`

### External integrations

- **Google Earth Engine**
- **Jina embeddings API**
- **Groq chat API**

### Other components

- **API client**

## Connections

- API client → Flask app: sends requests
- Flask app → Satellite routes: registers routes
- Satellite routes → Request controller: dispatches requests
- Request controller → Date validation: validates dates
- Request controller → Sentinel-2 collection: requests imagery
- Request controller → Google Earth Engine: queries imagery
- Sentinel-2 collection → Google Earth Engine: filters imagery
- Request controller → Image composites: builds composite
- Request controller → Weekly composites: creates intervals
- Weekly composites → Sentinel-2 collection: composites scenes
- Request controller → NDVI extraction: extracts NDVI
- NDVI extraction → Series cleanup: filters values
- Series cleanup → NDVI smoothing: smooths values
- Request controller → RAG service: requests RAG
- RAG service → RAG pipeline: runs workflow
- RAG pipeline → Time-series chunking: chunks records
- RAG pipeline → Text embeddings: embeds chunks
- Text embeddings → Jina embeddings API: requests vectors
- RAG pipeline → Vector index: builds and saves index
- RAG pipeline → Vector index: loads and searches
- RAG pipeline → Text embeddings: embeds question
- RAG service → Chat prompt builder: builds chat prompt
- RAG service → Groq chat API: generates answer
