# flstupid/locationtracker architecture

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

- Interactive diagram: https://gitdiagram.com/flstupid/locationtracker
- Repository: https://github.com/flstupid/locationtracker

## Overview

LocationTracker is an Android app for trusted-contact location sharing. Its documented main flow is user actions through feature UI and ViewModels into use cases and repositories, which cache locally before remote synchronization; UI observes resulting streams. The graph includes map, history, social, activity, tracking, and notification capabilities named in the README. Source excerpts did not include runtime Kotlin, so relationships beyond README-described data flow and capabilities are omitted.

Main entry points: [`app/src/main/kotlin/com/example/locationtracker/feature`](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature) (Feature screens), [`app/src/main/kotlin/com/example/locationtracker/data/repository`](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/data/repository) (Repository implementations), [`app/src/main/kotlin/com/example/locationtracker/data/local/LocalDataSourceImpl.kt`](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/local/LocalDataSourceImpl.kt) (Local data source), [`app/src/main/kotlin/com/example/locationtracker/domain/usecase`](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/domain/usecase) (Use cases)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["App experience"]
  node_feature_ui["Feature screens"]
  node_viewmodels["Feature ViewModels"]
  node_map["Live map"]
  node_history["Location history"]
  node_social["Friends and family"]
  node_activity["Activity feed"]
end

subgraph group_domain["Domain logic"]
  node_usecases["Use cases"]
  node_repositories["Repository interfaces"]
end

subgraph group_data["Persistence and sync"]
  node_repository_impl["Repository implementations"]
  node_local_data["Local data source"]
  node_room[("Room database<br/>[AppDatabase.kt]")]
  node_remote_data["Remote data source"]
end

subgraph group_runtime["Tracking and messaging"]
  node_tracking_service["Foreground tracking"]
  node_location_client["Location client"]
  node_notifications["Push notifications"]
end

node_user(("App user"))
node_firestore[("Firebase backend")]
node_fcm["Firebase messaging"]

node_user -->|"acts in"| node_feature_ui
node_feature_ui -->|"emits actions"| node_viewmodels
node_viewmodels -->|"orchestrates"| node_usecases
node_usecases -.->|"uses"| node_repositories
node_repositories -.->|"implemented by"| node_repository_impl
node_repository_impl -->|"caches locally"| node_local_data
node_local_data -.->|"persists in"| node_room
node_repository_impl -->|"syncs remotely"| node_remote_data
node_remote_data -.->|"syncs with"| node_firestore
node_feature_ui -->|"observes streams"| node_local_data
node_tracking_service -.->|"gets location"| node_location_client
node_notifications -.->|"uses messaging"| node_fcm
node_map -.->|"shows locations"| node_user
node_history -.->|"shows timeline"| node_user
node_social -.->|"manages contacts"| node_user
node_activity -.->|"shows activity"| node_user

click node_feature_ui "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature"
click node_viewmodels "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature"
click node_map "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/feature/live_location/LiveLocationMapScreen.kt"
click node_history "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature/location_history"
click node_social "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature"
click node_activity "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature/feed"
click node_usecases "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/domain/usecase"
click node_repositories "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/domain/repository"
click node_repository_impl "https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/data/repository"
click node_local_data "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/local/LocalDataSourceImpl.kt"
click node_room "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/room/AppDatabase.kt"
click node_remote_data "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/remote/RemoteDataSourceImpl.kt"
click node_tracking_service "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/core/service/LocationUpdateService.kt"
click node_location_client "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/location/DefaultLocationClient.kt"
click node_notifications "https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/core/notification/NotificationService.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_feature_ui,node_viewmodels,node_map,node_history,node_social,node_activity,node_user toneBlue
class node_usecases,node_repositories,node_firestore toneAmber
class node_repository_impl,node_local_data,node_room,node_remote_data toneMint
class node_tracking_service,node_location_client,node_notifications toneRose
class node_fcm toneIndigo
```

## Components

### App experience

- [Feature screens](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature): `app/src/main/kotlin/com/example/locationtracker/feature`
- [Feature ViewModels](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature): `app/src/main/kotlin/com/example/locationtracker/feature`
- [Live map](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/feature/live_location/LiveLocationMapScreen.kt): `app/src/main/kotlin/com/example/locationtracker/feature/live_location/LiveLocationMapScreen.kt`
- [Location history](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature/location_history): `app/src/main/kotlin/com/example/locationtracker/feature/location_history`
- [Friends and family](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature): `app/src/main/kotlin/com/example/locationtracker/feature`
- [Activity feed](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/feature/feed): `app/src/main/kotlin/com/example/locationtracker/feature/feed`

### Domain logic

- [Use cases](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/domain/usecase): `app/src/main/kotlin/com/example/locationtracker/domain/usecase`
- [Repository interfaces](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/domain/repository): `app/src/main/kotlin/com/example/locationtracker/domain/repository`

### Persistence and sync

- [Repository implementations](https://github.com/flstupid/locationtracker/tree/main/app/src/main/kotlin/com/example/locationtracker/data/repository): `app/src/main/kotlin/com/example/locationtracker/data/repository`
- [Local data source](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/local/LocalDataSourceImpl.kt): `app/src/main/kotlin/com/example/locationtracker/data/local/LocalDataSourceImpl.kt`
- [Room database](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/room/AppDatabase.kt): `app/src/main/kotlin/com/example/locationtracker/data/room/AppDatabase.kt`
- [Remote data source](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/remote/RemoteDataSourceImpl.kt): `app/src/main/kotlin/com/example/locationtracker/data/remote/RemoteDataSourceImpl.kt`

### Tracking and messaging

- [Foreground tracking](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/core/service/LocationUpdateService.kt): `app/src/main/kotlin/com/example/locationtracker/core/service/LocationUpdateService.kt`
- [Location client](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/data/location/DefaultLocationClient.kt): `app/src/main/kotlin/com/example/locationtracker/data/location/DefaultLocationClient.kt`
- [Push notifications](https://github.com/flstupid/locationtracker/blob/main/app/src/main/kotlin/com/example/locationtracker/core/notification/NotificationService.kt): `app/src/main/kotlin/com/example/locationtracker/core/notification/NotificationService.kt`

### Other components

- **App user**
- **Firebase backend**
- **Firebase messaging**

## Connections

- App user → Feature screens: acts in (evidence: `README.md`)
- Feature screens → Feature ViewModels: emits actions (evidence: `README.md`)
- Feature ViewModels → Use cases: orchestrates (evidence: `README.md`)
- Use cases → Repository interfaces: uses
- Repository interfaces → Repository implementations: implemented by
- Repository implementations → Local data source: caches locally (evidence: `README.md`)
- Local data source → Room database: persists in
- Repository implementations → Remote data source: syncs remotely (evidence: `README.md`)
- Remote data source → Firebase backend: syncs with
- Feature screens → Local data source: observes streams (evidence: `README.md`)
- Foreground tracking → Location client: gets location
- Push notifications → Firebase messaging: uses messaging
- Live map → App user: shows locations
- Location history → App user: shows timeline
- Friends and family → App user: manages contacts
- Activity feed → App user: shows activity
