native-update 1.4.9 → 2.0.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 (71) hide show
  1. package/Readme.md +13 -1
  2. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdatePlugin.kt +15 -0
  3. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdateWorker.kt +23 -7
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +152 -4
  5. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +14 -1
  6. package/android/src/main/java/com/aoneahsan/nativeupdate/NotificationActionReceiver.kt +10 -1
  7. package/android/src/main/java/com/aoneahsan/nativeupdate/SecurityManager.kt +18 -18
  8. package/cli/AGENTS.md +29 -0
  9. package/cli/CLAUDE.md +51 -0
  10. package/dist/esm/__tests__/security-enforcement.test.d.ts +1 -0
  11. package/dist/esm/__tests__/security-enforcement.test.js +95 -0
  12. package/dist/esm/__tests__/security-enforcement.test.js.map +1 -0
  13. package/dist/esm/core/config.d.ts +6 -15
  14. package/dist/esm/core/config.js +1 -4
  15. package/dist/esm/core/config.js.map +1 -1
  16. package/dist/esm/core/security.d.ts +11 -3
  17. package/dist/esm/core/security.js +19 -6
  18. package/dist/esm/core/security.js.map +1 -1
  19. package/dist/esm/definitions.d.ts +13 -29
  20. package/dist/esm/definitions.js.map +1 -1
  21. package/dist/esm/index.d.ts +0 -2
  22. package/dist/esm/index.js +0 -2
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/live-update/download-manager.d.ts +36 -5
  25. package/dist/esm/live-update/download-manager.js +61 -22
  26. package/dist/esm/live-update/download-manager.js.map +1 -1
  27. package/dist/esm/live-update/update-manager.d.ts +12 -1
  28. package/dist/esm/live-update/update-manager.js +38 -10
  29. package/dist/esm/live-update/update-manager.js.map +1 -1
  30. package/dist/esm/live-update/version-manager.d.ts +9 -0
  31. package/dist/esm/live-update/version-manager.js +40 -0
  32. package/dist/esm/live-update/version-manager.js.map +1 -1
  33. package/dist/esm/plugin.js +13 -46
  34. package/dist/esm/plugin.js.map +1 -1
  35. package/dist/esm/web.d.ts +18 -1
  36. package/dist/esm/web.js +69 -24
  37. package/dist/esm/web.js.map +1 -1
  38. package/dist/plugin.cjs.js +1 -1
  39. package/dist/plugin.cjs.js.map +1 -1
  40. package/dist/plugin.esm.js +1 -1
  41. package/dist/plugin.esm.js.map +1 -1
  42. package/dist/plugin.js +2 -2
  43. package/dist/plugin.js.map +1 -1
  44. package/docs/AGENTS.md +38 -0
  45. package/docs/CHANGELOG.md +151 -0
  46. package/docs/CLAUDE.md +101 -0
  47. package/docs/MIGRATION.md +87 -0
  48. package/docs/README.md +13 -2
  49. package/docs/deployment/HOSTINGER_DEPLOY.md +329 -0
  50. package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +96 -0
  51. package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +504 -0
  52. package/docs/features/laravel-nova-backend/credentials.ignore.md +34 -0
  53. package/docs/features/laravel-nova-backend/progress-tracker.json +184 -0
  54. package/docs/project-knowledge-base/01-system-overview.md +218 -0
  55. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +346 -0
  56. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +347 -0
  57. package/docs/project-knowledge-base/04-data-models-integrations.md +307 -0
  58. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +193 -0
  59. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +170 -0
  60. package/docs/project-knowledge-base/README.md +90 -0
  61. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-16.md +454 -0
  62. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-24.md +66 -0
  63. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md +67 -0
  64. package/docs/seo-aeo-rules.json +3043 -0
  65. package/docs/tracking/seo-checklist-tracker.json +333 -0
  66. package/ios/Plugin/BackgroundUpdate/BackgroundUpdatePlugin.swift +50 -6
  67. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +238 -8
  68. package/ios/Plugin/NativeUpdatePlugin.swift +8 -0
  69. package/ios/Plugin/Security/SecurityManager.swift +13 -14
  70. package/package.json +30 -31
  71. package/docs/play-console-rejection-rules.json +0 -428
@@ -0,0 +1,346 @@
1
+ # Native Update Routes, Pages, Forms, and Users
2
+
3
+ ## Metadata
4
+
5
+ - **Reference Date:** 2026-03-16
6
+ - **Last Updated:** 2026-03-16
7
+
8
+ ## Route Inventory
9
+
10
+ ### Public Marketing and Info Routes
11
+
12
+ | Route | Page | Access | Purpose |
13
+ |------|------|--------|---------|
14
+ | `/` | HomePage | Public | Main landing page and primary product pitch |
15
+ | `/features` | FeaturesPage | Public | Feature breakdown across OTA, app updates, and reviews |
16
+ | `/pricing` | PricingPage | Public | Pricing/beta/commercial positioning page |
17
+ | `/docs` | DocsPage | Public | Docs hub and guided docs entry |
18
+ | `/docs/*` | DocsMarkdownPage | Public | Render markdown docs pages from public docs set |
19
+ | `/about` | AboutPage | Public | Mission, project story, differentiators, creator profile |
20
+ | `/contact` | ContactPage | Public | Contact methods, support info, FAQ |
21
+ | `/privacy` | PrivacyPage | Public | Privacy policy |
22
+ | `/terms` | TermsPage | Public | Terms of service |
23
+ | `/data-deletion` | DataDeletionPage | Public | Data/account deletion policy |
24
+ | `/cookies` | CookiePolicyPage | Public | Cookie policy |
25
+ | `/security` | SecurityPage | Public | Security messaging and practices |
26
+ | `/sitemap` | SitemapPage | Public | Human-friendly route explorer/search |
27
+ | `/feed` | FeedPage | Public | Human-facing public content feed/search |
28
+
29
+ ### Auth Routes
30
+
31
+ | Route | Page | Access | Purpose |
32
+ |------|------|--------|---------|
33
+ | `/login` | LoginPage | Public | Sign in with Google |
34
+ | `/signup` | SignupPage | Public | Sign up with Google / beta onboarding |
35
+
36
+ ### Protected Dashboard Routes
37
+
38
+ | Route | Page | Access | Purpose |
39
+ |------|------|--------|---------|
40
+ | `/dashboard` | DashboardOverview | Authenticated user | Main dashboard metrics and quick actions |
41
+ | `/dashboard/apps` | AppsPage | Authenticated user | Create, edit, delete, and browse owned apps |
42
+ | `/dashboard/apps/:appId` | AppDetailPage | Authenticated user | Per-app details, builds, channels, and rollout state |
43
+ | `/dashboard/builds` | BuildsPage | Authenticated user | Browse/filter builds |
44
+ | `/dashboard/builds/:buildId` | BuildDetailPage | Authenticated user | Detailed build record view |
45
+ | `/dashboard/upload` | UploadPage | Authenticated user | Publish ZIP bundle and update manifests |
46
+ | `/dashboard/drive` | GoogleDrivePage | Authenticated user | Connect/disconnect Drive and review storage footprint |
47
+ | `/dashboard/config` | ConfigPage | Authenticated user | Show recommended backend/config integration guidance |
48
+ | `/dashboard/settings` | SettingsPage | Authenticated user | Account preferences, password flow, account deletion |
49
+ | `/dashboard/rollouts` | RolloutsPage | Authenticated user | Manage rollout percentages and pause/resume rollouts |
50
+ | `/dashboard/analytics` | AnalyticsPage | Authenticated user | View aggregated update analytics |
51
+
52
+ ### Admin Routes
53
+
54
+ | Route | Page | Access | Purpose |
55
+ |------|------|--------|---------|
56
+ | `/admin` | AdminOverview | Admin only | Admin overview metrics |
57
+ | `/admin/users` | AdminUsersPage | Admin only | Search/browse user accounts |
58
+ | `/admin/apps` | AdminAppsPage | Admin only | Search/browse all apps |
59
+ | `/admin/builds` | AdminBuildsPage | Admin only | Search/filter all builds |
60
+
61
+ ## Access and Guard Behavior
62
+
63
+ ### ProtectedRoute
64
+
65
+ - Requires authenticated user
66
+ - Computes email verification from Firebase auth state or Google provider context
67
+ - Redirects unauthenticated users to `/login`
68
+ - If email verification is required and not satisfied, redirects to `/verify-email`
69
+
70
+ ### AdminRoute
71
+
72
+ - Requires authenticated user
73
+ - loads the Firestore user document
74
+ - allows access only when `isAdmin === true`
75
+ - redirects non-admin users to `/dashboard`
76
+
77
+ ## User Types and Permissions
78
+
79
+ ### Public Visitor
80
+
81
+ - Can view product, docs, legal, sitemap, feed, and contact pages
82
+ - Cannot access dashboard or admin
83
+
84
+ ### Signed-In Product User
85
+
86
+ - Signs in via Google popup
87
+ - has a Firestore `users/{uid}` document
88
+ - can manage their own apps/builds/settings
89
+ - can connect Google Drive
90
+
91
+ ### Admin User
92
+
93
+ - Same as signed-in user plus `isAdmin: true`
94
+ - can access admin metrics and cross-user inventories
95
+
96
+ ### App Runtime Consumer
97
+
98
+ - Uses plugin APIs and manifest endpoints
99
+ - not a website operator account
100
+
101
+ ## Page-Level Notes
102
+
103
+ ### HomePage
104
+
105
+ - Hero positioning: complete update solution for Capacitor
106
+ - Calls to action: get started, view docs
107
+ - Highlights three core pillars: OTA updates, native app updates, in-app reviews
108
+
109
+ ### FeaturesPage
110
+
111
+ - Feature cards for OTA, native app updates, and reviews
112
+ - Messaging includes delta updates, rollback, channels, encryption, analytics, priority levels, and rate limiting
113
+
114
+ ### AboutPage
115
+
116
+ - Includes project mission
117
+ - explains why project exists
118
+ - highlights open-source positioning
119
+ - includes creator profile and contact links
120
+
121
+ ### ContactPage
122
+
123
+ - No typed form submission flow
124
+ - Uses direct contact methods: email, WhatsApp, LinkedIn, portfolio, docs, NPM link
125
+ - Includes support-hour information and FAQ
126
+
127
+ ### DocsPage / DocsMarkdownPage
128
+
129
+ - DocsPage acts as a rich docs landing surface
130
+ - DocsMarkdownPage renders markdown docs pages from the public docs payload
131
+
132
+ ### SitemapPage and FeedPage
133
+
134
+ - Search/filter style discovery experiences
135
+ - use `Input` fields for route/content lookup
136
+ - intended as human-friendly content navigation surfaces
137
+
138
+ ### DashboardOverview
139
+
140
+ - Shows owned app/build summary state
141
+ - includes CTA to upload first build
142
+
143
+ ### AppsPage
144
+
145
+ - Central app management page
146
+ - create/edit/delete dialog workflows
147
+ - stores package id, description, platforms, and generates API key on creation
148
+
149
+ ### AppDetailPage
150
+
151
+ - per-app management view
152
+ - shows builds and rollout state
153
+ - links to upload and rollout workflows
154
+
155
+ ### BuildsPage / BuildDetailPage
156
+
157
+ - list and inspect build history
158
+ - filter by app/channel/status/platform
159
+ - build detail includes upload time, uploader, duration, and release metadata
160
+
161
+ ### UploadPage
162
+
163
+ - Core publish UI
164
+ - requires Google Drive connection
165
+ - uploads ZIP bundle and file manifest
166
+ - publishes Firestore manifest data
167
+
168
+ ### GoogleDrivePage
169
+
170
+ - connects/disconnects Drive
171
+ - shows Drive connection status, connected email, folder list, file count, and total size
172
+
173
+ ### ConfigPage
174
+
175
+ - instructional/configuration surface
176
+ - presents recommended production path: browser upload to Google Drive + Firestore metadata publishing + app-side reads
177
+
178
+ ### SettingsPage
179
+
180
+ - account profile details
181
+ - preferences
182
+ - appearance
183
+ - password change for email/password providers
184
+ - account deletion confirmation flow
185
+
186
+ ### RolloutsPage
187
+
188
+ - percentage controls
189
+ - pause/resume actions
190
+ - edit modal with numeric and range input
191
+ - rollout best practices guidance
192
+
193
+ ### AnalyticsPage
194
+
195
+ - filters by app and channel
196
+ - aggregates analytics batch data across time range
197
+ - intended for download/install/error/rollback analysis
198
+
199
+ ### Admin Pages
200
+
201
+ - AdminOverview aggregates cross-system metrics
202
+ - AdminUsersPage supports user search/filtering
203
+ - AdminAppsPage supports app search/filtering
204
+ - AdminBuildsPage supports build search/filtering by multiple fields
205
+
206
+ ## Form and Input Inventory
207
+
208
+ ### LoginPage
209
+
210
+ - **Action:** Google sign-in button
211
+ - **Inputs:** No text input fields
212
+ - **Errors handled:** popup closed, popup blocked, generic auth failure
213
+
214
+ ### SignupPage
215
+
216
+ - **Action:** Google sign-up button
217
+ - **Inputs:** No text input fields
218
+ - **Purpose:** fast account creation for beta onboarding
219
+
220
+ ### AppsPage Create/Edit App Dialog
221
+
222
+ - **Fields:**
223
+ - App name
224
+ - Package ID
225
+ - Description
226
+ - Platforms: Android, iOS, Web
227
+ - **Validation:**
228
+ - app name required, minimum length
229
+ - package ID required and regex-validated
230
+ - at least one platform required
231
+ - **Side effects on create:**
232
+ - creates app doc
233
+ - generates API key
234
+ - creates `apiKeys/{apiKey}` doc
235
+ - increments user `appsCount`
236
+
237
+ ### AppsPage Delete Dialog
238
+
239
+ - **Purpose:** destructive app deletion
240
+ - **Effects:** deletes manifests under app API key, deletes API key doc, deletes app doc, decrements user `appsCount`
241
+
242
+ ### UploadPage Publish Form
243
+
244
+ - **Fields:**
245
+ - file picker / drag-drop ZIP
246
+ - app select
247
+ - channel select
248
+ - platform select
249
+ - version input
250
+ - build number input
251
+ - release notes textarea
252
+ - **Validation:**
253
+ - app required
254
+ - version required
255
+ - build number required
256
+ - ZIP file required
257
+ - Drive connection required
258
+ - **Flow:**
259
+ - validate file
260
+ - calculate SHA-256
261
+ - generate file manifest
262
+ - upload ZIP to Drive
263
+ - upload manifest JSON to Drive
264
+ - write build doc
265
+ - update Firestore manifest docs
266
+ - navigate to app detail
267
+
268
+ ### SettingsPage Preferences
269
+
270
+ - **Fields:**
271
+ - email notifications toggle
272
+ - update notifications toggle
273
+ - theme select
274
+ - language select
275
+ - **Action:** save preferences to user doc
276
+
277
+ ### SettingsPage Change Password
278
+
279
+ - **Fields:**
280
+ - current password
281
+ - new password
282
+ - confirm new password
283
+ - **Validation:**
284
+ - required fields
285
+ - minimum new password length
286
+ - confirmation match
287
+ - **Special note:** only shown for email/password provider, not Google-only users
288
+
289
+ ### SettingsPage Delete Account
290
+
291
+ - **Field:** confirmation input requiring exact `DELETE`
292
+ - **Action:** delete Firestore user doc and Firebase auth user
293
+
294
+ ### RolloutsPage Edit Modal
295
+
296
+ - **Fields:**
297
+ - rollout percentage numeric input
298
+ - rollout percentage range slider
299
+ - **Action:** update `rollout.percentage`
300
+
301
+ ### BuildsPage Filters
302
+
303
+ - search input
304
+ - app filter
305
+ - channel filter
306
+ - platform filter
307
+ - status filter
308
+
309
+ ### AdminBuildsPage Filters
310
+
311
+ - search input
312
+ - app filter
313
+ - user filter or owner-related filtering
314
+ - channel/status/platform filters
315
+
316
+ ### AdminUsersPage Filters
317
+
318
+ - search input
319
+
320
+ ### AdminAppsPage Filters
321
+
322
+ - search input
323
+
324
+ ### FeedPage and SitemapPage
325
+
326
+ - search input for route/content discovery
327
+
328
+ ## Contact and Support Surfaces
329
+
330
+ ### ContactPage URLs
331
+
332
+ - `mailto:aoneahsan@gmail.com`
333
+ - `https://www.npmjs.com/package/native-update`
334
+ - `https://wa.me/923046619706`
335
+ - `https://linkedin.com/in/aoneahsan`
336
+ - `https://aoneahsan.com`
337
+ - internal docs link: `/docs`
338
+
339
+ ## Important UX and Product Notes
340
+
341
+ - Dashboard is clearly owner/operator tooling, not consumer UI
342
+ - Google sign-in is primary auth path
343
+ - Google Drive is central to the no-cost publishing workflow
344
+ - App creation is a prerequisite for upload
345
+ - Drive connection is a prerequisite for upload
346
+ - Rollouts are edited from manifest data, not from a separate dedicated rollout service
@@ -0,0 +1,347 @@
1
+ # Native Update Tech Stack, Modules, and Services
2
+
3
+ ## Metadata
4
+
5
+ - **Reference Date:** 2026-03-16
6
+ - **Last Updated:** 2026-03-16
7
+
8
+ ## Monorepo Structure
9
+
10
+ | Path | Purpose |
11
+ |------|---------|
12
+ | `src/` | Main TypeScript plugin implementation |
13
+ | `android/` | Android native plugin implementation in Kotlin |
14
+ | `ios/` | iOS native plugin implementation in Swift |
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 |
19
+ | `docs/` | Public docs, planning, reports, and knowledge artifacts |
20
+
21
+ ## Root Package Tech Stack
22
+
23
+ - Node.js `>=24.13.0`
24
+ - TypeScript
25
+ - Rollup
26
+ - Capacitor 8 ecosystem packages
27
+ - Vitest
28
+ - ESLint
29
+ - Prettier
30
+ - Commander
31
+ - Express
32
+ - Archiver
33
+ - Chalk
34
+ - Ora
35
+ - Prompts
36
+
37
+ ## Website Tech Stack
38
+
39
+ - React 19
40
+ - TypeScript
41
+ - Vite 7
42
+ - 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
51
+ - React Router
52
+ - React Markdown
53
+
54
+ ## CLI Package
55
+
56
+ ### Entry
57
+
58
+ - `cli/index.js`
59
+
60
+ ### Commands
61
+
62
+ - `init`
63
+ - `bundle-create`
64
+ - `bundle-sign`
65
+ - `bundle-verify`
66
+ - `keys-generate`
67
+ - `backend-create`
68
+ - `server-start`
69
+ - `monitor`
70
+
71
+ ### CLI Value
72
+
73
+ - scaffolds projects
74
+ - generates bundles
75
+ - signs and verifies release artifacts
76
+ - generates keys
77
+ - starts local server flow
78
+ - supports deployment monitoring
79
+
80
+ ## Core Plugin Module Inventory
81
+
82
+ ### `src/live-update/`
83
+
84
+ - `bundle-manager.ts`
85
+ - `certificate-pinning.ts`
86
+ - `delta-processor.ts`
87
+ - `download-manager.ts`
88
+ - `rollout-checker.ts`
89
+ - `update-manager.ts`
90
+ - `version-manager.ts`
91
+
92
+ **Purpose:** runtime live update logic, version checks, download/install handling, delta support, and rollout-aware decisions.
93
+
94
+ ### `src/app-update/`
95
+
96
+ - `app-update-checker.ts`
97
+ - `app-update-installer.ts`
98
+ - `app-update-manager.ts`
99
+ - `app-update-notifier.ts`
100
+ - `platform-app-update.ts`
101
+ - `types.ts`
102
+ - `index.ts`
103
+
104
+ **Purpose:** native binary update checks, install flows, platform-specific update behavior, and notifications.
105
+
106
+ ### `src/app-review/`
107
+
108
+ - `app-review-manager.ts`
109
+ - `platform-review-handler.ts`
110
+ - `review-conditions-checker.ts`
111
+ - `review-rate-limiter.ts`
112
+ - `types.ts`
113
+ - `index.ts`
114
+
115
+ **Purpose:** smart in-app review prompting, timing/eligibility checks, platform-specific review invocation.
116
+
117
+ ### `src/background-update/`
118
+
119
+ - `background-scheduler.ts`
120
+ - `notification-manager.ts`
121
+ - `index.ts`
122
+
123
+ **Purpose:** scheduling, notifications, and background update orchestration.
124
+
125
+ ### `src/core/`
126
+
127
+ - `analytics.ts`
128
+ - `cache-manager.ts`
129
+ - `config.ts`
130
+ - `errors.ts`
131
+ - `event-emitter.ts`
132
+ - `logger.ts`
133
+ - `performance.ts`
134
+ - `plugin-manager.ts`
135
+ - `security.ts`
136
+
137
+ **Purpose:** shared foundations for config, events, logging, analytics, errors, caching, and general plugin behavior.
138
+
139
+ ### `src/security/`
140
+
141
+ - `crypto.ts`
142
+ - `validator.ts`
143
+
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.
155
+
156
+ ### Root Entry Files
157
+
158
+ - `src/index.ts`
159
+ - `src/plugin.ts`
160
+ - `src/definitions.ts`
161
+ - `src/web.ts`
162
+
163
+ **Purpose:** export surface, Capacitor plugin bindings, typings, and web fallback behavior.
164
+
165
+ ## Native Android Modules
166
+
167
+ | File | Role |
168
+ |------|------|
169
+ | `NativeUpdatePlugin.kt` | Main Android plugin entry |
170
+ | `LiveUpdatePlugin.kt` | OTA/live update Android implementation |
171
+ | `AppUpdatePlugin.kt` | App update Android integration |
172
+ | `AppReviewPlugin.kt` | In-app review Android integration |
173
+ | `BackgroundUpdatePlugin.kt` | Background update orchestration |
174
+ | `BackgroundUpdateManager.kt` | Background scheduling/management logic |
175
+ | `BackgroundUpdateWorker.kt` | Worker-based background task execution |
176
+ | `BackgroundNotificationManager.kt` | Notification support |
177
+ | `NotificationActionReceiver.kt` | Notification action handling |
178
+ | `SecurityManager.kt` | Android security helpers |
179
+
180
+ ## Native iOS Modules
181
+
182
+ | File | Role |
183
+ |------|------|
184
+ | `NativeUpdatePlugin.swift` | Main iOS plugin entry |
185
+ | `NativeUpdatePlugin.m` | Objective-C bridge/registration layer |
186
+ | `LiveUpdatePlugin.swift` | OTA/live update implementation |
187
+ | `WebViewConfiguration.swift` | web view config support for live updates |
188
+ | `AppUpdatePlugin.swift` | App update iOS behavior |
189
+ | `AppReviewPlugin.swift` | StoreKit review handling |
190
+ | `BackgroundUpdatePlugin.swift` | background update behavior |
191
+ | `BackgroundNotificationManager.swift` | notification support |
192
+ | `SecurityManager.swift` | iOS security helpers |
193
+
194
+ ## Frontend Services
195
+
196
+ ### `auth-service.ts`
197
+
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
203
+
204
+ ### `google-drive-service.ts`
205
+
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
216
+
217
+ ### `bundle-upload-service.ts`
218
+
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
226
+
227
+ ### `manifest-generator.ts`
228
+
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
234
+
235
+ ### Other Frontend Services
236
+
237
+ - `auth-service.ts`
238
+ - `bundle-upload-service.ts`
239
+ - `google-drive-service.ts`
240
+ - `manifest-generator.ts`
241
+ - capacitor service wrappers under `website/src/services/capacitor/`
242
+
243
+ ## Frontend State Stores
244
+
245
+ ### `appsStore`
246
+
247
+ - fetch user apps
248
+ - fetch app by ID
249
+ - create/update/delete app
250
+ - manage selected app and errors
251
+
252
+ ### `buildsStore`
253
+
254
+ - fetch builds per app/user/channel
255
+ - fetch build by ID
256
+ - fetch latest builds
257
+ - update build status
258
+ - delete builds
259
+
260
+ ### `rolloutsStore`
261
+
262
+ - fetch rollout state from manifests
263
+ - fetch rollout by app/channel
264
+ - update rollout config
265
+ - pause/resume/start rollout
266
+
267
+ ### `analyticsStore`
268
+
269
+ - fetch analytics batches
270
+ - aggregate downloads, installs, errors, rollbacks
271
+ - build platform/version summaries
272
+ - manage date range
273
+
274
+ ## Website Backend Reference (`website/functions`)
275
+
276
+ ### Main Areas
277
+
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`
287
+
288
+ **Purpose:** a Firebase Functions + Express reference backend retained in the repo.
289
+
290
+ ## Example Apps
291
+
292
+ ### `example-apps/react-capacitor/`
293
+
294
+ - frontend example demonstrating plugin use in a Capacitor app
295
+
296
+ ### `example-apps/node-express/`
297
+
298
+ - backend example using Node.js + Express
299
+
300
+ ### `example-apps/firebase-backend/`
301
+
302
+ - Firebase-based backend example
303
+
304
+ ## Testing Modules Present
305
+
306
+ ### TypeScript Tests
307
+
308
+ - bundle manager
309
+ - config
310
+ - delta processor
311
+ - firestore schema
312
+ - integration
313
+ - manifest reader
314
+ - rollout checker
315
+ - security
316
+ - version manager
317
+
318
+ ### iOS Tests
319
+
320
+ - app update tests
321
+ - app review tests
322
+ - background update tests
323
+ - live update tests
324
+ - security tests
325
+
326
+ ### Android Tests
327
+
328
+ - app review plugin tests
329
+ - app update plugin tests
330
+ - background notification manager tests
331
+ - background worker tests
332
+ - live update plugin tests
333
+ - security manager tests
334
+
335
+ ### E2E
336
+
337
+ - OTA update flow
338
+ - download progress
339
+ - channel switching
340
+ - error handling
341
+
342
+ ## Important Architectural Direction
343
+
344
+ - Treat the plugin as runtime infrastructure.
345
+ - 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.