# sanjith-3/agrisat-ai architecture

> Architecture diagram of the GitHub repository sanjith-3/agrisat-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanjith-3/agrisat-ai
- Repository: https://github.com/sanjith-3/agrisat-ai

## Overview

##### Project type and purpose
- CropSense is a lightweight, single-page, full-stack–style web application built in Python using Streamlit.

##### File structure
- Top-level:
– .devcontainer/ (development container)
– stream.py (the Streamlit app entrypoint)
– requirements.txt (Python dependencies)
– README.md (project overview, instructions)
- No separate “frontend” or “backend” folders—the Streamlit server doubles as UI and application logic host.
- No persistent database or microservices—everything runs in one process.

##### README for additional insights
- Describes these logical steps:
1) Upload a zip of TIFF bands
2) Stack bands into arrays
3) Compute 13 indices via Rasterio/EarthPy
5) Send index data to Groq AI and display returned advice
6) Delete temp files
- Tech stack: Python 3.8+, Streamlit, Rasterio, EarthPy, Groq API

##### Diagramming recommendations
– UI (blue), Application logic (green), Data processing (orange), External services (purple), Storage (gray).

##### Details to capture
- Which libraries handle each step.
- Single-process nature but logically separate concerns—this makes the monolith understandable at a glance.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["User Interface (Browser)"]:::ui
    Server["Streamlit Server<br/>(stream.py)"]:::app
    FileStore["Temporary File Store<br/>(Local FS)"]:::storage
    DataProc["Data Processing Module<br/>TIFF I/O & Index Calc"]:::processing
    AI["AI Service (Groq API)"]:::external
    DevCont["Dev Container"]:::config
    Requirements["Python Dependencies"]:::config
    Readme["Project Overview & Instructions"]:::config

    Browser -->|"Upload ZIP"| Server
    Server -->|"Unzip & Write"| FileStore
    Server -->|"Read & Compute"| DataProc
    DataProc -->|"Return Index Arrays"| Server
    Server -->|"Send Index Metrics"| AI
    AI -->|"Return Farming Advice"| Server
    Server -->|"Render Plots & Tips"| Browser
    Server -->|"Delete Temp Files"| FileStore

    click Server "https://github.com/sanjith-3/agrisat-ai/blob/master/stream.py"
    click DataProc "https://github.com/sanjith-3/agrisat-ai/blob/master/stream.py"
    click AI "https://github.com/sanjith-3/agrisat-ai/blob/master/stream.py"
    click FileStore "https://github.com/sanjith-3/agrisat-ai/blob/master/stream.py"
    click DevCont "https://github.com/sanjith-3/agrisat-ai/blob/master/.devcontainer/devcontainer.json"
    click Requirements "https://github.com/sanjith-3/agrisat-ai/blob/master/requirements.txt"
    click Readme "https://github.com/sanjith-3/agrisat-ai/blob/master/README.md"

    classDef ui fill:#D0E6FF,stroke:#333,stroke-width:1px
    classDef app fill:#D1FFD6,stroke:#333,stroke-width:1px
    classDef processing fill:#FFE6AA,stroke:#333,stroke-width:1px
    classDef external fill:#E6D1FF,stroke:#333,stroke-width:1px
    classDef storage fill:#E2E2E2,stroke:#333,stroke-width:1px
    classDef config fill:#C0C0C0,stroke:#333,stroke-width:1px
```
