# gthbd/photos architecture

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

- Interactive diagram: https://gitdiagram.com/gthbd/photos
- Repository: https://github.com/gthbd/photos

## Overview

This appears to be an Android photo-browsing app: a user enters the app, encounters media access, browses a media screen, and may open a viewer. The tree identifies the likely entry point, navigation, permission, repository, view-model, and screen components, but no runtime source or README was provided. Consequently, the relationships below are tentative and marked dashed; the implementation details and any additional capabilities remain unverified.

Main entry points: [`app/src/main/java/com/example/photos/ui/components/AppNavHost.kt`](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/components/AppNavHost.kt) (Navigation host), [`app/src/main/java/com/example/photos/ui/components/MediaViewModel.kt`](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/components/MediaViewModel.kt) (Media view model), [`app/src/main/java/com/example/photos/MainActivity.kt`](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/MainActivity.kt) (Main activity), [`app/src/main/java/com/example/photos/ui/screens/PermissionScreen.kt`](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/PermissionScreen.kt) (Permission screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_activity["Main activity<br/>[MainActivity.kt]"]
  node_navigation["Navigation host<br/>[AppNavHost.kt]"]
end

subgraph group_media["Media access"]
  node_permissions["Media permissions"]
  node_repository["Media repository<br/>[MediaRepository.kt]"]
  node_viewmodel["Media view model<br/>[MediaViewModel.kt]"]
end

subgraph group_ui["Photo interface"]
  node_permission_screen["Permission screen"]
  node_main_screen["Gallery screen<br/>[MainScreen.kt]"]
  node_viewer_screen["Photo viewer<br/>[ViewerScreen.kt]"]
end

node_user(("User"))

node_user -.->|"opens"| node_activity
node_activity -.->|"starts"| node_navigation
node_navigation -.->|"routes to"| node_permission_screen
node_navigation -.->|"routes to"| node_main_screen
node_navigation -.->|"routes to"| node_viewer_screen
node_permission_screen -.->|"checks access"| node_permissions
node_main_screen -.->|"requests media"| node_viewmodel
node_viewmodel -.->|"loads media"| node_repository
node_viewer_screen -.->|"uses selection"| node_viewmodel

click node_activity "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/MainActivity.kt"
click node_navigation "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/components/AppNavHost.kt"
click node_permissions "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/permission/MediaPermissions.kt"
click node_repository "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/data/MediaRepository.kt"
click node_viewmodel "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/components/MediaViewModel.kt"
click node_permission_screen "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/PermissionScreen.kt"
click node_main_screen "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/MainScreen.kt"
click node_viewer_screen "https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/ViewerScreen.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_activity,node_navigation,node_user toneBlue
class node_permissions,node_repository,node_viewmodel toneAmber
class node_permission_screen,node_main_screen,node_viewer_screen toneMint
```

## Components

### App navigation

- [Main activity](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/MainActivity.kt): `app/src/main/java/com/example/photos/MainActivity.kt`
- [Navigation host](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/components/AppNavHost.kt): `app/src/main/java/com/example/photos/ui/components/AppNavHost.kt`

### Media access

- [Media permissions](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/permission/MediaPermissions.kt): `app/src/main/java/com/example/photos/permission/MediaPermissions.kt`
- [Media repository](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/data/MediaRepository.kt): `app/src/main/java/com/example/photos/data/MediaRepository.kt`
- [Media view model](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/components/MediaViewModel.kt): `app/src/main/java/com/example/photos/ui/components/MediaViewModel.kt`

### Photo interface

- [Permission screen](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/PermissionScreen.kt): `app/src/main/java/com/example/photos/ui/screens/PermissionScreen.kt`
- [Gallery screen](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/MainScreen.kt): `app/src/main/java/com/example/photos/ui/screens/MainScreen.kt`
- [Photo viewer](https://github.com/gthbd/photos/blob/main/app/src/main/java/com/example/photos/ui/screens/ViewerScreen.kt): `app/src/main/java/com/example/photos/ui/screens/ViewerScreen.kt`

### Other components

- **User**

## Connections

- User → Main activity: opens
- Main activity → Navigation host: starts
- Navigation host → Permission screen: routes to
- Navigation host → Gallery screen: routes to
- Navigation host → Photo viewer: routes to
- Permission screen → Media permissions: checks access
- Gallery screen → Media view model: requests media
- Media view model → Media repository: loads media
- Photo viewer → Media view model: uses selection
