Commit Graph

827 Commits

Author SHA1 Message Date
pezkuwichain 841fcdbf54 feat: integrate Bereketli via iframe with Supabase token bridge
B2B button now opens Bereketli (bereketli.pezkiwi.app) embedded in an
iframe. PWAP exchanges the user's Supabase JWT for a Bereketli JWT
via the existing /v1/auth/exchange endpoint, then passes tokens to
the iframe via postMessage. User never sees a login screen.

- New /bereketli route (ProtectedRoute)
- Token caching in localStorage (10 min TTL)
- Camera + geolocation permissions on iframe
- Desktop and mobile layouts supported
- Re-auth on token expiry via postMessage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 02:23:27 +03:00
pezkuwichain d475861dd6 fix: i18n all hard-coded strings in mobile layout
Section titles (FINANCE, GOVERNANCE, SOCIAL, EDUCATION) and all app
names are now translated via i18n keys instead of hard-coded English.
Added translations for all 6 languages (en, tr, kmr, ckb, ar, fa).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 00:56:00 +03:00
pezkuwichain 50a17d6453 ci: decouple deploy from mobile app, web-only pipeline
Mobile app is distributed via Play Store DApps browser, no longer
built/deployed from this repo. Deploy and security audit now only
depend on the web job passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:54:46 +03:00
pezkuwichain 8bae697885 fix: remove unused variables in Identity.tsx to pass linter
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:51:29 +03:00
pezkuwichain 31d6e99573 Merge branch 'main' of https://github.com/pezkuwichain/pwap
# Conflicts:
#	mobile/check_existing_tables.cjs
#	mobile/src/lib/supabase.ts
#	web/src/i18n/locales/ar.ts
#	web/src/i18n/locales/ckb.ts
#	web/src/i18n/locales/en.ts
#	web/src/i18n/locales/fa.ts
#	web/src/i18n/locales/kmr.ts
#	web/src/i18n/locales/tr.ts
2026-04-07 23:46:01 +03:00
pezkuwichain e39a1f192a feat: add mobile layout with native app UX, identity page with ID card & passport
Mobile users (<768px) now see a native app-style home page with:
- Green gradient header with avatar, greeting, language/wallet/notification
- Horizontal scrollable score cards (auth-aware: login prompt for guests)
- App grid sections (Finance, Governance, Social, Education) with 4-col layout
- Bottom tab bar (Home / Citizen / Referral)
- MobileShell wrapper for consistent mobile navigation across pages

BeCitizen page redesigned for mobile with full-viewport hero screen,
scroll-to-reveal content, and compact benefits/process cards.

New Identity page (/identity) with realistic Kurdistan Republic ID card
and passport design. Users can fill personal info, upload photo from
camera/gallery, and save to device (localStorage only).

Desktop layout completely untouched. i18n keys added for all 6 languages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:39:21 +03:00
pezkuwichain ea8958f8bc feat: hide chain spec cards on mobile, keep mainnet details visible
Mobile users only see the Mainnet detail card (WebSocket endpoint,
Chain ID, explorer button, services grid). The individual chain
cards (Staging, Testnet, Beta, etc.) and subdomains box are hidden
on mobile and visible on md+ screens.
2026-03-15 05:43:12 +03:00
pezkuwichain 5f104fed31 feat: hide chain spec cards on mobile, keep mainnet details visible
Mobile users only see the Mainnet detail card (WebSocket endpoint,
Chain ID, explorer button, services grid). The individual chain
cards (Staging, Testnet, Beta, etc.) and subdomains box are hidden
on mobile and visible on md+ screens.
2026-03-15 05:43:12 +03:00
pezkuwichain c91d7f5d57 feat: hide Google sign-in in embedded WebView (DApps browser)
Google blocks OAuth in WebViews (disallowed_useragent policy).
Detect WebView and hide the Google button, users in DApps browser
use email/password instead. Google sign-in still works in real
browsers (Chrome, Safari, etc).
2026-03-15 05:30:17 +03:00
pezkuwichain 97c77c5c71 feat: hide Google sign-in in embedded WebView (DApps browser)
Google blocks OAuth in WebViews (disallowed_useragent policy).
Detect WebView and hide the Google button, users in DApps browser
use email/password instead. Google sign-in still works in real
browsers (Chrome, Safari, etc).
2026-03-15 05:30:17 +03:00
pezkuwichain 918ce406e0 feat: add Google OAuth sign-in button to login page
Users can now sign in with their Google account via Supabase OAuth.
Google button appears above wallet connect in the "Or continue with" section.
2026-03-15 05:16:12 +03:00
pezkuwichain c439c7cf44 feat: add Google OAuth sign-in button to login page
Users can now sign in with their Google account via Supabase OAuth.
Google button appears above wallet connect in the "Or continue with" section.
2026-03-15 05:16:12 +03:00
pezkuwichain 2bd277501d feat: mobile layout - hide Learn More button, show Mainnet card after hero
Mobile users now see ChainSpecs (Mainnet card) right below the hero
section instead of scrolling far down. "Learn More" button hidden on
mobile since Mainnet card replaces its function.
2026-03-15 04:50:31 +03:00
pezkuwichain d6cfa855c0 feat: mobile layout - hide Learn More button, show Mainnet card after hero
Mobile users now see ChainSpecs (Mainnet card) right below the hero
section instead of scrolling far down. "Learn More" button hidden on
mobile since Mainnet card replaces its function.
2026-03-15 04:50:31 +03:00
pezkuwichain cb9cd6a410 fix: refresh inbox after key unlock + query previous era for message visibility
- Call refreshInbox() immediately after setupKey/unlockKey so messages
  decrypt instantly instead of waiting for 12s polling interval
- Query both current and previous era to prevent message loss at era
  boundaries
- Add toJSON fallback for robust field parsing in getInbox
- Improve debug logging with era, address, and field diagnostics
2026-03-04 16:03:21 +03:00
pezkuwichain 8d4c51f847 fix: refresh inbox after key unlock + query previous era for message visibility
- Call refreshInbox() immediately after setupKey/unlockKey so messages
  decrypt instantly instead of waiting for 12s polling interval
- Query both current and previous era to prevent message loss at era
  boundaries
- Add toJSON fallback for robust field parsing in getInbox
- Improve debug logging with era, address, and field diagnostics
2026-03-04 16:03:21 +03:00
pezkuwichain 3ad5a627b3 debug: show first bytes of each field for hex comparison 2026-03-04 04:53:42 +03:00
pezkuwichain 146e3b7127 debug: show first bytes of each field for hex comparison 2026-03-04 04:53:42 +03:00
pezkuwichain f328270b5e fix: verify derived key matches on-chain key during unlock 2026-03-04 04:37:07 +03:00
pezkuwichain ce1391666c fix: verify derived key matches on-chain key during unlock 2026-03-04 04:37:07 +03:00
pezkuwichain e8007de9f4 debug: show field lengths and try multiple field name patterns 2026-03-04 04:23:30 +03:00
pezkuwichain 3ba1ac31b8 debug: show field lengths and try multiple field name patterns 2026-03-04 04:23:30 +03:00
pezkuwichain 84df75ee5b fix: add eslint-disable for debug log 2026-03-04 03:59:36 +03:00
pezkuwichain 12618885a0 fix: add eslint-disable for debug log 2026-03-04 03:59:36 +03:00
pezkuwichain 752ed43ea6 debug: show decrypt errors on screen for troubleshooting 2026-03-04 03:57:23 +03:00
pezkuwichain 1412d9b1d5 debug: show decrypt errors on screen for troubleshooting 2026-03-04 03:57:23 +03:00
pezkuwichain 3854a8a10a fix(web): use separate args for StorageDoubleMap inbox/sendCount queries
messaging.inbox and messaging.sendCount are StorageDoubleMaps keyed by
(era, address). Passing [era, address] as a single array produced empty
results; split into two arguments so the API constructs the correct
storage key.
2026-03-04 03:32:41 +03:00
pezkuwichain 1f51f08c06 fix(web): use separate args for StorageDoubleMap inbox/sendCount queries
messaging.inbox and messaging.sendCount are StorageDoubleMaps keyed by
(era, address). Passing [era, address] as a single array produced empty
results; split into two arguments so the API constructs the correct
storage key.
2026-03-04 03:32:41 +03:00
pezkuwichain 7ff8ae4462 fix(web): guard messaging against missing pallet + add back-to-home
- Check isPalletAvailable() BEFORE requesting wallet signature
- All chain queries return safe defaults if pallet not in runtime
- Show orange banner when messaging pallet needs runtime upgrade
- Add floating back-to-home button on messaging page
2026-03-03 08:40:41 +03:00
pezkuwichain 568fd069cf fix(web): guard messaging against missing pallet + add back-to-home
- Check isPalletAvailable() BEFORE requesting wallet signature
- All chain queries return safe defaults if pallet not in runtime
- Show orange banner when messaging pallet needs runtime upgrade
- Add floating back-to-home button on messaging page
2026-03-03 08:40:41 +03:00
pezkuwichain ad3c0e414e feat(web): add PEZMessage on-chain E2E encrypted messaging UI
- x25519 ECDH + XChaCha20-Poly1305 encryption via @noble libs
- Key derivation from wallet signRaw, private key held in memory only
- Messaging pallet integration (registerEncryptionKey, sendMessage, inbox)
- Inbox polling every 12s, auto-decrypt when key unlocked
- ComposeDialog with recipient key validation and 512-byte limit
- Settings moved from grid to nav bar gear icon, PEZMessage takes its slot
- i18n translations for all 6 languages (en, tr, kmr, ckb, ar, fa)
2026-03-03 08:29:16 +03:00
pezkuwichain a9cb2972b9 feat(web): add PEZMessage on-chain E2E encrypted messaging UI
- x25519 ECDH + XChaCha20-Poly1305 encryption via @noble libs
- Key derivation from wallet signRaw, private key held in memory only
- Messaging pallet integration (registerEncryptionKey, sendMessage, inbox)
- Inbox polling every 12s, auto-decrypt when key unlocked
- ComposeDialog with recipient key validation and 512-byte limit
- Settings moved from grid to nav bar gear icon, PEZMessage takes its slot
- i18n translations for all 6 languages (en, tr, kmr, ckb, ar, fa)
2026-03-03 08:29:16 +03:00
pezkuwichain 6aae238f05 test: update dashboard snapshot for March 2026 2026-03-01 22:23:47 +03:00
pezkuwichain 86433a88ff test: update dashboard snapshot for March 2026 2026-03-01 22:23:47 +03:00
pezkuwichain 626fc5166c fix: correct KycLevel enum map and restrict founder bypass
1. Fixed enum map missing NotStarted at index 0, causing all status
   indices to be off by one (ReferrerApproved decoded as PendingReferral)
2. Restricted founder bypass to only show applications with no referrer,
   not all applications regardless of referrer
2026-03-01 22:08:40 +03:00
pezkuwichain e3beba7538 fix: correct KycLevel enum map and restrict founder bypass
1. Fixed enum map missing NotStarted at index 0, causing all status
   indices to be off by one (ReferrerApproved decoded as PendingReferral)
2. Restricted founder bypass to only show applications with no referrer,
   not all applications regardless of referrer
2026-03-01 22:08:40 +03:00
pezkuwichain 1f561afde7 fix: update referral share text with localized invitation message
Share text now includes friendly invitation + wallet address for
manual paste. Hardcoded English text replaced with i18n keys.
2026-02-28 02:35:25 +03:00
pezkuwichain 419e75f38e fix: update referral share text with localized invitation message
Share text now includes friendly invitation + wallet address for
manual paste. Hardcoded English text replaced with i18n keys.
2026-02-28 02:35:25 +03:00
pezkuwichain 5bdc80e3ed fix: use dynamic SS58 prefix in referral/KYC address encoding
Replace hardcoded SS58 prefix 42 with api.registry.chainSS58 ?? 42
for robustness in getPendingApprovalsForReferrer, getReferralInfo,
and getMyReferrals functions.
2026-02-28 01:59:04 +03:00
pezkuwichain a8505a4d50 fix: use dynamic SS58 prefix in referral/KYC address encoding
Replace hardcoded SS58 prefix 42 with api.registry.chainSS58 ?? 42
for robustness in getPendingApprovalsForReferrer, getReferralInfo,
and getMyReferrals functions.
2026-02-28 01:59:04 +03:00
pezkuwichain 99bc85f42e fix: handle all kycStatus formats in pending approvals check
toJSON() for Substrate enums can return string, object ({"approved":null}),
or number (enum index). Previous code assumed string only, causing already
approved applications to appear as pending.
2026-02-27 04:14:35 +03:00
pezkuwichain fd57a75fd9 fix: handle all kycStatus formats in pending approvals check
toJSON() for Substrate enums can return string, object ({"approved":null}),
or number (enum index). Previous code assumed string only, causing already
approved applications to appear as pending.
2026-02-27 04:14:35 +03:00
pezkuwichain 7a1d4d00e0 fix: convert hex AccountId to SS58 in referral/KYC queries
toJSON() returns hex format for AccountId fields but comparison was
against SS58 addresses, causing referrer matching to always fail.
- citizenship-workflow: encodeAddress for referrer in getPendingApprovals
- citizenship-workflow: handle both PascalCase and camelCase KycStatus
- referral: encodeAddress for referrer in getMyReferrals and getReferralInfo
2026-02-27 03:57:36 +03:00
pezkuwichain abdb67f6ca fix: convert hex AccountId to SS58 in referral/KYC queries
toJSON() returns hex format for AccountId fields but comparison was
against SS58 addresses, causing referrer matching to always fail.
- citizenship-workflow: encodeAddress for referrer in getPendingApprovals
- citizenship-workflow: handle both PascalCase and camelCase KycStatus
- referral: encodeAddress for referrer in getMyReferrals and getReferralInfo
2026-02-27 03:57:36 +03:00
pezkuwichain a77840838f fix: wait 12s before auto-verify to allow block inclusion
TX was not yet included in a block when verify fired immediately
after signing, causing first attempt to always fail. Block time on
Asset Hub is ~12s, so delay the verify call accordingly.
2026-02-26 15:55:49 +03:00
pezkuwichain c64c4bf00f fix: wait 12s before auto-verify to allow block inclusion
TX was not yet included in a block when verify fired immediately
after signing, causing first attempt to always fail. Block time on
Asset Hub is ~12s, so delay the verify call accordingly.
2026-02-26 15:55:49 +03:00
pezkuwichain f55a522eba fix: auto-verify deposit after TX sign, remove manual verify step
The manual "Verify Deposit" step required users to click a button after
signing. Hash was already captured automatically, making the manual step
redundant and risky (modal close = hash lost). Now verification starts
immediately after TX is signed, with spinner UI and retry on failure.
2026-02-26 15:30:30 +03:00
pezkuwichain aa7cc78de8 fix: auto-verify deposit after TX sign, remove manual verify step
The manual "Verify Deposit" step required users to click a button after
signing. Hash was already captured automatically, making the manual step
redundant and risky (modal close = hash lost). Now verification starts
immediately after TX is signed, with spinner UI and retry on failure.
2026-02-26 15:30:30 +03:00
pezkuwichain 768d637fdc fix: improve CitizensIssues mobile UI — two-line tab labels, responsive header 2026-02-25 05:58:58 +03:00
pezkuwichain 3e310fb980 fix: improve CitizensIssues mobile UI — two-line tab labels, responsive header 2026-02-25 05:58:58 +03:00