# karanjot-singh/microsoft_teams_clone architecture

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

- Interactive diagram: https://gitdiagram.com/karanjot-singh/microsoft_teams_clone
- Repository: https://github.com/karanjot-singh/microsoft_teams_clone

## Overview

#### Purpose and Runtime
This is an Android-focused Flutter/Dart Microsoft Teams-style client for authenticated chat, channels, and video meetings. Flutter owns most UI and app flow; the Android host embeds Flutter and integrates platform SDK setup. Key entry points: `lib/main.dart`, `lib/home_page.dart`, `android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/MainActivity.kt`.

#### Application Bootstrap and Navigation
`lib/main.dart` initializes the application and its service dependencies before rendering the root UI. `lib/home_page.dart` acts as the main authenticated application shell. Named-route registration and route dispatch are separated in `lib/routes/app_routes.dart` and `lib/routes/routes.dart`, forming the boundary between feature pages and global navigation.

#### Identity and Session Boundary
Google sign-in and Firebase authentication establish the user identity used by the rest of the client. The authentication abstraction is in `lib/services/authentication/authentication.dart`; login/account UI is in `lib/pages/login/sign_in_page.dart` and `lib/pages/login/user_info_page.dart`. Firebase Android configuration is supplied through `android/app/google-services.json`.

#### Chat Integration
Stream Chat is the core messaging backend, responsible for real-time conversations and chat state. Service-layer integration is concentrated in `lib/services/stream_chat/stream_api.dart` and `lib/services/stream_chat/chat_list.dart`; feature UI begins at `lib/pages/chats/chats_home_page.dart`. This boundary allows chat pages to support direct/group conversations, threads, pinned messages, reactions, media, and channel operations without owning backend connectivity.

#### Conversation and Channel Flows
Chat navigation branches from chat lists into individual threads, metadata, and channel resources. Primary screens include `lib/pages/chats/thread_page.dart`, `lib/pages/chats/group_chat/channel_page.dart`, and `lib/pages/chats/group_chat/channel_info_page.dart`. New-conversation/channel creation is handled separately under `lib/pages/chats/new_chat/new_chat_page.dart`, with member selection in `lib/pages/chats/new_chat/add_channel_members_page.dart`.

#### Meeting and Collaboration Flows
Meeting UI is organized around browse/create/join flows in `lib/pages/meetings/meetings_page.dart`, `lib/pages/meetings/create_meetings_page.dart`, and `lib/pages/meetings/join_meetings_page.dart`. The declared Jitsi Meet dependency supplies live conferencing capabilities; meeting pages are the Flutter-side control boundary for entering those native/video sessions. Channel file and media views extend collaboration from chat context: `lib/pages/chats/group_chat/channel_file_page.dart`, `lib/pages/chats/group_chat/channel_media_page.dart`.

#### Platform, Notifications, and Delivery
The Android project uses Gradle/AndroidX and contains the native application setup in `android/app/build.gradle` and `android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/Application.kt`. Notification behavior is isolated in `lib/services/notifications/notifications_service.dart`. Required device capabilities—network, camera, microphone, and storage—are declared through Android manifests, principally `android/app/src/main/AndroidManifest.xml`. Release APK artifacts are present in `apks/`.

Main entry points: [`lib/main.dart`](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/main.dart) (App bootstrap), [`lib/pages/chats/chats_home_page.dart`](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/chats_home_page.dart) (Chat lists), [`lib/routes/routes.dart`](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/routes/routes.dart) (Route dispatch), [`lib/services/authentication/authentication.dart`](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/authentication/authentication.dart) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter client"]
  node_main["App bootstrap<br/>Flutter entry point<br/>[main.dart]"]
  node_home["Authenticated shell<br/>Flutter shell<br/>[home_page.dart]"]
  node_route_registry["Route registry<br/>navigation<br/>[app_routes.dart]"]
  node_route_dispatch["Route dispatch<br/>navigation<br/>[routes.dart]"]
  node_sign_in["Sign-in UI<br/>login page<br/>[sign_in_page.dart]"]
  node_user_info["Account UI<br/>profile page"]
  node_chats_home["Chat lists<br/>chat feature"]
  node_conversation_views["Thread and channel views<br/>chat screens<br/>[thread_page.dart]"]
  node_new_chat["New conversation<br/>chat creation<br/>[new_chat_page.dart]"]
  node_channel_resources["Channel resources<br/>collaboration screens"]
  node_meetings["Meeting flows<br/>meeting screens<br/>[meetings_page.dart]"]
end

subgraph group_services["Service integrations"]
  node_auth{{"Authentication service<br/>identity abstraction"}}
  node_firebase[("Firebase Auth<br/>identity backend")]
  node_stream_api{{"Stream Chat API<br/>chat integration<br/>[stream_api.dart]"}}
  node_chat_state["Chat list service<br/>chat state<br/>[chat_list.dart]"]
  node_notifications["Notification service<br/>device notifications"]
end

subgraph group_android["Android host"]
  node_main_activity["Flutter activity<br/>Android entry point<br/>[MainActivity.kt]"]
  node_android_app["Android application<br/>native setup<br/>[Application.kt]"]
  node_android_build["Android build<br/>Gradle module<br/>[build.gradle]"]
  node_manifest["Device permissions<br/>Android manifest"]
  node_jitsi{{"Jitsi Meet<br/>video conferencing SDK"}}
  node_apk["Release APKs<br/>delivery artifacts"]
end

node_main -->|"initializes"| node_auth
node_main -->|"renders"| node_home
node_main -->|"configures"| node_route_registry
node_route_registry -->|"routes through"| node_route_dispatch
node_route_dispatch -->|"opens"| node_sign_in
node_route_dispatch -->|"opens"| node_chats_home
node_route_dispatch -->|"opens"| node_meetings
node_home -->|"hosts"| node_chats_home
node_home -->|"hosts"| node_meetings
node_sign_in -->|"authenticates with"| node_auth
node_user_info -->|"uses session"| node_auth
node_auth -->|"uses"| node_firebase
node_chats_home -->|"loads"| node_chat_state
node_chat_state -->|"uses"| node_stream_api
node_chats_home -->|"navigates to"| node_conversation_views
node_chats_home -->|"creates"| node_new_chat
node_conversation_views -->|"opens"| node_channel_resources
node_meetings -->|"joins sessions via"| node_jitsi
node_main -->|"initializes"| node_notifications
node_main_activity -->|"launches"| node_main
node_android_app -->|"hosts"| node_main_activity
node_android_build -->|"declares"| node_jitsi
node_manifest -->|"permits device access"| node_main_activity
node_android_build -->|"produces"| node_apk

click node_main "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/main.dart"
click node_home "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/home_page.dart"
click node_route_registry "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/routes/app_routes.dart"
click node_route_dispatch "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/routes/routes.dart"
click node_sign_in "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/login/sign_in_page.dart"
click node_user_info "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/login/user_info_page.dart"
click node_chats_home "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/chats_home_page.dart"
click node_conversation_views "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/thread_page.dart"
click node_new_chat "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/new_chat/new_chat_page.dart"
click node_channel_resources "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/group_chat/channel_file_page.dart"
click node_meetings "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/meetings/meetings_page.dart"
click node_auth "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/authentication/authentication.dart"
click node_firebase "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/google-services.json"
click node_stream_api "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/stream_chat/stream_api.dart"
click node_chat_state "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/stream_chat/chat_list.dart"
click node_notifications "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/notifications/notifications_service.dart"
click node_main_activity "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/MainActivity.kt"
click node_android_app "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/Application.kt"
click node_android_build "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/build.gradle"
click node_manifest "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/src/main/AndroidManifest.xml"
click node_apk "https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/apks/MsTeams-arm64-v8a-release.apk"

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_main,node_home,node_route_registry,node_route_dispatch,node_sign_in,node_user_info,node_chats_home,node_conversation_views,node_new_chat,node_channel_resources,node_meetings toneBlue
class node_auth,node_firebase,node_stream_api,node_chat_state,node_notifications toneAmber
class node_main_activity,node_android_app,node_android_build,node_manifest,node_jitsi,node_apk toneMint
```

## Components

### Flutter client

Application UI, routing, and feature flows.

- [App bootstrap](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/main.dart): Flutter entry point · Initializes dependencies and renders the application. · `lib/main.dart`
- [Authenticated shell](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/home_page.dart): Flutter shell · `lib/home_page.dart`
- [Route registry](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/routes/app_routes.dart): navigation · Registers named routes. · `lib/routes/app_routes.dart`
- [Route dispatch](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/routes/routes.dart): navigation · Maps route requests to feature pages. · `lib/routes/routes.dart`
- [Sign-in UI](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/login/sign_in_page.dart): login page · `lib/pages/login/sign_in_page.dart`
- [Account UI](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/login/user_info_page.dart): profile page · `lib/pages/login/user_info_page.dart`
- [Chat lists](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/chats_home_page.dart): chat feature · Entry point for conversations and channels. · `lib/pages/chats/chats_home_page.dart`
- [Thread and channel views](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/thread_page.dart): chat screens · Individual threads, channels, and channel metadata. · `lib/pages/chats/thread_page.dart`
- [New conversation](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/new_chat/new_chat_page.dart): chat creation · Creates conversations and selects channel members. · `lib/pages/chats/new_chat/new_chat_page.dart`
- [Channel resources](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/chats/group_chat/channel_file_page.dart): collaboration screens · Channel file and media views. · `lib/pages/chats/group_chat/channel_file_page.dart`
- [Meeting flows](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/pages/meetings/meetings_page.dart): meeting screens · Browse, create, and join meeting controls. · `lib/pages/meetings/meetings_page.dart`

### Service integrations

Identity, chat, and notification boundaries.

- [Authentication service](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/authentication/authentication.dart): identity abstraction · Establishes the authenticated user session. · `lib/services/authentication/authentication.dart`
- [Firebase Auth](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/google-services.json): identity backend · Google sign-in and Firebase authentication. · `android/app/google-services.json`
- [Stream Chat API](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/stream_chat/stream_api.dart): chat integration · Owns real-time chat backend connectivity. · `lib/services/stream_chat/stream_api.dart`
- [Chat list service](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/stream_chat/chat_list.dart): chat state · `lib/services/stream_chat/chat_list.dart`
- [Notification service](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/lib/services/notifications/notifications_service.dart): device notifications · `lib/services/notifications/notifications_service.dart`

### Android host

Native embedding, SDK setup, and device permissions.

- [Flutter activity](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/MainActivity.kt): Android entry point · Embeds the Flutter runtime. · `android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/MainActivity.kt`
- [Android application](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/Application.kt): native setup · Initializes Android-side application integrations. · `android/app/src/main/kotlin/com/karanjot/microsoft_teams_karanjot/Application.kt`
- [Android build](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/build.gradle): Gradle module · Declares Android and platform SDK dependencies. · `android/app/build.gradle`
- [Device permissions](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/android/app/src/main/AndroidManifest.xml): Android manifest · Declares network, camera, microphone, and storage access. · `android/app/src/main/AndroidManifest.xml`
- **Jitsi Meet**: video conferencing SDK · Provides live native/video meeting sessions.
- [Release APKs](https://github.com/karanjot-singh/microsoft_teams_clone/blob/main/apks/MsTeams-arm64-v8a-release.apk): delivery artifacts · `apks/MsTeams-arm64-v8a-release.apk`

## Connections

- App bootstrap → Authentication service: initializes
- App bootstrap → Authenticated shell: renders
- App bootstrap → Route registry: configures
- Route registry → Route dispatch: routes through
- Route dispatch → Sign-in UI: opens
- Route dispatch → Chat lists: opens
- Route dispatch → Meeting flows: opens
- Authenticated shell → Chat lists: hosts
- Authenticated shell → Meeting flows: hosts
- Sign-in UI → Authentication service: authenticates with
- Account UI → Authentication service: uses session
- Authentication service → Firebase Auth: uses
- Chat lists → Chat list service: loads
- Chat list service → Stream Chat API: uses
- Chat lists → Thread and channel views: navigates to
- Chat lists → New conversation: creates
- Thread and channel views → Channel resources: opens
- Meeting flows → Jitsi Meet: joins sessions via
- App bootstrap → Notification service: initializes
- Flutter activity → App bootstrap: launches
- Android application → Flutter activity: hosts
- Android build → Jitsi Meet: declares
- Device permissions → Flutter activity: permits device access
- Android build → Release APKs: produces
