# srivastavnik97-lgtm/localrepo architecture

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

- Interactive diagram: https://gitdiagram.com/srivastavnik97-lgtm/localrepo
- Repository: https://github.com/srivastavnik97-lgtm/localrepo

## Overview

This repository contains a weather-app example. Its intended user flow is to enter a city or tap the location control, then see weather information; the screen delegates those actions to a ViewModel. A separate repository implementation demonstrates fetching current weather and caching it in Room, with a reactive cache read path. The sampled ViewModel currently supplies hard-coded values and is not shown calling the domain or data layers. README content was not provided, so feature coverage and integration wiring are limited to the tree and excerpts.

Main entry points: [`android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt`](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt) (Weather API service), [`android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt`](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt) (Weather repository), [`android-portfolio-projects/01-weather-app/data/local/dao/WeatherDao.kt`](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/dao/WeatherDao.kt) (Weather DAO), [`android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt`](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt) (Weather screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_weather_screen["Weather screen"]
  node_weather_vm["Weather ViewModel"]
end

subgraph group_domain["Domain"]
  node_get_weather["Get weather use case"]
  node_weather_contract["Weather repository contract"]
end

subgraph group_data["Data access"]
  node_weather_repo["Weather repository"]
  node_weather_db[("Room database<br/>[WeatherDatabase.kt]")]
  node_weather_dao["Weather DAO<br/>[WeatherDao.kt]"]
  node_weather_entity["Cached weather record<br/>[WeatherEntity.kt]"]
end

subgraph group_integrations["External services"]
  node_retrofit_client["Retrofit client<br/>[RetrofitClient.kt]"]
  node_weather_api["Weather API service"]
  node_weather_dto["Weather response DTOs"]
  node_openweather{{"OpenWeather service"}}
end

node_user(("App user"))

node_user -->|"uses"| node_weather_screen
node_weather_screen -->|"dispatches actions"| node_weather_vm
node_get_weather -->|"calls"| node_weather_contract
node_weather_repo -->|"implements"| node_weather_contract
node_weather_repo -->|"reads and writes"| node_weather_dao
node_weather_repo -->|"fetches weather"| node_weather_api
node_weather_db -->|"provides"| node_weather_dao
node_weather_dao -->|"queries and stores"| node_weather_entity
node_retrofit_client -->|"creates client"| node_weather_api
node_weather_api -->|"returns"| node_weather_dto
node_weather_api -->|"requests current weather"| node_openweather

click node_weather_screen "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt"
click node_weather_vm "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/presentation/WeatherViewModel.kt"
click node_get_weather "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/domain/usecase/GetWeatherUseCase.kt"
click node_weather_contract "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/domain/repository/WeatherRepository.kt"
click node_weather_repo "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt"
click node_weather_db "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/WeatherDatabase.kt"
click node_weather_dao "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/dao/WeatherDao.kt"
click node_weather_entity "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/entity/WeatherEntity.kt"
click node_retrofit_client "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/RetrofitClient.kt"
click node_weather_api "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt"
click node_weather_dto "https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/dto/WeatherResponseDto.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_weather_screen,node_weather_vm,node_user toneBlue
class node_get_weather,node_weather_contract toneAmber
class node_weather_repo,node_weather_db,node_weather_dao,node_weather_entity toneMint
class node_retrofit_client,node_weather_api,node_weather_dto,node_openweather toneRose
```

## Components

### Presentation

- [Weather screen](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt): `android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt`
- [Weather ViewModel](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/presentation/WeatherViewModel.kt): `android-portfolio-projects/01-weather-app/presentation/WeatherViewModel.kt`

### Domain

- [Get weather use case](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/domain/usecase/GetWeatherUseCase.kt): `android-portfolio-projects/01-weather-app/domain/usecase/GetWeatherUseCase.kt`
- [Weather repository contract](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/domain/repository/WeatherRepository.kt): `android-portfolio-projects/01-weather-app/domain/repository/WeatherRepository.kt`

### Data access

- [Weather repository](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt): `android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt`
- [Room database](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/WeatherDatabase.kt): `android-portfolio-projects/01-weather-app/data/local/WeatherDatabase.kt`
- [Weather DAO](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/dao/WeatherDao.kt): `android-portfolio-projects/01-weather-app/data/local/dao/WeatherDao.kt`
- [Cached weather record](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/local/entity/WeatherEntity.kt): `android-portfolio-projects/01-weather-app/data/local/entity/WeatherEntity.kt`

### External services

- [Retrofit client](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/RetrofitClient.kt): `android-portfolio-projects/01-weather-app/data/remote/RetrofitClient.kt`
- [Weather API service](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt): `android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt`
- [Weather response DTOs](https://github.com/srivastavnik97-lgtm/localrepo/blob/main/android-portfolio-projects/01-weather-app/data/remote/dto/WeatherResponseDto.kt): `android-portfolio-projects/01-weather-app/data/remote/dto/WeatherResponseDto.kt`
- **OpenWeather service**

### Other components

- **App user**

## Connections

- App user → Weather screen: uses (evidence: `android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt`)
- Weather screen → Weather ViewModel: dispatches actions (evidence: `android-portfolio-projects/01-weather-app/presentation/WeatherHomeScreen.kt`)
- Get weather use case → Weather repository contract: calls (evidence: `android-portfolio-projects/01-weather-app/domain/usecase/GetWeatherUseCase.kt`)
- Weather repository → Weather repository contract: implements (evidence: `android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt`)
- Weather repository → Weather DAO: reads and writes (evidence: `android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt`)
- Weather repository → Weather API service: fetches weather (evidence: `android-portfolio-projects/01-weather-app/data/repository/WeatherRepositoryImpl.kt`)
- Room database → Weather DAO: provides (evidence: `android-portfolio-projects/01-weather-app/data/local/WeatherDatabase.kt`)
- Weather DAO → Cached weather record: queries and stores (evidence: `android-portfolio-projects/01-weather-app/data/local/dao/WeatherDao.kt`)
- Retrofit client → Weather API service: creates client (evidence: `android-portfolio-projects/01-weather-app/data/remote/RetrofitClient.kt`)
- Weather API service → Weather response DTOs: returns (evidence: `android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt`)
- Weather API service → OpenWeather service: requests current weather (evidence: `android-portfolio-projects/01-weather-app/data/remote/WeatherApiService.kt`)
