native-update 2.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/Readme.md +28 -14
  2. package/android/manifest-additions.xml +28 -0
  3. package/android/src/main/AndroidManifest.xml +3 -7
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundNotificationManager.kt +21 -13
  5. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +196 -29
  6. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +21 -36
  7. package/cli/AGENTS.md +15 -1
  8. package/cli/CLAUDE.md +15 -1
  9. package/cli/commands/backend-create.js +56 -15
  10. package/cli/commands/bundle-create.js +39 -7
  11. package/cli/commands/monitor.js +72 -51
  12. package/cli/index.js +10 -24
  13. package/cli/package.json +11 -3
  14. package/dist/esm/app-review/app-review-manager.js +0 -1
  15. package/dist/esm/app-review/index.js +0 -1
  16. package/dist/esm/app-review/platform-review-handler.js +0 -1
  17. package/dist/esm/app-review/review-conditions-checker.js +0 -1
  18. package/dist/esm/app-review/review-rate-limiter.js +0 -1
  19. package/dist/esm/app-review/types.js +0 -1
  20. package/dist/esm/app-update/app-update-checker.js +0 -1
  21. package/dist/esm/app-update/app-update-installer.d.ts +1 -0
  22. package/dist/esm/app-update/app-update-installer.js +19 -8
  23. package/dist/esm/app-update/app-update-manager.js +0 -1
  24. package/dist/esm/app-update/app-update-notifier.js +0 -1
  25. package/dist/esm/app-update/index.js +0 -1
  26. package/dist/esm/app-update/platform-app-update.js +12 -3
  27. package/dist/esm/app-update/types.js +0 -1
  28. package/dist/esm/background-update/background-scheduler.js +0 -1
  29. package/dist/esm/background-update/index.js +0 -1
  30. package/dist/esm/background-update/notification-manager.js +0 -1
  31. package/dist/esm/config/support.js +0 -1
  32. package/dist/esm/core/analytics.d.ts +13 -0
  33. package/dist/esm/core/analytics.js +15 -1
  34. package/dist/esm/core/cache-manager.js +0 -1
  35. package/dist/esm/core/config.d.ts +0 -15
  36. package/dist/esm/core/config.js +0 -4
  37. package/dist/esm/core/errors.d.ts +1 -0
  38. package/dist/esm/core/errors.js +1 -1
  39. package/dist/esm/core/event-emitter.d.ts +0 -3
  40. package/dist/esm/core/event-emitter.js +8 -3
  41. package/dist/esm/core/logger.js +0 -1
  42. package/dist/esm/core/performance.js +0 -1
  43. package/dist/esm/core/plugin-manager.js +3 -1
  44. package/dist/esm/core/security.d.ts +11 -0
  45. package/dist/esm/core/security.js +27 -1
  46. package/dist/esm/definitions.d.ts +0 -11
  47. package/dist/esm/definitions.js +0 -1
  48. package/dist/esm/index.d.ts +3 -2
  49. package/dist/esm/index.js +3 -1
  50. package/dist/esm/live-update/bundle-manager.d.ts +8 -0
  51. package/dist/esm/live-update/bundle-manager.js +20 -1
  52. package/dist/esm/live-update/certificate-pinning.js +0 -1
  53. package/dist/esm/live-update/delta-processor.d.ts +1 -1
  54. package/dist/esm/live-update/delta-processor.js +3 -1
  55. package/dist/esm/live-update/download-manager.js +9 -2
  56. package/dist/esm/live-update/rollout-checker.d.ts +1 -1
  57. package/dist/esm/live-update/rollout-checker.js +5 -6
  58. package/dist/esm/live-update/update-manager.js +0 -1
  59. package/dist/esm/live-update/version-manager.d.ts +0 -12
  60. package/dist/esm/live-update/version-manager.js +0 -68
  61. package/dist/esm/plugin.js +69 -43
  62. package/dist/esm/security/crypto.js +11 -7
  63. package/dist/esm/security/validator.js +0 -1
  64. package/dist/esm/types/rollout.d.ts +85 -0
  65. package/dist/esm/types/rollout.js +25 -0
  66. package/dist/esm/web.d.ts +8 -0
  67. package/dist/esm/web.js +148 -54
  68. package/dist/plugin.cjs.js +1 -2
  69. package/dist/plugin.esm.js +1 -2
  70. package/dist/plugin.js +2 -3
  71. package/docs/CHANGELOG.md +124 -0
  72. package/docs/CLAUDE.md +1 -1
  73. package/docs/MANUAL-TASKS.md +17 -0
  74. package/docs/MARKETING_WEBSITE_TRACKER.md +18 -2
  75. package/docs/MIGRATION.md +83 -0
  76. package/docs/PACKAGES.md +167 -0
  77. package/docs/PERFORMANCE.md +110 -0
  78. package/docs/PROJECT_COMPLETION_TRACKER.md +4 -35
  79. package/docs/README.md +0 -1
  80. package/docs/REMAINING_FEATURES.md +123 -76
  81. package/docs/ROADMAP.md +200 -120
  82. package/docs/SECURITY-IF-REPO-PUBLIC.md +232 -0
  83. package/docs/TESTING_REQUIREMENTS.md +1 -112
  84. package/docs/ai-knowledge-base/00-project-profile.md +38 -0
  85. package/docs/ai-knowledge-base/01-features.md +46 -0
  86. package/docs/ai-knowledge-base/02-routes.md +72 -0
  87. package/docs/ai-knowledge-base/03-tech-stack.md +57 -0
  88. package/docs/ai-knowledge-base/README.md +23 -0
  89. package/docs/analytics-tracking.md +37 -0
  90. package/docs/capacitor-official-plugins.md +46 -0
  91. package/docs/capawesome-plugins.md +29 -0
  92. package/docs/deployment/HOSTINGER_DEPLOY.md +75 -34
  93. package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +184 -0
  94. package/docs/docs-site/plan.md +201 -0
  95. package/docs/docs-site/scope.md +127 -0
  96. package/docs/docs-site/tracker.json +235 -0
  97. package/docs/error-handling-tracking.md +37 -0
  98. package/docs/guides/testing-guide.md +15 -41
  99. package/docs/package-audit.md +41 -0
  100. package/docs/play-store/ASO-METADATA.md +5 -0
  101. package/docs/play-store/DATA-SAFETY.md +5 -0
  102. package/docs/play-store/DECLARATIONS.md +5 -0
  103. package/docs/play-store/README.md +27 -0
  104. package/docs/play-store/RELEASE-NOTES.md +99 -0
  105. package/docs/play-store/RELEASE-STEPS.md +6 -0
  106. package/docs/play-store/STORE-LISTING.md +7 -0
  107. package/docs/play-store/SUBMISSION-CHECKLIST.md +5 -0
  108. package/docs/production-readiness.md +1 -1
  109. package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +123 -0
  110. package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +227 -0
  111. package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +144 -0
  112. package/docs/project-audit/2026-05-16/sessions/batch-01.md +42 -0
  113. package/docs/project-audit/2026-05-16/sessions/batch-02.md +74 -0
  114. package/docs/project-audit/2026-05-16/sessions/batch-03.md +71 -0
  115. package/docs/project-audit/2026-05-16/sessions/batch-04.md +88 -0
  116. package/docs/project-audit/2026-05-16/sessions/batch-05.md +63 -0
  117. package/docs/project-audit/2026-05-16/sessions/batch-06.md +103 -0
  118. package/docs/project-audit/2026-05-16/sessions/batch-07.md +61 -0
  119. package/docs/project-audit/2026-05-16/sessions/batch-08.md +101 -0
  120. package/docs/project-audit/2026-05-16/sessions/batch-09.md +105 -0
  121. package/docs/project-audit/2026-05-16/sessions/batch-10.md +102 -0
  122. package/docs/project-audit/AUDIT-HISTORY.md +74 -0
  123. package/docs/project-audit/BATCH-PLAN.md +168 -0
  124. package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +73 -0
  125. package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +275 -0
  126. package/docs/project-finalization/00-tracker.json +60 -0
  127. package/docs/project-knowledge-base/01-system-overview.md +39 -30
  128. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +87 -81
  129. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +140 -108
  130. package/docs/project-knowledge-base/04-data-models-integrations.md +191 -254
  131. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +83 -20
  132. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +67 -29
  133. package/docs/project-knowledge-base/README.md +27 -14
  134. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +81 -0
  135. package/docs/rules-tracker.md +102 -0
  136. package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +116 -0
  137. package/docs/social-media-marketing/README.md +81 -0
  138. package/docs/social-media-marketing/posts-batch-01.md +613 -0
  139. package/docs/social-media-marketing/posts-batch-02.md +528 -0
  140. package/docs/social-media-marketing/whatsapp-messages-batch-01.md +458 -0
  141. package/docs/social-media-marketing/whatsapp-status-batch-01.md +355 -0
  142. package/docs/tracking/finalization-2026-05-16-tracker.json +346 -0
  143. package/docs/tracking/full-audit-tracker.json +121 -0
  144. package/docs/tracking/production-readiness-audit-tracker.json +429 -0
  145. package/ios/Plugin/BackgroundUpdate/BackgroundUpdatePlugin.swift +16 -3
  146. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +71 -47
  147. package/ios/Plugin/NativeUpdatePlugin.swift +14 -9
  148. package/package.json +29 -29
  149. package/cli/node_modules/.yarn-integrity +0 -16
  150. package/cli/node_modules/commander/LICENSE +0 -22
  151. package/cli/node_modules/commander/Readme.md +0 -1148
  152. package/cli/node_modules/commander/esm.mjs +0 -16
  153. package/cli/node_modules/commander/index.js +0 -26
  154. package/cli/node_modules/commander/lib/argument.js +0 -145
  155. package/cli/node_modules/commander/lib/command.js +0 -2179
  156. package/cli/node_modules/commander/lib/error.js +0 -43
  157. package/cli/node_modules/commander/lib/help.js +0 -462
  158. package/cli/node_modules/commander/lib/option.js +0 -329
  159. package/cli/node_modules/commander/lib/suggestSimilar.js +0 -100
  160. package/cli/node_modules/commander/package-support.json +0 -16
  161. package/cli/node_modules/commander/package.json +0 -80
  162. package/cli/node_modules/commander/typings/esm.d.mts +0 -3
  163. package/cli/node_modules/commander/typings/index.d.ts +0 -884
  164. package/cli/yarn.lock +0 -8
  165. package/dist/esm/__tests__/bundle-manager.test.d.ts +0 -1
  166. package/dist/esm/__tests__/bundle-manager.test.js +0 -151
  167. package/dist/esm/__tests__/bundle-manager.test.js.map +0 -1
  168. package/dist/esm/__tests__/config.test.d.ts +0 -1
  169. package/dist/esm/__tests__/config.test.js +0 -70
  170. package/dist/esm/__tests__/config.test.js.map +0 -1
  171. package/dist/esm/__tests__/delta-processor.test.d.ts +0 -1
  172. package/dist/esm/__tests__/delta-processor.test.js +0 -77
  173. package/dist/esm/__tests__/delta-processor.test.js.map +0 -1
  174. package/dist/esm/__tests__/firestore-schema.test.d.ts +0 -1
  175. package/dist/esm/__tests__/firestore-schema.test.js +0 -74
  176. package/dist/esm/__tests__/firestore-schema.test.js.map +0 -1
  177. package/dist/esm/__tests__/integration.test.d.ts +0 -1
  178. package/dist/esm/__tests__/integration.test.js +0 -78
  179. package/dist/esm/__tests__/integration.test.js.map +0 -1
  180. package/dist/esm/__tests__/manifest-reader.test.d.ts +0 -1
  181. package/dist/esm/__tests__/manifest-reader.test.js +0 -271
  182. package/dist/esm/__tests__/manifest-reader.test.js.map +0 -1
  183. package/dist/esm/__tests__/rollout-checker.test.d.ts +0 -1
  184. package/dist/esm/__tests__/rollout-checker.test.js +0 -210
  185. package/dist/esm/__tests__/rollout-checker.test.js.map +0 -1
  186. package/dist/esm/__tests__/security-enforcement.test.d.ts +0 -1
  187. package/dist/esm/__tests__/security-enforcement.test.js +0 -95
  188. package/dist/esm/__tests__/security-enforcement.test.js.map +0 -1
  189. package/dist/esm/__tests__/security.test.d.ts +0 -1
  190. package/dist/esm/__tests__/security.test.js +0 -54
  191. package/dist/esm/__tests__/security.test.js.map +0 -1
  192. package/dist/esm/__tests__/version-manager.test.d.ts +0 -1
  193. package/dist/esm/__tests__/version-manager.test.js +0 -45
  194. package/dist/esm/__tests__/version-manager.test.js.map +0 -1
  195. package/dist/esm/app-review/app-review-manager.js.map +0 -1
  196. package/dist/esm/app-review/index.js.map +0 -1
  197. package/dist/esm/app-review/platform-review-handler.js.map +0 -1
  198. package/dist/esm/app-review/review-conditions-checker.js.map +0 -1
  199. package/dist/esm/app-review/review-rate-limiter.js.map +0 -1
  200. package/dist/esm/app-review/types.js.map +0 -1
  201. package/dist/esm/app-update/app-update-checker.js.map +0 -1
  202. package/dist/esm/app-update/app-update-installer.js.map +0 -1
  203. package/dist/esm/app-update/app-update-manager.js.map +0 -1
  204. package/dist/esm/app-update/app-update-notifier.js.map +0 -1
  205. package/dist/esm/app-update/index.js.map +0 -1
  206. package/dist/esm/app-update/platform-app-update.js.map +0 -1
  207. package/dist/esm/app-update/types.js.map +0 -1
  208. package/dist/esm/background-update/background-scheduler.js.map +0 -1
  209. package/dist/esm/background-update/index.js.map +0 -1
  210. package/dist/esm/background-update/notification-manager.js.map +0 -1
  211. package/dist/esm/config/support.js.map +0 -1
  212. package/dist/esm/core/analytics.js.map +0 -1
  213. package/dist/esm/core/cache-manager.js.map +0 -1
  214. package/dist/esm/core/config.js.map +0 -1
  215. package/dist/esm/core/errors.js.map +0 -1
  216. package/dist/esm/core/event-emitter.js.map +0 -1
  217. package/dist/esm/core/logger.js.map +0 -1
  218. package/dist/esm/core/performance.js.map +0 -1
  219. package/dist/esm/core/plugin-manager.js.map +0 -1
  220. package/dist/esm/core/security.js.map +0 -1
  221. package/dist/esm/definitions.js.map +0 -1
  222. package/dist/esm/firestore/firestore-client.d.ts +0 -109
  223. package/dist/esm/firestore/firestore-client.js +0 -264
  224. package/dist/esm/firestore/firestore-client.js.map +0 -1
  225. package/dist/esm/firestore/index.d.ts +0 -11
  226. package/dist/esm/firestore/index.js +0 -11
  227. package/dist/esm/firestore/index.js.map +0 -1
  228. package/dist/esm/firestore/manifest-reader.d.ts +0 -87
  229. package/dist/esm/firestore/manifest-reader.js +0 -294
  230. package/dist/esm/firestore/manifest-reader.js.map +0 -1
  231. package/dist/esm/firestore/schema.d.ts +0 -507
  232. package/dist/esm/firestore/schema.js +0 -73
  233. package/dist/esm/firestore/schema.js.map +0 -1
  234. package/dist/esm/index.js.map +0 -1
  235. package/dist/esm/live-update/bundle-manager.js.map +0 -1
  236. package/dist/esm/live-update/certificate-pinning.js.map +0 -1
  237. package/dist/esm/live-update/delta-processor.js.map +0 -1
  238. package/dist/esm/live-update/download-manager.js.map +0 -1
  239. package/dist/esm/live-update/rollout-checker.js.map +0 -1
  240. package/dist/esm/live-update/update-manager.js.map +0 -1
  241. package/dist/esm/live-update/version-manager.js.map +0 -1
  242. package/dist/esm/plugin.js.map +0 -1
  243. package/dist/esm/security/crypto.js.map +0 -1
  244. package/dist/esm/security/validator.js.map +0 -1
  245. package/dist/esm/web.js.map +0 -1
  246. package/dist/plugin.cjs.js.map +0 -1
  247. package/dist/plugin.esm.js.map +0 -1
  248. package/dist/plugin.js.map +0 -1
  249. package/docs/FIREBASE_INTEGRATION_TRACKER.md +0 -321
  250. package/docs/FIREBASE_QUERIES_AND_INDEXES_AUDIT.md +0 -221
  251. package/docs/examples/firebase-backend-example.md +0 -27
  252. package/docs/features/laravel-nova-backend/credentials.ignore.md +0 -34
  253. package/docs/guides/no-cost-backend-implementation-plan.md +0 -77
  254. package/docs/guides/no-cost-firestore-google-drive-backend.md +0 -60
  255. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-16.md +0 -454
  256. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-24.md +0 -66
  257. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md +0 -67
  258. /package/docs/{MARKETING_WEBSITE_PLAN.md → archive/MARKETING_WEBSITE_PLAN.md} +0 -0
@@ -2,8 +2,8 @@
2
2
 
3
3
  ## Metadata
4
4
 
5
- - **Reference Date:** 2026-03-16
6
- - **Last Updated:** 2026-03-16
5
+ - **Reference Date:** 2026-05-18
6
+ - **Last Updated:** 2026-05-18
7
7
 
8
8
  ## Monorepo Structure
9
9
 
@@ -13,9 +13,9 @@
13
13
  | `android/` | Android native plugin implementation in Kotlin |
14
14
  | `ios/` | iOS native plugin implementation in Swift |
15
15
  | `cli/` | CLI package and commands |
16
- | `website/` | Marketing site and dashboard application |
17
- | `website/functions/` | Legacy Firebase Functions backend/reference backend |
18
- | `example-apps/` | Example frontend and backend projects |
16
+ | `website/` | Marketing site and dashboard application (React 19 + Vite + Capacitor wrapper) |
17
+ | `backend/` | Laravel 11 + Nova 5 SaaS backend (only backend; canonical persistence layer) |
18
+ | `example-apps/` | Example frontend (`react-capacitor/`) and backend (`node-express/`) projects |
19
19
  | `docs/` | Public docs, planning, reports, and knowledge artifacts |
20
20
 
21
21
  ## Root Package Tech Stack
@@ -24,8 +24,7 @@
24
24
  - TypeScript
25
25
  - Rollup
26
26
  - Capacitor 8 ecosystem packages
27
- - Vitest
28
- - ESLint
27
+ - ESLint (`@typescript-eslint/*` flat config; `@eslint/js` is BANNED)
29
28
  - Prettier
30
29
  - Commander
31
30
  - Express
@@ -36,20 +35,33 @@
36
35
 
37
36
  ## Website Tech Stack
38
37
 
39
- - React 19
40
- - TypeScript
38
+ - React 19 + TypeScript
41
39
  - Vite 7
42
40
  - Tailwind CSS v4
43
- - Firebase Auth
44
- - Firestore
45
- - Google Identity Services
46
- - Google Drive API
47
- - Zustand
48
- - Framer Motion
49
- - Radix UI primitives
50
- - D3
41
+ - Google OAuth via Laravel Socialite (backend-driven; no Firebase Auth in the SPA)
42
+ - Sanctum bearer tokens persisted via `@capacitor/preferences` (native) / `localStorage` (web)
43
+ - TanStack Query (data plane with hierarchical keys + URL-state pagination + keepPreviousData)
44
+ - Axios (`src/lib/api.ts` with 401-clear-and-redirect interceptor)
45
+ - Zustand (local UI state)
46
+ - Framer Motion (animations)
47
+ - Radix UI primitives (Dialog, Tooltip, etc.)
48
+ - D3 (charts)
51
49
  - React Router
52
50
  - React Markdown
51
+ - Capacitor 8 (mobile wrapper for the dashboard)
52
+
53
+ ## Backend Tech Stack
54
+
55
+ - Laravel 11
56
+ - Laravel Nova 5 (admin UI at `/nova`)
57
+ - Laravel Socialite (Google OAuth)
58
+ - Laravel Sanctum (personal access tokens for the SPA)
59
+ - `spatie/laravel-permission` (RBAC; `sanctum` guard; roles `super-admin`, `admin`, `user`)
60
+ - MySQL (single source of persistence — no Firestore branch)
61
+ - PHP 8.2+
62
+ - Composer
63
+ - Pest / PHPUnit (~136 tests at last finalization audit)
64
+ - Google Drive PHP SDK (server-side OAuth; tokens encrypted via Laravel's encrypter)
53
65
 
54
66
  ## CLI Package
55
67
 
@@ -64,7 +76,7 @@
64
76
  - `bundle-sign`
65
77
  - `bundle-verify`
66
78
  - `keys-generate`
67
- - `backend-create`
79
+ - `backend-create` (emits scaffolds with `TODO[SCAFFOLD-IMPLEMENT-BEFORE-DEPLOY]` markers)
68
80
  - `server-start`
69
81
  - `monitor`
70
82
 
@@ -72,10 +84,10 @@
72
84
 
73
85
  - scaffolds projects
74
86
  - generates bundles
75
- - signs and verifies release artifacts
76
- - generates keys
87
+ - signs and verifies release artifacts (RSA-2048 / RSA-4096 / EC P-256 / EC P-384)
88
+ - generates keypairs
77
89
  - starts local server flow
78
- - supports deployment monitoring
90
+ - supports deployment monitoring (interval+spinner cleanup, signal handlers, failure bail)
79
91
 
80
92
  ## Core Plugin Module Inventory
81
93
 
@@ -141,17 +153,7 @@
141
153
  - `crypto.ts`
142
154
  - `validator.ts`
143
155
 
144
- **Purpose:** cryptographic helpers and validation utilities.
145
-
146
- ### `src/firestore/`
147
-
148
- - `firestore-client.ts`
149
- - `manifest-reader.ts`
150
- - `schema.ts`
151
- - `index.ts`
152
- - rules/indexes files
153
-
154
- **Purpose:** Firestore-backed manifest access and schema definition for update metadata.
156
+ **Purpose:** cryptographic helpers and validation utilities (SHA-256, RSA-SHA256 verify).
155
157
 
156
158
  ### Root Entry Files
157
159
 
@@ -162,17 +164,19 @@
162
164
 
163
165
  **Purpose:** export surface, Capacitor plugin bindings, typings, and web fallback behavior.
164
166
 
167
+ Note: `src/firestore/` was removed in v3.0.0 (2026-05-04). The plugin no longer carries any Firestore code; manifest reads happen over plain HTTPS against any user-controlled endpoint.
168
+
165
169
  ## Native Android Modules
166
170
 
167
171
  | File | Role |
168
172
  |------|------|
169
173
  | `NativeUpdatePlugin.kt` | Main Android plugin entry |
170
174
  | `LiveUpdatePlugin.kt` | OTA/live update Android implementation |
171
- | `AppUpdatePlugin.kt` | App update Android integration |
172
- | `AppReviewPlugin.kt` | In-app review Android integration |
175
+ | `AppUpdatePlugin.kt` | App update Android integration (Play Core) |
176
+ | `AppReviewPlugin.kt` | In-app review Android integration (Play Review) |
173
177
  | `BackgroundUpdatePlugin.kt` | Background update orchestration |
174
178
  | `BackgroundUpdateManager.kt` | Background scheduling/management logic |
175
- | `BackgroundUpdateWorker.kt` | Worker-based background task execution |
179
+ | `BackgroundUpdateWorker.kt` | WorkManager-based background task execution |
176
180
  | `BackgroundNotificationManager.kt` | Notification support |
177
181
  | `NotificationActionReceiver.kt` | Notification action handling |
178
182
  | `SecurityManager.kt` | Android security helpers |
@@ -186,134 +190,155 @@
186
190
  | `LiveUpdatePlugin.swift` | OTA/live update implementation |
187
191
  | `WebViewConfiguration.swift` | web view config support for live updates |
188
192
  | `AppUpdatePlugin.swift` | App update iOS behavior |
189
- | `AppReviewPlugin.swift` | StoreKit review handling |
190
- | `BackgroundUpdatePlugin.swift` | background update behavior |
193
+ | `AppReviewPlugin.swift` | StoreKit `SKStoreReviewController` handling |
194
+ | `BackgroundUpdatePlugin.swift` | BGTaskScheduler background update behavior |
191
195
  | `BackgroundNotificationManager.swift` | notification support |
192
196
  | `SecurityManager.swift` | iOS security helpers |
193
197
 
194
- ## Frontend Services
198
+ ## Frontend Services (`website/src/services/`)
195
199
 
196
200
  ### `auth-service.ts`
197
201
 
198
- - Google sign-in via Firebase popup
199
- - first-login user doc creation
200
- - existing-user last-login update
201
- - admin flag refresh for owner email
202
- - logout support
202
+ - Initiates Laravel Socialite redirect for Google sign-in
203
+ - handles `/auth/callback` token persistence via `lib/auth-token.ts`
204
+ - logout flow (deletes Sanctum token, broadcasts event, clears Drive cache)
205
+
206
+ ### `apps-api-service.ts`
207
+
208
+ - TanStack Query hooks for App CRUD against `/api/dashboard/apps/*`
203
209
 
204
210
  ### `google-drive-service.ts`
205
211
 
206
- - load Google Identity Services SDK
207
- - request Drive scopes
208
- - connect/disconnect Drive
209
- - persist token metadata in Firestore
210
- - fetch user info from Google
211
- - list files
212
- - create folder hierarchy
213
- - upload files
214
- - make files public
215
- - maintain Drive connection status
212
+ - starts the server-side Drive OAuth flow (no browser SDK)
213
+ - requests Drive auth URL from the backend
214
+ - posts callback code back to the backend
215
+ - reads Drive connection status from `/api/dashboard/me`
216
+ - lists files via backend proxy endpoints
216
217
 
217
218
  ### `bundle-upload-service.ts`
218
219
 
219
- - validate bundle file
220
- - calculate SHA-256 checksum
221
- - generate file manifest from ZIP
222
- - upload bundle and manifest to Drive
223
- - write build document
224
- - update manifest document
225
- - track progress stages
220
+ - validates ZIP file (size, type)
221
+ - multipart POST to `/api/dashboard/apps/{app}/builds` with progress tracking
222
+ - triggers TanStack Query cache invalidation on success
226
223
 
227
224
  ### `manifest-generator.ts`
228
225
 
229
- - derive per-file manifest from ZIP
230
- - compare old/new manifests
231
- - estimate delta size
232
- - decide if delta is worthwhile
233
- - extract files from ZIP
226
+ - derives per-file manifest from ZIP (client-side, for delta hints)
227
+ - compares old/new manifests
228
+ - estimates delta size
229
+ - decides if delta is worthwhile
230
+
231
+ ### `themeSync.ts`
232
+
233
+ - syncs theme preferences to `users.preferences` JSON via `/api/dashboard/preferences`
234
234
 
235
235
  ### Other Frontend Services
236
236
 
237
- - `auth-service.ts`
238
- - `bundle-upload-service.ts`
239
- - `google-drive-service.ts`
240
- - `manifest-generator.ts`
241
237
  - capacitor service wrappers under `website/src/services/capacitor/`
242
238
 
243
239
  ## Frontend State Stores
244
240
 
245
241
  ### `appsStore`
246
242
 
247
- - fetch user apps
248
- - fetch app by ID
249
- - create/update/delete app
250
- - manage selected app and errors
243
+ - TanStack-Query-backed cache for user apps (hierarchical keys)
244
+ - selected-app tracking + error surface
251
245
 
252
246
  ### `buildsStore`
253
247
 
254
- - fetch builds per app/user/channel
255
- - fetch build by ID
256
- - fetch latest builds
257
- - update build status
258
- - delete builds
248
+ - TanStack-Query-backed cache for builds per app/user/channel
249
+ - pagination + filter state encoded in URL search params
259
250
 
260
251
  ### `rolloutsStore`
261
252
 
262
- - fetch rollout state from manifests
263
- - fetch rollout by app/channel
264
- - update rollout config
265
- - pause/resume/start rollout
253
+ - fetches rollout state from Build rows
254
+ - pause/resume/percentage mutations
266
255
 
267
256
  ### `analyticsStore`
268
257
 
269
- - fetch analytics batches
270
- - aggregate downloads, installs, errors, rollbacks
271
- - build platform/version summaries
272
- - manage date range
258
+ - fetches aggregated events from `/api/dashboard/analytics`
259
+ - builds platform/version summaries
260
+ - manages date range
273
261
 
274
- ## Website Backend Reference (`website/functions`)
262
+ ## Backend Source Tree (`backend/`)
275
263
 
276
- ### Main Areas
264
+ ### Controllers (`app/Http/Controllers/`)
277
265
 
278
- - `config/firebase.ts`
279
- - `middleware/auth.ts`
280
- - `middleware/validation.ts`
281
- - `routes/apps.ts`
282
- - `routes/builds.ts`
283
- - `routes/users.ts`
284
- - `utils/errors.ts`
285
- - `utils/validators.ts`
286
- - `index.ts`
266
+ - `Auth/OAuthController` (Socialite redirect + callback + Sanctum token issuance)
267
+ - `Dashboard/AnalyticsDashboardController`
268
+ - `Dashboard/ApiKeyController`
269
+ - `Dashboard/AppController`
270
+ - `Dashboard/BuildController`
271
+ - `Dashboard/GoogleDriveController`
272
+ - `Dashboard/MeController`
273
+ - `Dashboard/PreferencesController`
274
+ - `Dashboard/RolloutController`
275
+ - `Dashboard/SigningKeyController`
276
+ - `Dashboard/SubscriptionController`
277
+ - `Api/UpdateController` (mobile `/api/v1/updates/check`)
278
+ - `Api/BundleController` (signed `/api/v1/bundles/{build}/download`)
279
+ - `Api/AnalyticsController` (mobile `/api/v1/analytics/*`)
287
280
 
288
- **Purpose:** a Firebase Functions + Express reference backend retained in the repo.
281
+ ### Eloquent Models (`app/Models/`)
282
+
283
+ - `User`
284
+ - `App`
285
+ - `ApiKey`
286
+ - `SigningKey`
287
+ - `Build`
288
+ - `Subscription`
289
+ - `DeviceActivity`
290
+ - `AnalyticsEvent`
291
+
292
+ ### FormRequest Validators (`app/Http/Requests/`)
293
+
294
+ - `UpdateBuildRequest` and related Create/Update FormRequests for App, ApiKey, SigningKey
295
+
296
+ ### Routes
297
+
298
+ - `routes/api.php` (all `/api/*` routes)
299
+ - `routes/web.php` (Nova mounts + OAuth callback HTML stubs)
300
+ - `routes/console.php` (Artisan commands including `native-update:role-assign`)
301
+
302
+ ### Policies + Gates
303
+
304
+ - `User`, `App`, `Build`, `ApiKey`, `SigningKey` policies registered in `AuthServiceProvider`
305
+ - `Gate::before` returns `true` for `super-admin` (full bypass)
306
+ - `Nova/User.php` carries `canSee` guards for admin-only resources
289
307
 
290
308
  ## Example Apps
291
309
 
292
310
  ### `example-apps/react-capacitor/`
293
311
 
294
312
  - frontend example demonstrating plugin use in a Capacitor app
313
+ - React 18 (stable downstream target; explained in its README "React 18 vs React 19" section)
314
+ - capability cards: OTA basic, app-update (`getAppUpdateInfo`/`openAppStore`), app-review (`canRequestReview`/`requestReview`), background-update (toggle with `allowMeteredConnection`/`nextCheckTime`)
295
315
 
296
316
  ### `example-apps/node-express/`
297
317
 
298
- - backend example using Node.js + Express
299
-
300
- ### `example-apps/firebase-backend/`
318
+ - minimal Node.js + Express backend example
319
+ - ~160 lines, dissected in `docs/backend/node-express-minimal.md`
320
+ - demonstrates the manifest-endpoint contract without a full SaaS
301
321
 
302
- - Firebase-based backend example
322
+ Note: `example-apps/firebase-backend/` was removed in v3.0.0 (2026-05-04).
303
323
 
304
324
  ## Testing Modules Present
305
325
 
306
- ### TypeScript Tests
326
+ ### TypeScript Tests (root plugin)
307
327
 
308
328
  - bundle manager
309
329
  - config
310
330
  - delta processor
311
- - firestore schema
312
- - integration
331
+ - integration (live-update flow)
313
332
  - manifest reader
314
333
  - rollout checker
315
334
  - security
316
335
  - version manager
336
+ - 62/62 passing at last verification
337
+
338
+ ### Backend Tests (`backend/tests/`)
339
+
340
+ - OAuth + Sanctum + Spatie + UpdateBuildRequest FormRequest + PayPal webhook + BundleUpload + UserLicense
341
+ - ~136 tests passing (`php artisan test`)
317
342
 
318
343
  ### iOS Tests
319
344
 
@@ -332,16 +357,23 @@
332
357
  - live update plugin tests
333
358
  - security manager tests
334
359
 
335
- ### E2E
360
+ ### E2E (`e2e/`)
336
361
 
337
362
  - OTA update flow
338
363
  - download progress
339
364
  - channel switching
340
365
  - error handling
341
366
 
367
+ ### Microbenchmarks (`tools/bench/`)
368
+
369
+ - `verify-checksum.bench.ts` (SHA-256 over 1/5/20 MB)
370
+ - `verify-signature.bench.ts` (RSA-2048 + RSA-4096 SHA-256 verify over 5 MB)
371
+
342
372
  ## Important Architectural Direction
343
373
 
344
374
  - Treat the plugin as runtime infrastructure.
345
375
  - Treat the website as management and distribution tooling.
346
- - Treat Firestore manifests as a key source of truth for client update checks.
347
- - Treat Google Drive as the preferred no-cost storage destination for uploaded artifacts in the website flow.
376
+ - Treat Laravel + MySQL as the single source of truth for App, Build, and User data.
377
+ - Treat Sanctum personal access tokens as the only credential the SPA holds; the dashboard reads its identity from `/api/dashboard/me`.
378
+ - Treat Google Drive as the canonical storage destination for uploaded bundle ZIPs (server-side OAuth tokens, encrypted at rest).
379
+ - Treat the mobile API plane (`/api/v1/*`) as a separate auth surface (per-app API keys, not Sanctum).