# nur1s-lam/irfan-academy architecture

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

- Interactive diagram: https://gitdiagram.com/nur1s-lam/irfan-academy
- Repository: https://github.com/nur1s-lam/irfan-academy

## Overview

Irfan Academy is a Flutter education app with authentication, lessons and homework, Quran study, prayer tools, profiles, and administration. The user-facing journey begins at sign-in and continues through the home screen into learning or religious-study features; administrators also manage video lessons. The tree and supplied excerpts identify these capabilities and the R2 callable backend, but most Dart implementation was not sampled, so screen-to-service wiring is shown only where documentation supports it.

Main entry points: [`lib/screens/admin/admin_screen.dart`](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/admin/admin_screen.dart) (Administration), [`lib/screens/quran`](https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/quran) (Quran study), [`functions/index.js`](https://github.com/nur1s-lam/irfan-academy/blob/main/functions/index.js) (R2 callable functions), [`lib/screens/auth`](https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/auth) (Sign in / register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app_entry["App entry<br/>[main.dart]"]
  node_auth_ui["Sign in / register"]
  node_home_ui["Home<br/>[home_screen.dart]"]
  node_profile_ui["Profile and settings"]
  node_admin_ui["Administration<br/>[admin_screen.dart]"]
end

subgraph group_learning["Learning"]
  node_lesson_ui["Lessons"]
  node_lesson_model["Lesson records<br/>[lesson.dart]"]
  node_homework_model["Homework records<br/>[homework.dart]"]
  node_video_model["Video lesson records<br/>[video_lesson.dart]"]
end

subgraph group_religion["Religious study"]
  node_quran_ui["Quran study"]
  node_quran_data["Quran data"]
  node_quran_audio["Quran audio"]
  node_prayer_ui["Prayer and Qibla<br/>[prayer_screen.dart]"]
  node_prayer_service["Prayer calculations"]
  node_prayer_model["Prayer times<br/>[prayer_time.dart]"]
end

subgraph group_platform["Services and storage"]
  node_auth_service["Authentication<br/>[auth_service.dart]"]
  node_firestore_service["Firestore access"]
  node_admin_service["Admin operations<br/>[admin_service.dart]"]
  node_firebase[("Firebase")]
  node_r2_functions["R2 callable functions<br/>[index.js]"]
  node_cloudflare_r2[("Cloudflare R2")]
  node_video_upload_service["Video storage client"]
end

node_user(("Learner or admin"))
node_cloudinary[("Cloudinary")]

node_user -->|"opens app"| node_app_entry
node_app_entry -->|"shows"| node_auth_ui
node_user -->|"signs in"| node_auth_ui
node_auth_ui -->|"authenticates"| node_auth_service
node_auth_service -->|"uses Firebase Auth"| node_firebase
node_user -->|"continues to"| node_home_ui
node_home_ui -->|"opens lessons"| node_lesson_ui
node_user -->|"opens Quran"| node_quran_ui
node_quran_ui -->|"loads Quran"| node_quran_data
node_quran_ui -->|"plays recitation"| node_quran_audio
node_user -->|"opens prayer tools"| node_prayer_ui
node_prayer_ui -->|"gets prayer times"| node_prayer_service
node_prayer_service -->|"produces times"| node_prayer_model
node_user -->|"manages content"| node_admin_ui
node_admin_ui -->|"requests admin actions"| node_admin_service
node_admin_service -->|"uses Firebase"| node_firebase
node_video_upload_service -.->|"uploads video"| node_cloudinary
node_admin_ui -.->|"manages R2 videos"| node_r2_functions
node_r2_functions -->|"checks admin role"| node_firebase
node_r2_functions -->|"uploads or signs access"| node_cloudflare_r2
node_lesson_ui -->|"accesses lesson data"| node_firestore_service
node_firestore_service -->|"reads and writes"| node_firebase
node_profile_ui -->|"accesses profile data"| node_firestore_service

click node_app_entry "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/main.dart"
click node_auth_ui "https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/auth"
click node_home_ui "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/home/home_screen.dart"
click node_profile_ui "https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/profile"
click node_admin_ui "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/admin/admin_screen.dart"
click node_lesson_ui "https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/lessons"
click node_lesson_model "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/lesson.dart"
click node_homework_model "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/homework.dart"
click node_video_model "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/video_lesson.dart"
click node_quran_ui "https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/quran"
click node_quran_data "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/quran_data_service.dart"
click node_quran_audio "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/quran_audio_service.dart"
click node_prayer_ui "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/prayer/prayer_screen.dart"
click node_prayer_service "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/prayer_service.dart"
click node_prayer_model "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/prayer_time.dart"
click node_auth_service "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/auth_service.dart"
click node_firestore_service "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/firestore_service.dart"
click node_admin_service "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/admin_service.dart"
click node_r2_functions "https://github.com/nur1s-lam/irfan-academy/blob/main/functions/index.js"
click node_video_upload_service "https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/cloudinary_video_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_app_entry,node_auth_ui,node_home_ui,node_profile_ui,node_admin_ui toneBlue
class node_lesson_ui,node_lesson_model,node_homework_model,node_video_model,node_cloudinary toneAmber
class node_quran_ui,node_quran_data,node_quran_audio,node_prayer_ui,node_prayer_service,node_prayer_model toneMint
class node_auth_service,node_firestore_service,node_admin_service,node_firebase,node_r2_functions,node_cloudflare_r2,node_video_upload_service toneRose
class node_user toneIndigo
```

## Components

### App navigation

- [App entry](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/main.dart): `lib/main.dart`
- [Sign in / register](https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/auth): `lib/screens/auth`
- [Home](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/home/home_screen.dart): `lib/screens/home/home_screen.dart`
- [Profile and settings](https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/profile): `lib/screens/profile`
- [Administration](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/admin/admin_screen.dart): `lib/screens/admin/admin_screen.dart`

### Learning

- [Lessons](https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/lessons): `lib/screens/lessons`
- [Lesson records](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/lesson.dart): `lib/models/lesson.dart`
- [Homework records](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/homework.dart): `lib/models/homework.dart`
- [Video lesson records](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/video_lesson.dart): `lib/models/video_lesson.dart`

### Religious study

- [Quran study](https://github.com/nur1s-lam/irfan-academy/tree/main/lib/screens/quran): `lib/screens/quran`
- [Quran data](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/quran_data_service.dart): `lib/services/quran_data_service.dart`
- [Quran audio](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/quran_audio_service.dart): `lib/services/quran_audio_service.dart`
- [Prayer and Qibla](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/screens/prayer/prayer_screen.dart): `lib/screens/prayer/prayer_screen.dart`
- [Prayer calculations](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/prayer_service.dart): `lib/services/prayer_service.dart`
- [Prayer times](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/models/prayer_time.dart): `lib/models/prayer_time.dart`

### Services and storage

- [Authentication](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- [Firestore access](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/firestore_service.dart): `lib/services/firestore_service.dart`
- [Admin operations](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/admin_service.dart): `lib/services/admin_service.dart`
- **Firebase**
- [R2 callable functions](https://github.com/nur1s-lam/irfan-academy/blob/main/functions/index.js): `functions/index.js`
- **Cloudflare R2**
- [Video storage client](https://github.com/nur1s-lam/irfan-academy/blob/main/lib/services/cloudinary_video_service.dart): `lib/services/cloudinary_video_service.dart`

### Other components

- **Learner or admin**
- **Cloudinary**

## Connections

- Learner or admin → App entry: opens app
- App entry → Sign in / register: shows
- Learner or admin → Sign in / register: signs in
- Sign in / register → Authentication: authenticates
- Authentication → Firebase: uses Firebase Auth
- Learner or admin → Home: continues to
- Home → Lessons: opens lessons
- Learner or admin → Quran study: opens Quran
- Quran study → Quran data: loads Quran
- Quran study → Quran audio: plays recitation
- Learner or admin → Prayer and Qibla: opens prayer tools
- Prayer and Qibla → Prayer calculations: gets prayer times
- Prayer calculations → Prayer times: produces times
- Learner or admin → Administration: manages content
- Administration → Admin operations: requests admin actions
- Admin operations → Firebase: uses Firebase
- Video storage client → Cloudinary: uploads video
- Administration → R2 callable functions: manages R2 videos
- R2 callable functions → Firebase: checks admin role
- R2 callable functions → Cloudflare R2: uploads or signs access
- Lessons → Firestore access: accesses lesson data
- Firestore access → Firebase: reads and writes
- Profile and settings → Firestore access: accesses profile data
