# mohithvkrishnam/jalsanchaytracker architecture

> Architecture diagram of the GitHub repository mohithvkrishnam/jalsanchaytracker, 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/mohithvkrishnam/jalsanchaytracker
- Repository: https://github.com/mohithvkrishnam/jalsanchaytracker

## Overview

Jal-Sanchay Tracker is an Android water-conservation app: users track rainfall, estimate and visualize stored water, review conservation statistics, and access weather insights and AI suggestions. The tree identifies UI screens, viewmodels, repositories, local persistence, and remote-service modules; README documents the broader capabilities. Source excerpts do not show runtime wiring, so uncertain calls between these layers are omitted.

Main entry points: [`app/src/main/java/com/example/jalsanchaytracker/MainActivity.kt`](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/MainActivity.kt) (Activity entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_main["Activity entry<br/>[MainActivity.kt]"]
  node_navigation["Screen navigation<br/>[Screen.kt]"]
  node_auth["Login and registration<br/>[LoginScreen.kt]"]
  node_authvm["Authentication state<br/>[AuthViewModel.kt]"]
end

subgraph group_tracking["Water tracking"]
  node_dashboard["Dashboard and analytics<br/>[DashboardScreen.kt]"]
  node_rainfall["Rainfall entry"]
  node_history["Tracking history<br/>[HistoryScreen.kt]"]
  node_reports["Monthly reports<br/>[ReportsScreen.kt]"]
  node_calculations["Water calculations"]
  node_mainvm["Tracking state<br/>[MainViewModel.kt]"]
end

subgraph group_insights["Insights and advice"]
  node_weather["Weather insights"]
  node_chat["AI conservation chat<br/>[ChatbotScreen.kt]"]
  node_chatvm["Chat state<br/>[ChatViewModel.kt]"]
  node_tips["Conservation tips<br/>[TipsScreens.kt]"]
  node_tipsvm["Tips state<br/>[TipsViewModel.kt]"]
end

subgraph group_services["Data services"]
  node_authrepo["Authentication service<br/>[AuthRepository.kt]"]
  node_jalrepo["Water data repository"]
  node_database[("Local database<br/>[AppDatabase.kt]")]
  node_weatherapi["Weather API"]
  node_chatrepo["AI chat repository<br/>[ChatRepository.kt]"]
  node_gemini["Gemini service"]
end

node_user(("App user"))

node_user -->|"opens app"| node_main

click node_main "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/MainActivity.kt"
click node_navigation "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/navigation/Screen.kt"
click node_auth "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/LoginScreen.kt"
click node_authvm "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/AuthViewModel.kt"
click node_authrepo "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/AuthRepository.kt"
click node_dashboard "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/DashboardScreen.kt"
click node_rainfall "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/RainfallEntryScreen.kt"
click node_history "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/HistoryScreen.kt"
click node_reports "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/ReportsScreen.kt"
click node_calculations "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/utils/WaterCalculationUtils.kt"
click node_mainvm "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/MainViewModel.kt"
click node_jalrepo "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/JalSanchayRepository.kt"
click node_database "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/local/AppDatabase.kt"
click node_weather "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/WeatherRepository.kt"
click node_weatherapi "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/remote/WeatherApiService.kt"
click node_chat "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/ChatbotScreen.kt"
click node_chatvm "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/ChatViewModel.kt"
click node_chatrepo "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/ChatRepository.kt"
click node_gemini "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/remote/GeminiApiService.kt"
click node_tips "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/TipsScreens.kt"
click node_tipsvm "https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/TipsViewModel.kt"

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_main,node_navigation,node_auth,node_authvm,node_user toneBlue
class node_dashboard,node_rainfall,node_history,node_reports,node_calculations,node_mainvm toneAmber
class node_weather,node_chat,node_chatvm,node_tips,node_tipsvm toneMint
class node_authrepo,node_jalrepo,node_database,node_weatherapi,node_chatrepo,node_gemini toneRose
```

## Components

### App and navigation

- [Activity entry](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/MainActivity.kt): `app/src/main/java/com/example/jalsanchaytracker/MainActivity.kt`
- [Screen navigation](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/navigation/Screen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/navigation/Screen.kt`
- [Login and registration](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/LoginScreen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/LoginScreen.kt`
- [Authentication state](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/AuthViewModel.kt): `app/src/main/java/com/example/jalsanchaytracker/viewmodel/AuthViewModel.kt`

### Water tracking

- [Dashboard and analytics](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/DashboardScreen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/DashboardScreen.kt`
- [Rainfall entry](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/RainfallEntryScreen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/RainfallEntryScreen.kt`
- [Tracking history](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/HistoryScreen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/HistoryScreen.kt`
- [Monthly reports](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/ReportsScreen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/ReportsScreen.kt`
- [Water calculations](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/utils/WaterCalculationUtils.kt): `app/src/main/java/com/example/jalsanchaytracker/utils/WaterCalculationUtils.kt`
- [Tracking state](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/MainViewModel.kt): `app/src/main/java/com/example/jalsanchaytracker/viewmodel/MainViewModel.kt`

### Insights and advice

- [Weather insights](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/WeatherRepository.kt): `app/src/main/java/com/example/jalsanchaytracker/data/repository/WeatherRepository.kt`
- [AI conservation chat](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/ChatbotScreen.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/ChatbotScreen.kt`
- [Chat state](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/ChatViewModel.kt): `app/src/main/java/com/example/jalsanchaytracker/viewmodel/ChatViewModel.kt`
- [Conservation tips](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/ui/screens/TipsScreens.kt): `app/src/main/java/com/example/jalsanchaytracker/ui/screens/TipsScreens.kt`
- [Tips state](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/viewmodel/TipsViewModel.kt): `app/src/main/java/com/example/jalsanchaytracker/viewmodel/TipsViewModel.kt`

### Data services

- [Authentication service](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/AuthRepository.kt): `app/src/main/java/com/example/jalsanchaytracker/data/repository/AuthRepository.kt`
- [Water data repository](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/JalSanchayRepository.kt): `app/src/main/java/com/example/jalsanchaytracker/data/repository/JalSanchayRepository.kt`
- [Local database](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/local/AppDatabase.kt): `app/src/main/java/com/example/jalsanchaytracker/data/local/AppDatabase.kt`
- [Weather API](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/remote/WeatherApiService.kt): `app/src/main/java/com/example/jalsanchaytracker/data/remote/WeatherApiService.kt`
- [AI chat repository](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/repository/ChatRepository.kt): `app/src/main/java/com/example/jalsanchaytracker/data/repository/ChatRepository.kt`
- [Gemini service](https://github.com/mohithvkrishnam/jalsanchaytracker/blob/main/app/src/main/java/com/example/jalsanchaytracker/data/remote/GeminiApiService.kt): `app/src/main/java/com/example/jalsanchaytracker/data/remote/GeminiApiService.kt`

### Other components

- **App user**

## Connections

- App user → Activity entry: opens app
