# whalemo/catmap architecture

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

- Interactive diagram: https://gitdiagram.com/whalemo/catmap
- Repository: https://github.com/whalemo/catmap

## Overview

CatMap is an Android community app for discovering cats on a map, photographing sightings, publishing them with location, and connecting through profiles and messaging. The main journey runs from map discovery through camera capture and upload to community posts; users can also authenticate, inspect feeding spots, follow profiles, comment, and chat. Feature-based UI and ViewModels sit above repositories and session/location infrastructure, with Firebase and Google Maps as documented backend integrations. Some feature implementations were not sampled, so those links reflect README descriptions rather than inspected calls.

Main entry points: [`app/src/main/java/com/beem/catmap/data/repository`](https://github.com/whalemo/catmap/tree/master/app/src/main/java/com/beem/catmap/data/repository) (Firebase repositories), [`app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt`](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt) (Cat discovery map), [`app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt`](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt) (Current user session), [`app/src/main/java/com/beem/catmap/maps/MapsActivity.java`](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/maps/MapsActivity.java) (Activity shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_shell["Activity shell<br/>[MapsActivity.java]"]
  node_navigation["Screen navigation"]
  node_auth["Authentication<br/>[AuthRepository.kt]"]
end

subgraph group_social["Community and chat"]
  node_profile["Profiles and follows"]
  node_posts["Posts and comments<br/>[PostViewModel.kt]"]
  node_chat["Realtime messaging"]
  node_badges["Badges<br/>[BadgeViewModel.kt]"]
  node_reports["Community reports<br/>[ReportViewModel.kt]"]
end

subgraph group_domain["Location and publishing"]
  node_map["Cat discovery map<br/>[CatMapFragment.kt]"]
  node_spot["Feeding spot details"]
  node_spotops["Spot operations"]
  node_camera["Photo capture<br/>[CameraViewModel.kt]"]
  node_upload["Sightings upload<br/>[UploadViewModel.kt]"]
end

subgraph group_foundation["Data and platform"]
  node_location["Location engine<br/>[LocationEngine.kt]"]
  node_repositories["Firebase repositories"]
  node_session["Current user session"]
  node_user_model["User data model<br/>[UserModel.kt]"]
end

node_user(("App user"))
node_firebase[("Firebase services")]
node_maps_service["Google Maps"]

node_user -->|"opens app"| node_shell
node_shell -->|"hosts navigation"| node_navigation
node_user -->|"explores cats"| node_map
node_map -->|"reads location"| node_location
node_map -->|"opens details"| node_spot
node_map -.->|"opens operations"| node_spotops
node_user -->|"captures photos"| node_camera
node_camera -->|"submits photos"| node_upload
node_upload -->|"publishes sighting"| node_repositories
node_user -->|"signs in"| node_auth
node_auth -->|"authenticates"| node_firebase
node_profile -->|"loads profiles"| node_repositories
node_posts -->|"loads community posts"| node_repositories
node_chat -->|"sends messages"| node_repositories
node_badges -.->|"loads badges"| node_repositories
node_reports -.->|"submits reports"| node_repositories
node_repositories -->|"accesses cloud data"| node_firebase
node_map -->|"renders map"| node_maps_service
node_location -.->|"provides coordinates"| node_maps_service
node_session -->|"stores user state"| node_user_model
node_session -->|"checks auth state"| node_firebase

click node_shell "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/maps/MapsActivity.java"
click node_navigation "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/navigation/SmartNavigationEngine.kt"
click node_map "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt"
click node_location "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/engine/location/LocationEngine.kt"
click node_spot "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/feedingspot/FeedingSpotViewModel.kt"
click node_spotops "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/spotoperation/SpotOperationFragment.kt"
click node_camera "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/camera/CameraViewModel.kt"
click node_upload "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/upload/UploadViewModel.kt"
click node_profile "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/profile_v2/otherprofile/OtherProfileViewModel.kt"
click node_posts "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/profile/post/PostViewModel.kt"
click node_chat "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/message/MessageViewModel.kt"
click node_auth "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/repository/AuthRepository.kt"
click node_badges "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/badge/BadgeViewModel.kt"
click node_reports "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/report/ReportViewModel.kt"
click node_repositories "https://github.com/whalemo/catmap/tree/master/app/src/main/java/com/beem/catmap/data/repository"
click node_session "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt"
click node_user_model "https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/model/UserModel.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_shell,node_navigation,node_auth,node_user toneBlue
class node_profile,node_posts,node_chat,node_badges,node_reports,node_firebase toneAmber
class node_map,node_spot,node_spotops,node_camera,node_upload toneMint
class node_location,node_repositories,node_session,node_user_model toneRose
class node_maps_service toneIndigo
```

## Components

### App experience

- [Activity shell](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/maps/MapsActivity.java): `app/src/main/java/com/beem/catmap/maps/MapsActivity.java`
- [Screen navigation](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/navigation/SmartNavigationEngine.kt): `app/src/main/java/com/beem/catmap/ui/navigation/SmartNavigationEngine.kt`
- [Authentication](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/repository/AuthRepository.kt): `app/src/main/java/com/beem/catmap/data/repository/AuthRepository.kt`

### Community and chat

- [Profiles and follows](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/profile_v2/otherprofile/OtherProfileViewModel.kt): `app/src/main/java/com/beem/catmap/ui/profile_v2/otherprofile/OtherProfileViewModel.kt`
- [Posts and comments](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/profile/post/PostViewModel.kt): `app/src/main/java/com/beem/catmap/ui/profile/post/PostViewModel.kt`
- [Realtime messaging](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/message/MessageViewModel.kt): `app/src/main/java/com/beem/catmap/ui/message/MessageViewModel.kt`
- [Badges](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/badge/BadgeViewModel.kt): `app/src/main/java/com/beem/catmap/ui/badge/BadgeViewModel.kt`
- [Community reports](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/report/ReportViewModel.kt): `app/src/main/java/com/beem/catmap/ui/report/ReportViewModel.kt`

### Location and publishing

- [Cat discovery map](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt): `app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt`
- [Feeding spot details](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/feedingspot/FeedingSpotViewModel.kt): `app/src/main/java/com/beem/catmap/ui/feedingspot/FeedingSpotViewModel.kt`
- [Spot operations](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/spotoperation/SpotOperationFragment.kt): `app/src/main/java/com/beem/catmap/ui/spotoperation/SpotOperationFragment.kt`
- [Photo capture](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/camera/CameraViewModel.kt): `app/src/main/java/com/beem/catmap/ui/camera/CameraViewModel.kt`
- [Sightings upload](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/ui/upload/UploadViewModel.kt): `app/src/main/java/com/beem/catmap/ui/upload/UploadViewModel.kt`

### Data and platform

- [Location engine](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/engine/location/LocationEngine.kt): `app/src/main/java/com/beem/catmap/engine/location/LocationEngine.kt`
- [Firebase repositories](https://github.com/whalemo/catmap/tree/master/app/src/main/java/com/beem/catmap/data/repository): `app/src/main/java/com/beem/catmap/data/repository`
- [Current user session](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt): `app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt`
- [User data model](https://github.com/whalemo/catmap/blob/master/app/src/main/java/com/beem/catmap/data/model/UserModel.kt): `app/src/main/java/com/beem/catmap/data/model/UserModel.kt`

### Other components

- **App user**
- **Firebase services**
- **Google Maps**

## Connections

- App user → Activity shell: opens app
- Activity shell → Screen navigation: hosts navigation (evidence: `app/src/main/java/com/beem/catmap/maps/MapsActivity.java`)
- App user → Cat discovery map: explores cats
- Cat discovery map → Location engine: reads location (evidence: `app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt`)
- Cat discovery map → Feeding spot details: opens details (evidence: `app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt`)
- Cat discovery map → Spot operations: opens operations (evidence: `app/src/main/java/com/beem/catmap/ui/map/CatMapFragment.kt`)
- App user → Photo capture: captures photos
- Photo capture → Sightings upload: submits photos
- Sightings upload → Firebase repositories: publishes sighting
- App user → Authentication: signs in
- Authentication → Firebase services: authenticates
- Profiles and follows → Firebase repositories: loads profiles
- Posts and comments → Firebase repositories: loads community posts
- Realtime messaging → Firebase repositories: sends messages
- Badges → Firebase repositories: loads badges
- Community reports → Firebase repositories: submits reports
- Firebase repositories → Firebase services: accesses cloud data
- Cat discovery map → Google Maps: renders map
- Location engine → Google Maps: provides coordinates
- Current user session → User data model: stores user state (evidence: `app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt`)
- Current user session → Firebase services: checks auth state (evidence: `app/src/main/java/com/beem/catmap/data/session/CurrentUserManager.kt`)
