Skip to content

[FE-20] Add PWA support and in-app camera QR scanning for mobile field work #1108

Description

@yusuftomilola

Overview

Field work (audits, check-in/out, lookups) happens on phones next to physical equipment. Competitors ship native apps; a PWA with camera QR scanning covers most of that value at a fraction of the cost.

What to Build

  1. PWA: web manifest (name, icons, theme), installability, service worker with sensible caching (app shell cached; API network-first) — Next.js 15 conventions
  2. Camera scanning: a scan button (topbar on mobile + check-in/out and audit pages) opening a camera view using BarcodeDetector where available with a JS fallback library; decoded asset QR navigates to /scan/[assetId] ([FE-14])
  3. Mobile polish on core flows: assets list, asset detail, check-in/out usable at 375px width

Conventions to Follow

  • API calls: add a typed client in frontend/lib/api/ (see frontend/lib/api/assets.ts for the pattern) — never call axios directly from components
  • Data fetching: TanStack Query hooks in frontend/lib/query/hooks/ with keys registered in frontend/lib/query/keys.ts
  • UI: reuse frontend/components/ui/ (button, input, confirm-dialog, toast) and the badge/modal patterns in frontend/components/assets/
  • Route goes under frontend/app/(dashboard)/ and gets a sidebar entry in frontend/components/layout/sidebar.tsx
  • Forms: React Hook Form + Zod resolver, matching the existing create-asset modal

References

  • Blocked by [FE-14]; pairs with existing open issue [BE-69] (QR generation)
  • Note: 19b5baa (mobile drawer nav) existed pre-reset — reuse ideas via git show 19b5baa

Acceptance Criteria

  • App installable on Android/iOS with correct icon and name
  • Scanning a printed asset QR with the in-app camera opens the right asset
  • Camera permission denial handled gracefully with manual-entry fallback
  • Core flows fully usable on a phone-sized viewport

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions