1. How to use the app
This covers the complete user journey from first launch to daily reading.
The mobile app authenticates with phone verification and reads content from
Firestore/Storage.
Infographic: Reader Journey
Launch App
Intro slides + onboarding
→
Phone Sign-In
Enter phone, receive OTP, verify
→
Discover
Browse folders and searchable books
→
Open Book
PDF viewer loads from secure URL
→
Usage Tracked
Daily/monthly login + book opens
1.1 First-time setup and sign-in
- Install and launch the app. The first-time user intro appears.
- Complete or skip intro. On mobile, intro completion is stored locally.
- Enter phone in international format (example:
+233XXXXXXXXX).
- Request verification code and enter the 6-digit OTP.
- After successful auth, user lands on the Home shell with tabs: Home, Discover, Profile.
- On first authenticated entry each day/month, usage metrics are automatically updated.
If OTP never arrives, confirm SIM network, number format, and region restrictions in Firebase Auth settings.
1.2 Discovering folders and books
- Open the Discover tab to see folders and searchable book list.
- Use the search bar for title/folder filtering.
- Use folder chips (including “All”) to narrow content.
- Tap any book card to open book detail.
- Book detail page shows folder, metadata, and related titles.
Book visibility depends on available Firestore records in library_files.
If content is missing, check admin upload history.
1.3 Reading books (PDF flow)
- Tap Open Book from a book detail screen.
- The app opens Syncfusion PDF viewer using the stored file URL.
- If load succeeds, user reads/scrolls/zooms the PDF as needed.
- If load fails, the app displays error text from viewer callback.
- Each open action writes analytics (event + per-book counters + current reading state).
Reading analytics currently tracked:
open count, reader days, current book per user, daily and monthly login activity.
1.4 Profile and account behavior
- Profile screen shows user identity information from Firebase Auth.
- User can sign out at any time from the Profile screen.
- Next sign-in on a new day counts toward daily and monthly active usage.
If you must disable a user, use Admin Portal user controls and enforce access in Firestore/Storage rules.
1.5 Reader best-practice checklist
- Keep app updated to latest deployed build.
- Use reliable data/Wi-Fi for large PDF files.
- Avoid sharing OTP codes between personnel.
- Report missing/incorrect book metadata to admins with title and screenshot.
- Sign out on shared devices after reading.
2. How to use the admin portal
The admin portal is a Firebase Hosting web app for library operations:
folders, books, users, and usage analytics.
Infographic: Admin Operations Loop
Authenticate
Email/password admin sign-in
→
Create Structure
Define folders for catalog organization
→
Upload Content
PDF to Storage + metadata to Firestore
→
Manage Access
Users, roles, active/inactive state
→
Review Usage
DAU/MAU, top books, active readers
2.1 Access and security prerequisites
- Ensure Email/Password is enabled in Firebase Authentication.
- Create admin auth user in Firebase Authentication.
- Grant admin portal rights in Firestore
admins collection.
- Use secure Firestore/Storage rules that allow writes only for admins.
- Avoid sharing admin credentials; assign individual accounts per operator.
2.2 Overview section
- Shows total folders, books, and users loaded in real time.
- Quick action buttons jump to create folder/upload book/add user flows.
- Use this as a quick health check before any bulk operation.
2.3 Folder management workflow
- Create folders with operational names and meaningful descriptions.
- Edit names/descriptions when doctrine structure changes.
- Delete only empty folders. The portal blocks deletion if books are still linked.
- Use consistent naming conventions (e.g., Training, Doctrine, Signals).
2.4 Book management workflow
- Select target folder and upload PDF.
- Upload writes file bytes to Storage and metadata to
library_files.
- Edit title/folder metadata as needed without re-uploading binary file.
- Delete removes metadata and attempts to remove underlying storage object.
- Use search input to quickly locate any title/folder association.
Metadata quality checklist:
title accuracy, correct folder, clear file naming, and no duplicate variants unless intentional.
2.5 User management workflow
- Create/update users with phone number, GH number, role, and active state.
- Use GH number format consistently (example:
GH001, GH5288).
- Admin access sync depends on UID already present in the stored user record.
- Delete user records carefully. It does not automatically delete Authentication accounts.
2.6 Usage dashboard interpretation
- Daily Active Users: unique users logged in today.
- Monthly Active Users: unique users logged in during current month.
- Book Opens (30d): total open actions across all books in last 30 days.
- Users Currently Reading: last opened book per active user.
- Top Books: highest opened books, plus reader-day depth.
- Daily Trend: 14-day active user trend for command reporting.
2.7 Operational cadence (recommended)
- Daily: monitor failed uploads, user lockouts, and usage anomalies.
- Weekly: review top books and prune low-quality duplicates.
- Monthly: archive obsolete content and validate admin accounts.
- Quarterly: review security rules, password policies, and access logs.
2.8 Deployment and environment operations
- Run local checks and verify syntax before deploy.
- Deploy portal with
firebase deploy --only hosting.
- Validate login, uploads, and dashboard after deploy.
- Keep incident notes for each production change window.
3. Technical troubleshooting
Use this section as a practical runbook during incidents. Start with symptom isolation,
then validate environment, auth, data, and permissions in that order.
Infographic: Troubleshooting Decision Path
Step 1: Classify
Auth issue, data issue, upload issue, or render issue?
↓
Step 2: Scope
Single user, single role, or entire tenant/project?
↓
Step 3: Validate Config
Rules, auth providers, collection paths, storage bucket
↓
Step 4: Correct + Verify
Apply minimal fix, test, then monitor for regression
3.1 Rapid diagnosis matrix
| Symptom |
Likely Cause |
Action Plan |
| Admin cannot sign in |
Email/password disabled or invalid credentials |
Check Auth provider enablement, reset password, verify admin record |
| “No admin access” after successful sign-in |
Missing/incorrect admins doc |
Create/fix admins/{uid} or email-seeded admin mapping |
| Book upload fails |
Storage rules deny write, network timeout, invalid file |
Inspect console errors, verify rules, retry with small test PDF |
| Books visible in portal but not app |
App reads different project/env or invalid file URL |
Verify Firebase options in app build, inspect library_files record fields |
| Usage dashboard empty |
No tracked events yet or blocked writes |
Open a book from app, check usage collections, validate Firestore rules |
| PDF open fails on app |
Broken URL/token or unsupported PDF |
Test URL in browser, re-upload file, validate file integrity |
3.2 Authentication and user identity issues
- Verify Authentication provider settings in Firebase Console.
- Confirm affected account exists and is enabled.
- Check whether admin entitlement exists in
admins.
- For phone users, verify phone format and SMS delivery constraints.
- For repeated failures, gather exact error message and timestamp before changing configuration.
3.3 Firestore/Storage permission-denied errors
- Open browser developer console and capture failing request path.
- Match request path to relevant Firestore/Storage rule clause.
- Validate auth context (
request.auth.uid) and admin condition documents.
- Test with Emulator Suite if available before production rule change.
- Deploy smallest rule fix possible; avoid broad allow-all changes.
Security warning:
Never relax production rules globally just to bypass one failing operation.
Fix path- and role-specific conditions instead.
3.4 Data integrity and migration issues
- For RTDB-to-Firestore migration, run dry-run scripts first.
- Check GH number format consistency (
GH###).
- Re-run idempotent seeders to normalize records safely.
- Validate duplicate detection keys (phone + GH number, storagePath, or UID).
- Audit sample/legacy records separately from production records.
3.5 Performance troubleshooting
- High latency in dashboard: reduce query scope, add indexes where required.
- Slow file uploads: test network path and file size, then inspect Storage logs.
- Heavy client rendering: limit table rows and use narrower date windows.
- App PDF lag: verify file size and PDF optimization.
3.6 Incident report template (recommended)
- Incident ID and start time (UTC)
- Affected scope (users, region, role, feature)
- Observed errors with screenshots/log excerpts
- Root cause summary
- Actions taken and rollback details
- Post-incident prevention tasks