# martinolee/messenger architecture

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

- Interactive diagram: https://gitdiagram.com/martinolee/messenger
- Repository: https://github.com/martinolee/messenger

## Overview

Messenger is an iOS messaging app organized around ReactorKit-driven screens and Firebase-backed account and user services. The visible flow is app composition into authentication, then the main tabs; the Friends tab supports friend lookup and profile viewing. The Messages screen is present, but its controller has no behavior in the sampled source, so no message-delivery pipeline is shown. The README contains no capability details, and several feature implementations were not sampled; uncertain links are omitted.

Main entry points: [`Messenger/Messenger/Source/Application/CompositionRoot.swift`](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Application/CompositionRoot.swift) (Composition Root), [`Messenger/Messenger/Source/Friends/FriendsViewController.swift`](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Friends/FriendsViewController.swift) (Friends List), [`Messenger/Messenger/Source/Services/AuthService.swift`](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Services/AuthService.swift) (Authentication), [`Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift`](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift) (Main Tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Navigation"]
  node_user(("User"))
  node_composition["Composition Root"]
  node_splash["Splash"]
  node_tabbar["Main Tabs"]
  node_messages["Messages"]
  node_settings["Settings"]
end

subgraph group_identity["Identity"]
  node_login["Login"]
  node_signup["Signup"]
  node_auth["Authentication<br/>[AuthService.swift]"]
  node_firebaseauth["Firebase Auth"]
end

subgraph group_social["Friends"]
  node_friends["Friends List"]
  node_friendcell["Friend Cell"]
  node_addfriends["Add Friends"]
  node_profile["Friend Profile"]
end

subgraph group_shared["Shared Services"]
  node_usermanager["User Manager<br/>[UserManager.swift]"]
  node_database[("User Database")]
  node_userrecord["User Record<br/>[User.swift]"]
end

node_user -->|"launches"| node_composition
node_composition -->|"creates"| node_splash
node_composition -->|"creates"| node_login
node_composition -->|"creates"| node_tabbar
node_composition -->|"creates"| node_friends
node_composition -->|"creates"| node_messages
node_composition -->|"creates"| node_settings
node_login -->|"authenticates"| node_auth
node_signup -->|"registers"| node_auth
node_auth -->|"uses"| node_firebaseauth
node_auth -->|"creates user"| node_database
node_friends -->|"fetches friends"| node_usermanager
node_friends -->|"updates cells"| node_friendcell
node_friends -->|"presents"| node_addfriends
node_friends -->|"presents"| node_profile
node_usermanager -->|"reads users"| node_database
node_database -->|"maps records"| node_userrecord
node_settings -->|"logs out"| node_auth
node_tabbar -->|"contains tab"| node_friends
node_tabbar -->|"contains tab"| node_messages
node_tabbar -->|"contains tab"| node_settings

click node_composition "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Application/CompositionRoot.swift"
click node_splash "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Splash/ViewControllers/SplashViewReactor.swift"
click node_tabbar "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift"
click node_messages "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Messages/MessagesViewController.swift"
click node_login "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Login/LoginViewReactor.swift"
click node_signup "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Signup/Reactor/SignupViewReactor.swift"
click node_auth "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Services/AuthService.swift"
click node_friends "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Friends/FriendsViewController.swift"
click node_friendcell "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Friends/FriendCellReactor.swift"
click node_addfriends "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/AddFriends/AddFriendsViewController.swift"
click node_profile "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Profile/ProfileViewController.swift"
click node_usermanager "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Managers/UserManager/UserManager.swift"
click node_database "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Services/DatabaseService.swift"
click node_userrecord "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Models/User.swift"
click node_settings "https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Settings/SettingsViewController.swift"

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_user,node_composition,node_splash,node_tabbar,node_messages,node_settings toneBlue
class node_login,node_signup,node_auth,node_firebaseauth toneAmber
class node_friends,node_friendcell,node_addfriends,node_profile toneMint
class node_usermanager,node_database,node_userrecord toneRose
```

## Components

### App Navigation

- **User**
- [Composition Root](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Application/CompositionRoot.swift): `Messenger/Messenger/Source/Application/CompositionRoot.swift`
- [Splash](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Splash/ViewControllers/SplashViewReactor.swift): `Messenger/Messenger/Source/Splash/ViewControllers/SplashViewReactor.swift`
- [Main Tabs](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift): `Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift`
- [Messages](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Messages/MessagesViewController.swift): `Messenger/Messenger/Source/Messages/MessagesViewController.swift`
- [Settings](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Settings/SettingsViewController.swift): `Messenger/Messenger/Source/Settings/SettingsViewController.swift`

### Identity

- [Login](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Login/LoginViewReactor.swift): `Messenger/Messenger/Source/Login/LoginViewReactor.swift`
- [Signup](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Signup/Reactor/SignupViewReactor.swift): `Messenger/Messenger/Source/Signup/Reactor/SignupViewReactor.swift`
- [Authentication](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Services/AuthService.swift): `Messenger/Messenger/Source/Services/AuthService.swift`
- **Firebase Auth**

### Friends

- [Friends List](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Friends/FriendsViewController.swift): `Messenger/Messenger/Source/Friends/FriendsViewController.swift`
- [Friend Cell](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Friends/FriendCellReactor.swift): `Messenger/Messenger/Source/Friends/FriendCellReactor.swift`
- [Add Friends](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/AddFriends/AddFriendsViewController.swift): `Messenger/Messenger/Source/AddFriends/AddFriendsViewController.swift`
- [Friend Profile](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Profile/ProfileViewController.swift): `Messenger/Messenger/Source/Profile/ProfileViewController.swift`

### Shared Services

- [User Manager](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Managers/UserManager/UserManager.swift): `Messenger/Messenger/Source/Managers/UserManager/UserManager.swift`
- [User Database](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Services/DatabaseService.swift): `Messenger/Messenger/Source/Services/DatabaseService.swift`
- [User Record](https://github.com/martinolee/messenger/blob/master/Messenger/Messenger/Source/Models/User.swift): `Messenger/Messenger/Source/Models/User.swift`

## Connections

- User → Composition Root: launches (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Composition Root → Splash: creates (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Composition Root → Login: creates (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Composition Root → Main Tabs: creates (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Composition Root → Friends List: creates (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Composition Root → Messages: creates (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Composition Root → Settings: creates (evidence: `Messenger/Messenger/Source/Application/CompositionRoot.swift`)
- Login → Authentication: authenticates (evidence: `Messenger/Messenger/Source/Login/LoginViewReactor.swift`)
- Signup → Authentication: registers (evidence: `Messenger/Messenger/Source/Signup/Reactor/SignupViewReactor.swift`)
- Authentication → Firebase Auth: uses (evidence: `Messenger/Messenger/Source/Services/AuthService.swift`)
- Authentication → User Database: creates user (evidence: `Messenger/Messenger/Source/Services/AuthService.swift`)
- Friends List → User Manager: fetches friends
- Friends List → Friend Cell: updates cells (evidence: `Messenger/Messenger/Source/Friends/FriendsViewController.swift`)
- Friends List → Add Friends: presents (evidence: `Messenger/Messenger/Source/Friends/FriendsViewController.swift`)
- Friends List → Friend Profile: presents (evidence: `Messenger/Messenger/Source/Friends/FriendsViewController.swift`)
- User Manager → User Database: reads users (evidence: `Messenger/Messenger/Source/Managers/UserManager/UserManager.swift`)
- User Database → User Record: maps records (evidence: `Messenger/Messenger/Source/Services/DatabaseService.swift`)
- Settings → Authentication: logs out (evidence: `Messenger/Messenger/Source/Settings/SettingsViewController.swift`)
- Main Tabs → Friends List: contains tab (evidence: `Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift`)
- Main Tabs → Messages: contains tab (evidence: `Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift`)
- Main Tabs → Settings: contains tab (evidence: `Messenger/Messenger/Source/TabBar/Controllers/MainTabBarController.swift`)
