# keinndh/quest-log-mobile architecture

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

- Interactive diagram: https://gitdiagram.com/keinndh/quest-log-mobile
- Repository: https://github.com/keinndh/quest-log-mobile

## Overview

Quest Log is a pixel-art RPG productivity app: users manage quests, complete them for progression rewards, and use gold to buy weapons or redeem personal rewards. The PHP page router serves feature views; browser modules provide feature interactions, while a JSON controller and SQLite persistence support the application. The README also documents offline PWA use, optional cloud sync, and save-data portability. Several client modules and views were not sampled, so their internal call relationships are left unasserted.

Main entry points: [`public/index.php`](https://github.com/keinndh/quest-log-mobile/blob/main/public/index.php) (Page router), [`app/controller.php`](https://github.com/keinndh/quest-log-mobile/blob/main/app/controller.php) (JSON action controller), [`views/settings.php`](https://github.com/keinndh/quest-log-mobile/blob/main/views/settings.php) (Settings and backups), [`views/dashboard.php`](https://github.com/keinndh/quest-log-mobile/blob/main/views/dashboard.php) (Kingdom dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["App experience"]
  node_router["Page router<br/>[index.php]"]
  node_dashboard["Kingdom dashboard<br/>[dashboard.php]"]
  node_login["Login and registration<br/>[login.php]"]
  node_quest_view["Quest board<br/>[quests.php]"]
  node_settings_view["Settings and backups<br/>[settings.php]"]
  node_audio_ui["Pixel effects and audio<br/>[pixel.js]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_quest_logic["Quest interactions<br/>[quests.js]"]
  node_character["Hero progression<br/>[character.php]"]
  node_achievements["Achievements<br/>[achievements.php]"]
  node_shop["Weapon shop<br/>[shop.php]"]
  node_rewards["Personal rewards<br/>[rewards.php]"]
  node_daily_log["Daily log<br/>[daily_log.php]"]
  node_stats["Player statistics<br/>[stats.php]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.php]"]
end

subgraph group_backend["Application backend"]
  node_controller["JSON action controller<br/>[controller.php]"]
  node_database[("SQLite game data<br/>[db.php]")]
end

subgraph group_offline["Offline and sync"]
  node_offline_cache["Offline asset cache<br/>[sw.js]"]
  node_cloud_sync["Firebase sync<br/>[firebase.js]"]
end

node_player(("Player"))

node_player -->|"opens pages"| node_router
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_quest_view
node_router -->|"routes to"| node_character
node_router -->|"routes to"| node_achievements
node_router -->|"routes to"| node_shop
node_router -->|"routes to"| node_rewards
node_router -->|"routes to"| node_daily_log
node_router -->|"routes to"| node_stats
node_router -->|"routes to"| node_leaderboard
node_router -->|"routes to"| node_settings_view
node_quest_view -->|"loads script"| node_quest_logic
node_dashboard -.->|"requests data"| node_controller
node_quest_logic -.->|"sends actions"| node_controller
node_login -.->|"authenticates"| node_controller
node_settings_view -.->|"updates settings"| node_controller
node_controller -->|"uses database"| node_database
node_player -->|"uses offline"| node_offline_cache
node_offline_cache -.->|"syncs optionally"| node_cloud_sync
node_player -.->|"backs up progress"| node_cloud_sync
node_settings_view -->|"exports saves"| node_player
node_player -->|"hears effects"| node_audio_ui

click node_router "https://github.com/keinndh/quest-log-mobile/blob/main/public/index.php"
click node_dashboard "https://github.com/keinndh/quest-log-mobile/blob/main/views/dashboard.php"
click node_login "https://github.com/keinndh/quest-log-mobile/blob/main/views/login.php"
click node_quest_view "https://github.com/keinndh/quest-log-mobile/blob/main/views/quests.php"
click node_settings_view "https://github.com/keinndh/quest-log-mobile/blob/main/views/settings.php"
click node_quest_logic "https://github.com/keinndh/quest-log-mobile/blob/main/public/assets/js/quests.js"
click node_character "https://github.com/keinndh/quest-log-mobile/blob/main/views/character.php"
click node_achievements "https://github.com/keinndh/quest-log-mobile/blob/main/views/achievements.php"
click node_shop "https://github.com/keinndh/quest-log-mobile/blob/main/views/shop.php"
click node_rewards "https://github.com/keinndh/quest-log-mobile/blob/main/views/rewards.php"
click node_daily_log "https://github.com/keinndh/quest-log-mobile/blob/main/views/daily_log.php"
click node_stats "https://github.com/keinndh/quest-log-mobile/blob/main/views/stats.php"
click node_leaderboard "https://github.com/keinndh/quest-log-mobile/blob/main/views/leaderboard.php"
click node_controller "https://github.com/keinndh/quest-log-mobile/blob/main/app/controller.php"
click node_database "https://github.com/keinndh/quest-log-mobile/blob/main/includes/db.php"
click node_offline_cache "https://github.com/keinndh/quest-log-mobile/blob/main/public/sw.js"
click node_cloud_sync "https://github.com/keinndh/quest-log-mobile/blob/main/public/assets/js/firebase.js"
click node_audio_ui "https://github.com/keinndh/quest-log-mobile/blob/main/public/assets/js/pixel.js"

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_router,node_dashboard,node_login,node_quest_view,node_settings_view,node_audio_ui toneBlue
class node_quest_logic,node_character,node_achievements,node_shop,node_rewards,node_daily_log,node_stats,node_leaderboard toneAmber
class node_controller,node_database toneMint
class node_offline_cache,node_cloud_sync toneRose
class node_player toneIndigo
```

## Components

### App experience

- [Page router](https://github.com/keinndh/quest-log-mobile/blob/main/public/index.php): `public/index.php`
- [Kingdom dashboard](https://github.com/keinndh/quest-log-mobile/blob/main/views/dashboard.php): `views/dashboard.php`
- [Login and registration](https://github.com/keinndh/quest-log-mobile/blob/main/views/login.php): `views/login.php`
- [Quest board](https://github.com/keinndh/quest-log-mobile/blob/main/views/quests.php): `views/quests.php`
- [Settings and backups](https://github.com/keinndh/quest-log-mobile/blob/main/views/settings.php): `views/settings.php`
- [Pixel effects and audio](https://github.com/keinndh/quest-log-mobile/blob/main/public/assets/js/pixel.js): `public/assets/js/pixel.js`

### Gameplay systems

- [Quest interactions](https://github.com/keinndh/quest-log-mobile/blob/main/public/assets/js/quests.js): `public/assets/js/quests.js`
- [Hero progression](https://github.com/keinndh/quest-log-mobile/blob/main/views/character.php): `views/character.php`
- [Achievements](https://github.com/keinndh/quest-log-mobile/blob/main/views/achievements.php): `views/achievements.php`
- [Weapon shop](https://github.com/keinndh/quest-log-mobile/blob/main/views/shop.php): `views/shop.php`
- [Personal rewards](https://github.com/keinndh/quest-log-mobile/blob/main/views/rewards.php): `views/rewards.php`
- [Daily log](https://github.com/keinndh/quest-log-mobile/blob/main/views/daily_log.php): `views/daily_log.php`
- [Player statistics](https://github.com/keinndh/quest-log-mobile/blob/main/views/stats.php): `views/stats.php`
- [Leaderboard](https://github.com/keinndh/quest-log-mobile/blob/main/views/leaderboard.php): `views/leaderboard.php`

### Application backend

- [JSON action controller](https://github.com/keinndh/quest-log-mobile/blob/main/app/controller.php): `app/controller.php`
- [SQLite game data](https://github.com/keinndh/quest-log-mobile/blob/main/includes/db.php): `includes/db.php`

### Offline and sync

- [Offline asset cache](https://github.com/keinndh/quest-log-mobile/blob/main/public/sw.js): `public/sw.js`
- [Firebase sync](https://github.com/keinndh/quest-log-mobile/blob/main/public/assets/js/firebase.js): `public/assets/js/firebase.js`

### Other components

- **Player**

## Connections

- Player → Page router: opens pages (evidence: `public/index.php`)
- Page router → Kingdom dashboard: routes to (evidence: `public/index.php`)
- Page router → Login and registration: routes to (evidence: `public/index.php`)
- Page router → Quest board: routes to (evidence: `public/index.php`)
- Page router → Hero progression: routes to (evidence: `public/index.php`)
- Page router → Achievements: routes to (evidence: `public/index.php`)
- Page router → Weapon shop: routes to (evidence: `public/index.php`)
- Page router → Personal rewards: routes to (evidence: `public/index.php`)
- Page router → Daily log: routes to (evidence: `public/index.php`)
- Page router → Player statistics: routes to (evidence: `public/index.php`)
- Page router → Leaderboard: routes to (evidence: `public/index.php`)
- Page router → Settings and backups: routes to (evidence: `public/index.php`)
- Quest board → Quest interactions: loads script (evidence: `views/quests.php`)
- Kingdom dashboard → JSON action controller: requests data
- Quest interactions → JSON action controller: sends actions
- Login and registration → JSON action controller: authenticates
- Settings and backups → JSON action controller: updates settings
- JSON action controller → SQLite game data: uses database (evidence: `app/controller.php`)
- Player → Offline asset cache: uses offline (evidence: `README.md`)
- Offline asset cache → Firebase sync: syncs optionally
- Player → Firebase sync: backs up progress (evidence: `README.md`)
- Settings and backups → Player: exports saves (evidence: `README.md`)
- Player → Pixel effects and audio: hears effects (evidence: `README.md`)
