# hasibapps/apk-05 architecture

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

- Interactive diagram: https://gitdiagram.com/hasibapps/apk-05
- Repository: https://github.com/hasibapps/apk-05

## Overview

HSC Guide is an Android study library for HSC students: browse subjects and paper sections, download PDFs, then read them offline. The README also documents admin editing and JSON backup/restore. Source excerpts were not provided for the app modules, so edges below reflect only relationships explicitly described in the README; they do not assert unverified implementation-level calls.

Main entry points: [`app/src/main/java/com/example/SubjectActivity.kt`](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/SubjectActivity.kt) (Subject Sections), [`app/src/main/java/com/example/data/GuideRepository.kt`](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/GuideRepository.kt) (Guide Repository), [`app/src/main/java/com/example/download/PdfDownloadService.kt`](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/PdfDownloadService.kt) (Background Downloads), [`app/src/main/java/com/example/MainActivity.kt`](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/MainActivity.kt) (Subject Home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_study["Study Library"]
  node_home["Subject Home<br/>[MainActivity.kt]"]
  node_subject["Subject Sections<br/>[SubjectActivity.kt]"]
  node_pdfreader["PDF Reader"]
  node_zoomview["Zoomable Pages"]
end

subgraph group_content["Guide Content"]
  node_models["Guide Models<br/>[GuideModels.kt]"]
  node_defaults["Default Guide Data"]
  node_repository["Guide Repository<br/>[GuideRepository.kt]"]
end

subgraph group_downloads["PDF Downloads"]
  node_downloadcenter["Download Queue<br/>[DownloadCenter.kt]"]
  node_downloadservice["Background Downloads"]
  node_localpdfs[("Downloaded PDFs<br/>[DownloadCenter.kt]")]
end

subgraph group_management["Library Management"]
  node_admin["Admin Editor"]
  node_settings["Settings and Backup"]
end

node_student(("Student"))
node_drive["Google Drive"]

node_student -->|"opens"| node_home
node_home -->|"selects subject"| node_subject
node_subject -.->|"shows content"| node_repository
node_repository -->|"initializes defaults"| node_defaults
node_student -->|"chooses PDF"| node_subject
node_subject -->|"requests download"| node_downloadcenter
node_downloadcenter -->|"queues downloads"| node_downloadservice
node_downloadservice -->|"downloads from"| node_drive
node_downloadservice -->|"saves PDF"| node_localpdfs
node_subject -->|"opens offline PDF"| node_localpdfs
node_subject -->|"opens reader"| node_pdfreader
node_pdfreader -.->|"renders pages"| node_zoomview
node_student -->|"edits library"| node_admin
node_admin -->|"updates content"| node_repository
node_student -->|"backs up content"| node_settings
node_settings -->|"imports or exports JSON"| node_repository
node_repository -.->|"uses content models"| node_models

click node_home "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/MainActivity.kt"
click node_subject "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/SubjectActivity.kt"
click node_pdfreader "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/PdfViewerActivity.kt"
click node_zoomview "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/pdf/ZoomablePdfRecyclerView.kt"
click node_models "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/GuideModels.kt"
click node_defaults "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/DefaultGuideData.kt"
click node_repository "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/GuideRepository.kt"
click node_admin "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/AdminPanelActivity.kt"
click node_settings "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/SettingsController.kt"
click node_downloadcenter "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/DownloadCenter.kt"
click node_downloadservice "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/PdfDownloadService.kt"
click node_localpdfs "https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/DownloadCenter.kt"

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_home,node_subject,node_pdfreader,node_zoomview toneBlue
class node_models,node_defaults,node_repository toneAmber
class node_downloadcenter,node_downloadservice,node_localpdfs toneMint
class node_admin,node_settings toneRose
class node_student,node_drive toneIndigo
```

## Components

### Study Library

- [Subject Home](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/MainActivity.kt): `app/src/main/java/com/example/MainActivity.kt`
- [Subject Sections](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/SubjectActivity.kt): `app/src/main/java/com/example/SubjectActivity.kt`
- [PDF Reader](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/PdfViewerActivity.kt): `app/src/main/java/com/example/PdfViewerActivity.kt`
- [Zoomable Pages](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/pdf/ZoomablePdfRecyclerView.kt): `app/src/main/java/com/example/pdf/ZoomablePdfRecyclerView.kt`

### Guide Content

- [Guide Models](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/GuideModels.kt): `app/src/main/java/com/example/data/GuideModels.kt`
- [Default Guide Data](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/DefaultGuideData.kt): `app/src/main/java/com/example/data/DefaultGuideData.kt`
- [Guide Repository](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/data/GuideRepository.kt): `app/src/main/java/com/example/data/GuideRepository.kt`

### PDF Downloads

- [Download Queue](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/DownloadCenter.kt): `app/src/main/java/com/example/download/DownloadCenter.kt`
- [Background Downloads](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/PdfDownloadService.kt): `app/src/main/java/com/example/download/PdfDownloadService.kt`
- [Downloaded PDFs](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/download/DownloadCenter.kt): `app/src/main/java/com/example/download/DownloadCenter.kt`

### Library Management

- [Admin Editor](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/AdminPanelActivity.kt): `app/src/main/java/com/example/AdminPanelActivity.kt`
- [Settings and Backup](https://github.com/hasibapps/apk-05/blob/main/app/src/main/java/com/example/SettingsController.kt): `app/src/main/java/com/example/SettingsController.kt`

### Other components

- **Student**
- **Google Drive**

## Connections

- Student → Subject Home: opens (evidence: `README.md`)
- Subject Home → Subject Sections: selects subject (evidence: `README.md`)
- Subject Sections → Guide Repository: shows content
- Guide Repository → Default Guide Data: initializes defaults (evidence: `README.md`)
- Student → Subject Sections: chooses PDF (evidence: `README.md`)
- Subject Sections → Download Queue: requests download (evidence: `README.md`)
- Download Queue → Background Downloads: queues downloads (evidence: `README.md`)
- Background Downloads → Google Drive: downloads from (evidence: `README.md`)
- Background Downloads → Downloaded PDFs: saves PDF (evidence: `README.md`)
- Subject Sections → Downloaded PDFs: opens offline PDF (evidence: `README.md`)
- Subject Sections → PDF Reader: opens reader (evidence: `README.md`)
- PDF Reader → Zoomable Pages: renders pages
- Student → Admin Editor: edits library (evidence: `README.md`)
- Admin Editor → Guide Repository: updates content (evidence: `README.md`)
- Student → Settings and Backup: backs up content (evidence: `README.md`)
- Settings and Backup → Guide Repository: imports or exports JSON (evidence: `README.md`)
- Guide Repository → Guide Models: uses content models
