# ilian0410/chat-app architecture

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

- Interactive diagram: https://gitdiagram.com/ilian0410/chat-app
- Repository: https://github.com/ilian0410/chat-app

## Overview

ChatApp is a cross-platform Flutter social-messaging app. Users authenticate, discover people and manage friend relationships, then start one-to-one conversations; the app also supports profiles, presence, message state and interactions, and friendship notifications. GetX controllers coordinate UI state, while services encapsulate Firebase Authentication and Firestore access. The README documents these architectural responsibilities and product capabilities; Dart implementation excerpts were not provided, so edges below reflect documented relationships rather than inspected call sites.

Main entry points: [`lib/services/firestore_service.dart`](https://github.com/ilian0410/chat-app/blob/main/lib/services/firestore_service.dart) (Firestore Service), [`lib/routes/app_pages.dart`](https://github.com/ilian0410/chat-app/blob/main/lib/routes/app_pages.dart) (Route Bindings), [`lib/controllers/friends_controller.dart`](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/friends_controller.dart) (Friend Management), [`lib/view/auth`](https://github.com/ilian0410/chat-app/tree/main/lib/view/auth) (Auth Screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Foundation"]
  node_startup["App Startup<br/>[main.dart]"]
  node_routes["Route Bindings<br/>[app_pages.dart]"]
  node_auth_view["Auth Screens"]
  node_auth_controller["Authentication"]
  node_profile["Profiles"]
  node_profile_views["Profile Screens"]
  node_home["Home &amp; Navigation"]
  node_models["Domain Models"]
end

subgraph group_social["Social Relationships"]
  node_discovery["User Discovery"]
  node_friends["Friend Management"]
  node_requests["Friend Requests"]
  node_notifications["Notifications"]
end

subgraph group_messaging["Messaging"]
  node_chat_controller["Conversation State"]
  node_chat_views["Chat Screens<br/>[chat_view.dart]"]
end

subgraph group_backend["Firebase Data"]
  node_auth_service["Auth Service<br/>[auth_service.dart]"]
  node_firestore_service["Firestore Service"]
  node_firestore[("Cloud Firestore")]
  node_firebase_auth[("Firebase Auth")]
end

node_user(("User"))

node_user -->|"opens app"| node_startup
node_startup -->|"starts navigation"| node_routes
node_routes -->|"routes to"| node_auth_view
node_user -->|"signs in"| node_auth_view
node_auth_view -.->|"submits credentials"| node_auth_controller
node_auth_controller -->|"uses service"| node_auth_service
node_auth_service -->|"authenticates"| node_firebase_auth
node_routes -->|"routes to"| node_profile_views
node_profile_views -.->|"edits profile"| node_profile
node_user -->|"browses people"| node_discovery
node_discovery -.->|"starts friendship"| node_friends
node_user -->|"responds to requests"| node_requests
node_user -->|"opens conversation"| node_chat_views
node_chat_views -.->|"interacts with"| node_chat_controller
node_chat_controller -->|"uses service"| node_firestore_service
node_firestore_service -->|"reads and writes"| node_firestore
node_friends -.->|"uses service"| node_firestore_service
node_requests -.->|"uses service"| node_firestore_service
node_notifications -.->|"uses service"| node_firestore_service
node_profile -.->|"uses service"| node_firestore_service
node_home -.->|"coordinates navigation"| node_routes
node_firestore_service -->|"maps records"| node_models
node_friends -.->|"generates events"| node_notifications

click node_startup "https://github.com/ilian0410/chat-app/blob/main/lib/main.dart"
click node_routes "https://github.com/ilian0410/chat-app/blob/main/lib/routes/app_pages.dart"
click node_auth_view "https://github.com/ilian0410/chat-app/tree/main/lib/view/auth"
click node_auth_controller "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/auth_controller.dart"
click node_auth_service "https://github.com/ilian0410/chat-app/blob/main/lib/services/auth_service.dart"
click node_profile "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/profile_controller.dart"
click node_profile_views "https://github.com/ilian0410/chat-app/tree/main/lib/view/Profile"
click node_discovery "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/users_list_controller.dart"
click node_friends "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/friends_controller.dart"
click node_requests "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/friend_requests_controller.dart"
click node_notifications "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/notifications_controller.dart"
click node_chat_controller "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/chat_controller.dart"
click node_chat_views "https://github.com/ilian0410/chat-app/blob/main/lib/view/chat_view.dart"
click node_home "https://github.com/ilian0410/chat-app/blob/main/lib/controllers/home_controller.dart"
click node_models "https://github.com/ilian0410/chat-app/tree/main/lib/models"
click node_firestore_service "https://github.com/ilian0410/chat-app/blob/main/lib/services/firestore_service.dart"

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_startup,node_routes,node_auth_view,node_auth_controller,node_profile,node_profile_views,node_home,node_models,node_user toneBlue
class node_discovery,node_friends,node_requests,node_notifications toneAmber
class node_chat_controller,node_chat_views toneMint
class node_auth_service,node_firestore_service,node_firestore,node_firebase_auth toneRose
```

## Components

### App Foundation

- [App Startup](https://github.com/ilian0410/chat-app/blob/main/lib/main.dart): `lib/main.dart`
- [Route Bindings](https://github.com/ilian0410/chat-app/blob/main/lib/routes/app_pages.dart): `lib/routes/app_pages.dart`
- [Auth Screens](https://github.com/ilian0410/chat-app/tree/main/lib/view/auth): `lib/view/auth`
- [Authentication](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/auth_controller.dart): `lib/controllers/auth_controller.dart`
- [Profiles](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/profile_controller.dart): `lib/controllers/profile_controller.dart`
- [Profile Screens](https://github.com/ilian0410/chat-app/tree/main/lib/view/Profile): `lib/view/Profile`
- [Home & Navigation](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/home_controller.dart): `lib/controllers/home_controller.dart`
- [Domain Models](https://github.com/ilian0410/chat-app/tree/main/lib/models): `lib/models`

### Social Relationships

- [User Discovery](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/users_list_controller.dart): `lib/controllers/users_list_controller.dart`
- [Friend Management](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/friends_controller.dart): `lib/controllers/friends_controller.dart`
- [Friend Requests](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/friend_requests_controller.dart): `lib/controllers/friend_requests_controller.dart`
- [Notifications](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/notifications_controller.dart): `lib/controllers/notifications_controller.dart`

### Messaging

- [Conversation State](https://github.com/ilian0410/chat-app/blob/main/lib/controllers/chat_controller.dart): `lib/controllers/chat_controller.dart`
- [Chat Screens](https://github.com/ilian0410/chat-app/blob/main/lib/view/chat_view.dart): `lib/view/chat_view.dart`

### Firebase Data

- [Auth Service](https://github.com/ilian0410/chat-app/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- [Firestore Service](https://github.com/ilian0410/chat-app/blob/main/lib/services/firestore_service.dart): `lib/services/firestore_service.dart`
- **Cloud Firestore**
- **Firebase Auth**

### Other components

- **User**

## Connections

- User → App Startup: opens app (evidence: `README.md`)
- App Startup → Route Bindings: starts navigation (evidence: `README.md`)
- Route Bindings → Auth Screens: routes to (evidence: `README.md`)
- User → Auth Screens: signs in (evidence: `README.md`)
- Auth Screens → Authentication: submits credentials
- Authentication → Auth Service: uses service (evidence: `README.md`)
- Auth Service → Firebase Auth: authenticates (evidence: `README.md`)
- Route Bindings → Profile Screens: routes to (evidence: `README.md`)
- Profile Screens → Profiles: edits profile
- User → User Discovery: browses people (evidence: `README.md`)
- User Discovery → Friend Management: starts friendship
- User → Friend Requests: responds to requests (evidence: `README.md`)
- User → Chat Screens: opens conversation (evidence: `README.md`)
- Chat Screens → Conversation State: interacts with
- Conversation State → Firestore Service: uses service (evidence: `README.md`)
- Firestore Service → Cloud Firestore: reads and writes (evidence: `README.md`)
- Friend Management → Firestore Service: uses service
- Friend Requests → Firestore Service: uses service
- Notifications → Firestore Service: uses service
- Profiles → Firestore Service: uses service
- Home & Navigation → Route Bindings: coordinates navigation
- Firestore Service → Domain Models: maps records (evidence: `README.md`)
- Friend Management → Notifications: generates events
