# ghassenellili/horizon-social-network architecture

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

- Interactive diagram: https://gitdiagram.com/ghassenellili/horizon-social-network
- Repository: https://github.com/ghassenellili/horizon-social-network

## Overview

Horizon is a Flutter university social-network app for web and Android. The documented user journey is sign-in through Firebase Authentication, then profile creation or editing with university roles and Firestore persistence; the home screen provides a connected dashboard. The README also describes the animated splash, compressed profile photos, and planned member search and social interactions. Dart sources were not sampled, so links below rely on README statements; the tree alone does not establish runtime calls for every screen or planned feature.

Main entry points: [`lib/screens/profile/profile_screen.dart`](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/profile/profile_screen.dart) (Profile screen), [`lib/services/profile_service.dart`](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/services/profile_service.dart) (Profile service), [`lib/screens/auth/login_screen.dart`](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/auth/login_screen.dart) (Login screen), [`lib/services/auth_service.dart`](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/services/auth_service.dart) (Auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_entry["App entry<br/>[main.dart]"]
  node_splash["Animated splash<br/>[splash_screen.dart]"]
  node_theme["App theme<br/>[app_theme.dart]"]
  node_background["Horizon background"]
  node_avatar["User avatar<br/>[user_avatar.dart]"]
  node_home["Home dashboard<br/>[home_screen.dart]"]
end

subgraph group_identity["Authentication"]
  node_authgate["Auth gate<br/>[auth_gate.dart]"]
  node_login["Login screen<br/>[login_screen.dart]"]
  node_authservice["Auth service<br/>[auth_service.dart]"]
end

subgraph group_profiles["Profiles and directory"]
  node_profile["Profile screen"]
  node_directory["Member directory"]
  node_profilemodel["User and roles<br/>[app_user.dart]"]
  node_profileservice["Profile service"]
  node_compressor["Image compressor"]
end

subgraph group_cloud["Cloud services"]
  node_firebaseauth[("Firebase Authentication")]
  node_firestore[("Cloud Firestore")]
  node_firebaseconfig["Firebase configuration"]
end

node_student(("University user"))

node_student -.->|"opens"| node_entry
node_login -->|"authenticates through"| node_authservice
node_authservice -->|"manages sessions"| node_firebaseauth
node_authgate -->|"routes by state"| node_firebaseauth
node_profile -->|"reads and updates"| node_profileservice
node_profileservice -->|"persists profiles"| node_firestore
node_profile -->|"edits role data"| node_profilemodel
node_profile -->|"compresses photos"| node_compressor
node_profileservice -.->|"stores user data"| node_profilemodel
node_home -->|"manages session"| node_authservice
node_firebaseconfig -.->|"configures"| node_firebaseauth
node_firebaseconfig -.->|"configures"| node_firestore
node_splash -->|"uses"| node_background
node_login -->|"uses"| node_background
node_profile -.->|"previews profile"| node_avatar
node_student -->|"signs in"| node_login
node_student -->|"creates or edits"| node_profile

click node_entry "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/main.dart"
click node_splash "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/splash/splash_screen.dart"
click node_theme "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/theme/app_theme.dart"
click node_background "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/widgets/horizon_background.dart"
click node_avatar "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/widgets/user_avatar.dart"
click node_authgate "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/auth/auth_gate.dart"
click node_login "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/auth/login_screen.dart"
click node_authservice "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/services/auth_service.dart"
click node_home "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/home/home_screen.dart"
click node_profile "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/profile/profile_screen.dart"
click node_directory "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/profile/directory_screen.dart"
click node_profilemodel "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/models/app_user.dart"
click node_profileservice "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/services/profile_service.dart"
click node_compressor "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/utils/image_compressor.dart"
click node_firebaseconfig "https://github.com/ghassenellili/horizon-social-network/blob/main/lib/firebase_options.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_entry,node_splash,node_theme,node_background,node_avatar,node_home,node_student toneBlue
class node_authgate,node_login,node_authservice toneAmber
class node_profile,node_directory,node_profilemodel,node_profileservice,node_compressor toneMint
class node_firebaseauth,node_firestore,node_firebaseconfig toneRose
```

## Components

### App experience

- [App entry](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/main.dart): `lib/main.dart`
- [Animated splash](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/splash/splash_screen.dart): `lib/screens/splash/splash_screen.dart`
- [App theme](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/theme/app_theme.dart): `lib/core/theme/app_theme.dart`
- [Horizon background](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/widgets/horizon_background.dart): `lib/core/widgets/horizon_background.dart`
- [User avatar](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/widgets/user_avatar.dart): `lib/core/widgets/user_avatar.dart`
- [Home dashboard](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/home/home_screen.dart): `lib/screens/home/home_screen.dart`

### Authentication

- [Auth gate](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/auth/auth_gate.dart): `lib/screens/auth/auth_gate.dart`
- [Login screen](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/auth/login_screen.dart): `lib/screens/auth/login_screen.dart`
- [Auth service](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`

### Profiles and directory

- [Profile screen](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/profile/profile_screen.dart): `lib/screens/profile/profile_screen.dart`
- [Member directory](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/screens/profile/directory_screen.dart): `lib/screens/profile/directory_screen.dart`
- [User and roles](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/models/app_user.dart): `lib/models/app_user.dart`
- [Profile service](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/services/profile_service.dart): `lib/services/profile_service.dart`
- [Image compressor](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/core/utils/image_compressor.dart): `lib/core/utils/image_compressor.dart`

### Cloud services

- **Firebase Authentication**
- **Cloud Firestore**
- [Firebase configuration](https://github.com/ghassenellili/horizon-social-network/blob/main/lib/firebase_options.dart): `lib/firebase_options.dart`

### Other components

- **University user**

## Connections

- University user → App entry: opens
- Login screen → Auth service: authenticates through (evidence: `README.md`)
- Auth service → Firebase Authentication: manages sessions (evidence: `README.md`)
- Auth gate → Firebase Authentication: routes by state (evidence: `README.md`)
- Profile screen → Profile service: reads and updates (evidence: `README.md`)
- Profile service → Cloud Firestore: persists profiles (evidence: `README.md`)
- Profile screen → User and roles: edits role data (evidence: `README.md`)
- Profile screen → Image compressor: compresses photos (evidence: `README.md`)
- Profile service → User and roles: stores user data
- Home dashboard → Auth service: manages session (evidence: `README.md`)
- Firebase configuration → Firebase Authentication: configures
- Firebase configuration → Cloud Firestore: configures
- Animated splash → Horizon background: uses (evidence: `README.md`)
- Login screen → Horizon background: uses (evidence: `README.md`)
- Profile screen → User avatar: previews profile
- University user → Login screen: signs in (evidence: `README.md`)
- University user → Profile screen: creates or edits (evidence: `README.md`)
