# eleazarcoleshowers/local-hive architecture

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

- Interactive diagram: https://gitdiagram.com/eleazarcoleshowers/local-hive
- Repository: https://github.com/eleazarcoleshowers/local-hive

## Overview

#### Purpose and runtime
LocalHive is a native Android community/residential-estate application. It supports authentication and profile onboarding, estate membership/admin workflows, a community feed, directory, direct messages, and notifications. It is a Kotlin/Gradle Android app, with Jetpack Compose UI, Hilt-style dependency modules, Room local persistence, and Firebase-backed remote capabilities.

#### Application entry and composition
Android launches the activity declared through `app/src/main/AndroidManifest.xml`; `app/src/main/java/com/eleazar/localhive/MainActivity.kt` establishes the Compose application UI. `app/src/main/java/com/eleazar/localhive/data/MyApplication.kt` is the application-level bootstrap point. Navigation is centralized in `app/src/main/java/com/eleazar/localhive/ui/navigation/NavGraph.kt`, with route definitions in `app/src/main/java/com/eleazar/localhive/ui/navigation/Routes.kt`.

#### UI feature boundaries
Presentation is organized by feature, with Compose screens paired with state-owning ViewModels. Authentication/onboarding is under `app/src/main/java/com/eleazar/localhive/ui/auth/AuthViewModel.kt` and `app/src/main/java/com/eleazar/localhive/ui/auth/AuthScaffold.kt`. The post feed is driven by `app/src/main/java/com/eleazar/localhive/ui/feed/FeedViewModel.kt`; estate selection, joining, creation, and administration by `app/src/main/java/com/eleazar/localhive/ui/estate/EstateViewModel.kt`; messaging by `app/src/main/java/com/eleazar/localhive/ui/messages/MessagesViewModel.kt`.

#### Domain contracts and models
The domain layer defines repository interfaces that isolate UI from storage and Firebase details: `app/src/main/java/com/eleazar/localhive/domain/AuthRepository.kt`, `app/src/main/java/com/eleazar/localhive/domain/EstateRepository.kt`, and `app/src/main/java/com/eleazar/localhive/domain/PostRepository.kt`. Shared business entities—including users, estates, posts, chats, messages, join requests, comments, and notifications—live in `app/src/main/java/com/eleazar/localhive/domain/model/`. UI ViewModels should depend on these contracts rather than concrete data sources.

#### Repository and Firebase boundary
Concrete repository implementations mediate feature operations and external data access: `app/src/main/java/com/eleazar/localhive/data/authentication/AuthRepositoryImpl.kt`, `app/src/main/java/com/eleazar/localhive/data/repository/EstateRepositoryImpl.kt`, and `app/src/main/java/com/eleazar/localhive/data/repository/MessageRepositoryImpl.kt`. Firebase dependencies are provisioned through `app/src/main/java/com/eleazar/localhive/di/FirebaseModule.kt`; Cloud Firestore access is governed by `firestore.rules`. Authentication, remote estate/feed/chat data, and notifications therefore cross this repository boundary.

#### Local persistence
Room provides a local user-data boundary: `app/src/main/java/com/eleazar/localhive/data/local/database/LocalHiveDatabase.kt`, `app/src/main/java/com/eleazar/localhive/data/local/dao/UserDao.kt`, and `app/src/main/java/com/eleazar/localhive/data/local/entity/UserEntity.kt`. `UserMapper.kt` translates persistence entities to domain user models. Database bindings are assembled in `app/src/main/java/com/eleazar/localhive/di/DatabaseModule.kt`.

#### Dependency assembly and push delivery
Dependency wiring selects repository implementations in `app/src/main/java/com/eleazar/localhive/di/RepositoryModule.kt`, making implementations replaceable behind domain contracts. Firebase Cloud Messaging enters via `app/src/main/java/com/eleazar/localhive/data/remote/messaging/MyFirebaseService.kt`; notification UI state and display flow are handled by `app/src/main/java/com/eleazar/localhive/ui/notifications/NotificationViewModel.kt` and `NotificationsScreen.kt`.

Main entry points: [`app/src/main/java/com/eleazar/localhive/ui/navigation/NavGraph.kt`](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/navigation/NavGraph.kt) (Navigation graph), [`firestore.rules`](https://github.com/eleazarcoleshowers/local-hive/blob/main/firestore.rules) (Firebase Auth and Firestore), [`app/src/main/java/com/eleazar/localhive/data/authentication/AuthRepositoryImpl.kt`](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/authentication/AuthRepositoryImpl.kt) (Auth repository implementation), [`app/src/main/java/com/eleazar/localhive/data/repository/EstateRepositoryImpl.kt`](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/repository/EstateRepositoryImpl.kt) (Estate repository implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_manifest["Android manifest<br/>Android entry"]
  node_application["Application bootstrap<br/>[MyApplication.kt]"]
  node_activity["Main activity<br/>Compose host<br/>[MainActivity.kt]"]
end

subgraph group_ui["Compose presentation"]
  node_navigation["Navigation graph<br/>Routes<br/>[NavGraph.kt]"]
  node_auth_ui["Auth and onboarding<br/>ViewModel + UI<br/>[AuthViewModel.kt]"]
  node_feed_ui["Community feed<br/>ViewModel<br/>[FeedViewModel.kt]"]
  node_estate_ui["Estate workflows<br/>ViewModel<br/>[EstateViewModel.kt]"]
  node_messages_ui["Direct messages<br/>ViewModel"]
  node_notifications_ui["Notifications<br/>ViewModel + screen"]
end

subgraph group_domain["Domain"]
  node_auth_contract{{"Auth repository contract<br/>Domain interface<br/>[AuthRepository.kt]"}}
  node_estate_contract{{"Estate repository contract<br/>Domain interface"}}
  node_post_contract{{"Post repository contract<br/>Domain interface<br/>[PostRepository.kt]"}}
  node_domain_models["Community models<br/>Domain entities"]
end

subgraph group_data["Data and DI"]
  node_auth_repo["Auth repository implementation"]
  node_estate_repo["Estate repository implementation"]
  node_message_repo["Message repository implementation"]
  node_repository_di["Repository bindings<br/>DI module"]
  node_room[("Room user store<br/>Local database")]
end

subgraph group_firebase["Firebase services"]
  node_firebase_di["Firebase provisioning<br/>DI module<br/>[FirebaseModule.kt]"]
  node_firebase_remote[("Firebase Auth and Firestore<br/>Remote backend<br/>[firestore.rules]")]
  node_fcm_service["FCM delivery service<br/>Push service"]
end

node_manifest -->|"launches"| node_activity
node_application -->|"initializes DI"| node_repository_di
node_application -->|"initializes DI"| node_firebase_di
node_activity -->|"hosts"| node_navigation
node_navigation -->|"auth routes"| node_auth_ui
node_navigation -->|"feed routes"| node_feed_ui
node_navigation -->|"estate routes"| node_estate_ui
node_navigation -->|"message routes"| node_messages_ui
node_navigation -->|"notification routes"| node_notifications_ui
node_auth_ui -->|"depends on"| node_auth_contract
node_feed_ui -->|"depends on"| node_post_contract
node_estate_ui -->|"depends on"| node_estate_contract
node_repository_di -->|"binds"| node_auth_repo
node_repository_di -->|"binds"| node_estate_repo
node_auth_repo -.->|"implements"| node_auth_contract
node_estate_repo -.->|"implements"| node_estate_contract
node_auth_repo -->|"persists user data"| node_room
node_auth_repo -->|"authenticates"| node_firebase_remote
node_estate_repo -->|"reads and writes estates"| node_firebase_remote
node_message_repo -->|"syncs chats"| node_firebase_remote
node_firebase_di -->|"provides clients"| node_firebase_remote
node_fcm_service -->|"delivers notification state"| node_notifications_ui
node_fcm_service -->|"receives push"| node_firebase_remote
node_auth_contract -->|"uses"| node_domain_models
node_estate_contract -->|"uses"| node_domain_models
node_post_contract -->|"uses"| node_domain_models

click node_manifest "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/AndroidManifest.xml"
click node_application "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/MyApplication.kt"
click node_activity "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/MainActivity.kt"
click node_navigation "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/navigation/NavGraph.kt"
click node_auth_ui "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/auth/AuthViewModel.kt"
click node_feed_ui "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/feed/FeedViewModel.kt"
click node_estate_ui "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/estate/EstateViewModel.kt"
click node_messages_ui "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/messages/MessagesViewModel.kt"
click node_notifications_ui "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/notifications/NotificationViewModel.kt"
click node_auth_contract "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/domain/AuthRepository.kt"
click node_estate_contract "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/domain/EstateRepository.kt"
click node_post_contract "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/domain/PostRepository.kt"
click node_auth_repo "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/authentication/AuthRepositoryImpl.kt"
click node_estate_repo "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/repository/EstateRepositoryImpl.kt"
click node_message_repo "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/repository/MessageRepositoryImpl.kt"
click node_repository_di "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/di/RepositoryModule.kt"
click node_room "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/local/database/LocalHiveDatabase.kt"
click node_firebase_di "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/di/FirebaseModule.kt"
click node_firebase_remote "https://github.com/eleazarcoleshowers/local-hive/blob/main/firestore.rules"
click node_fcm_service "https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/remote/messaging/MyFirebaseService.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_manifest,node_application,node_activity toneBlue
class node_navigation,node_auth_ui,node_feed_ui,node_estate_ui,node_messages_ui,node_notifications_ui toneAmber
class node_auth_contract,node_estate_contract,node_post_contract,node_domain_models toneMint
class node_auth_repo,node_estate_repo,node_message_repo,node_repository_di,node_room toneRose
class node_firebase_di,node_firebase_remote,node_fcm_service toneIndigo
```

## Components

### App shell

- [Android manifest](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/AndroidManifest.xml): Android entry · `app/src/main/AndroidManifest.xml`
- [Application bootstrap](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/MyApplication.kt): Application · `app/src/main/java/com/eleazar/localhive/data/MyApplication.kt`
- [Main activity](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/MainActivity.kt): Compose host · `app/src/main/java/com/eleazar/localhive/MainActivity.kt`

### Compose presentation

- [Navigation graph](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/navigation/NavGraph.kt): Routes · Central Compose navigation and route definitions. · `app/src/main/java/com/eleazar/localhive/ui/navigation/NavGraph.kt`
- [Auth and onboarding](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/auth/AuthViewModel.kt): ViewModel + UI · `app/src/main/java/com/eleazar/localhive/ui/auth/AuthViewModel.kt`
- [Community feed](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/feed/FeedViewModel.kt): ViewModel · `app/src/main/java/com/eleazar/localhive/ui/feed/FeedViewModel.kt`
- [Estate workflows](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/estate/EstateViewModel.kt): ViewModel · Selection, joining, creation, and administration. · `app/src/main/java/com/eleazar/localhive/ui/estate/EstateViewModel.kt`
- [Direct messages](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/messages/MessagesViewModel.kt): ViewModel · `app/src/main/java/com/eleazar/localhive/ui/messages/MessagesViewModel.kt`
- [Notifications](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/ui/notifications/NotificationViewModel.kt): ViewModel + screen · `app/src/main/java/com/eleazar/localhive/ui/notifications/NotificationViewModel.kt`

### Domain

- [Auth repository contract](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/domain/AuthRepository.kt): Domain interface · `app/src/main/java/com/eleazar/localhive/domain/AuthRepository.kt`
- [Estate repository contract](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/domain/EstateRepository.kt): Domain interface · `app/src/main/java/com/eleazar/localhive/domain/EstateRepository.kt`
- [Post repository contract](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/domain/PostRepository.kt): Domain interface · `app/src/main/java/com/eleazar/localhive/domain/PostRepository.kt`
- **Community models**: Domain entities · Users, estates, posts, chats, messages, requests, comments, and notifications.

### Data and DI

- [Auth repository implementation](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/authentication/AuthRepositoryImpl.kt): Repository · `app/src/main/java/com/eleazar/localhive/data/authentication/AuthRepositoryImpl.kt`
- [Estate repository implementation](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/repository/EstateRepositoryImpl.kt): Repository · `app/src/main/java/com/eleazar/localhive/data/repository/EstateRepositoryImpl.kt`
- [Message repository implementation](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/repository/MessageRepositoryImpl.kt): Repository · `app/src/main/java/com/eleazar/localhive/data/repository/MessageRepositoryImpl.kt`
- [Repository bindings](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/di/RepositoryModule.kt): DI module · Selects concrete implementations behind domain contracts. · `app/src/main/java/com/eleazar/localhive/di/RepositoryModule.kt`
- [Room user store](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/local/database/LocalHiveDatabase.kt): Local database · User DAO and entity persistence mapped to domain users. · `app/src/main/java/com/eleazar/localhive/data/local/database/LocalHiveDatabase.kt`

### Firebase services

- [Firebase provisioning](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/di/FirebaseModule.kt): DI module · `app/src/main/java/com/eleazar/localhive/di/FirebaseModule.kt`
- [Firebase Auth and Firestore](https://github.com/eleazarcoleshowers/local-hive/blob/main/firestore.rules): Remote backend · Authentication and remote estate, feed, and chat data. · `firestore.rules`
- [FCM delivery service](https://github.com/eleazarcoleshowers/local-hive/blob/main/app/src/main/java/com/eleazar/localhive/data/remote/messaging/MyFirebaseService.kt): Push service · `app/src/main/java/com/eleazar/localhive/data/remote/messaging/MyFirebaseService.kt`

## Connections

- Android manifest → Main activity: launches
- Application bootstrap → Repository bindings: initializes DI
- Application bootstrap → Firebase provisioning: initializes DI
- Main activity → Navigation graph: hosts
- Navigation graph → Auth and onboarding: auth routes
- Navigation graph → Community feed: feed routes
- Navigation graph → Estate workflows: estate routes
- Navigation graph → Direct messages: message routes
- Navigation graph → Notifications: notification routes
- Auth and onboarding → Auth repository contract: depends on
- Community feed → Post repository contract: depends on
- Estate workflows → Estate repository contract: depends on
- Repository bindings → Auth repository implementation: binds
- Repository bindings → Estate repository implementation: binds
- Auth repository implementation → Auth repository contract: implements
- Estate repository implementation → Estate repository contract: implements
- Auth repository implementation → Room user store: persists user data
- Auth repository implementation → Firebase Auth and Firestore: authenticates
- Estate repository implementation → Firebase Auth and Firestore: reads and writes estates
- Message repository implementation → Firebase Auth and Firestore: syncs chats
- Firebase provisioning → Firebase Auth and Firestore: provides clients
- FCM delivery service → Notifications: delivers notification state
- FCM delivery service → Firebase Auth and Firestore: receives push
- Auth repository contract → Community models: uses
- Estate repository contract → Community models: uses
- Post repository contract → Community models: uses
