# scribbleriyad/flutter_all_quran_-hadid_app_restapi architecture

> Architecture diagram of the GitHub repository scribbleriyad/flutter_all_quran_-hadid_app_restapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi
- Repository: https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi

## Overview

##### Project type and purpose
- This is a cross-platform mobile/web application built with Flutter (Dart).
- Its purpose is to display Quran and Hadith content via RESTful API calls, with pages for login, navigation, chapters, hadith lists, and a home screen.

##### File structure
- Top-level “islamic_book_app” directory contains platform folders (android/, ios/, web/) and the Flutter code in lib/.
- lib/main.dart is the app entry point; lib/pages/ holds UI screens.
- pubspec.yaml lists dependencies and assets.
- test/ contains a sample widget test.
- assets/ and web/manifest files provide static resources.
- No in-repo backend—this is purely a client consuming an external RestAPI.

##### README
- Very brief, but indicates that the app uses a REST API to fetch all Quran and Hadith content.

##### Main components
a. Presentation Layer (UI Screens)
- LoginPage
- HomePage
- ChapterPage
- HadithListPage
- NavDrawer
b. Business Logic / State Management
- Controller/ViewModel or setState handlers inside each page
c. Data Layer
- API Service (HTTP client calling external endpoints)
- Data models (e.g., Chapter, Hadith, User)
d. External Systems
- Quran/Hadith REST API server
e. Platform Shells
- Flutter Engine
- Android embed (MainActivity, Gradle build)
- iOS embed (AppDelegate, Xcode project)
- Web host (index.html)

##### Relationships and interactions
- UI screens send requests to the API service (via HTTP client).
- API service serializes JSON into data models.
- Business logic/state management updates the UI with model data.
- The Flutter Engine houses the entire Dart runtime and renders to each platform.

##### Architectural patterns and design principles
- Layered architecture (Presentation → Business Logic → Data)
- Dependency inversion: API service should be injected into pages/controllers.
- Single responsibility: each page focuses on one screen’s logic.
- Platform independence: the same Dart code runs on Android, iOS, and Web.

##### Technologies and frameworks
- Flutter framework (widgets, rendering)
- Dart HTTP or Dio package (for REST calls)
- JSON serialization (built-in or via packages)
- Platform-specific Gradle and Xcode build systems

## Diagram (Mermaid)

```mermaid
graph TB
    %% Platform Embeds
    subgraph "Platform Embeds"
        direction TB
        FE["Flutter Engine"]:::platform
        AND["Android Shell\nMainActivity.kt"]:::platform
        IOS["iOS Shell\nAppDelegate.swift"]:::platform
        WEB["Web Shell\nindex.html"]:::platform
    end

    %% Core Application Entry
    AppEntry["App Entry Point\nmain.dart"]:::core

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        LP["LoginPage"]:::ui
        HP["HomePage"]:::ui
        CP["ChapterPage"]:::ui
        HLP["HadithListPage"]:::ui
        ND["NavDrawer"]:::ui
    end

    %% Business Logic / State Management
    subgraph "Business Logic / State Management"
        direction TB
        SM["State Management / Controllers"]:::logic
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        API["API Service"]:::data
        DM["Data Models"]:::data
        PUB["pubspec.yaml\n(Deps & Assets)"]:::config
        AS["Static Assets"]:::resource
    end

    %% External Systems
    EXT["Quran/Hadith REST API"]:::external

    %% Test Suite
    TEST["Test Suite\nwidget_test.dart"]:::test

    %% Relationships
    AppEntry --> FE
    FE --> LP
    FE --> HP
    FE --> CP
    FE --> HLP
    FE --> ND

    LP --> SM
    HP --> SM
    CP --> SM
    HLP --> SM
    ND --> SM

    SM --> API
    API --> DM
    API --> EXT
    EXT --> API
    API --> SM
    SM --> LP

    LP --> AS
    HP --> AS
    CP --> AS
    HLP --> AS

    PUB --> AS
    TEST --> LP
    TEST --> HP

    AND --> FE
    IOS --> FE
    WEB --> FE

    %% Click Events
    click LP "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/lib/pages/login.dart"
    click HP "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/lib/pages/home_page.dart"
    click CP "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/lib/pages/chapter_page.dart"
    click HLP "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/lib/pages/hadith_list_page.dart"
    click ND "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/lib/pages/NavDrawer.dart"
    click AppEntry "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/lib/main.dart"
    click AS "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/tree/main/islamic_book_app/assets/images"
    click PUB "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/pubspec.yaml"
    click TEST "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/test/widget_test.dart"
    click AND "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/android/app/src/main/kotlin/com/example/islamic_book_app/MainActivity.kt"
    click AND "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/android/app/build.gradle"
    click IOS "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/ios/Runner/AppDelegate.swift"
    click IOS "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/ios/Runner.xcodeproj"
    click WEB "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/web/index.html"
    click WEB "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/blob/main/islamic_book_app/web/manifest.json"
    click WEB "https://github.com/scribbleriyad/flutter_all_quran_-hadid_app_restapi/tree/main/islamic_book_app/web/icons"

    %% Styles
    classDef ui fill:#D6E8FF,stroke:#1E70BF,stroke-width:1px
    classDef logic fill:#E6F4EA,stroke:#2E7D32,stroke-width:1px
    classDef data fill:#FFE8CC,stroke:#EF6C00,stroke-width:1px
    classDef external fill:#FBE9E7,stroke:#D84315,stroke-width:1px
    classDef platform fill:#ECEFF1,stroke:#546E7A,stroke-width:1px
    classDef core fill:#FFF8E1,stroke:#FFB300,stroke-width:1px
    classDef config fill:#E8EAF6,stroke:#3949AB,stroke-width:1px
    classDef resource fill:#F3E5F5,stroke:#8E24AA,stroke-width:1px
    classDef test fill:#F1F8E9,stroke:#689F38,stroke-width:1px
```
