How domiz918/totp_decoder works
This is a browser-only TOTP QR decoder. Users drop or paste an image, OTP Auth link, migration export, or raw Base32 secret; decoding produces one or more accounts, live OTP codes, re-encodable URLs/QRs, and copyable values. The graph preserves the documented input, migration, code-generation, display, clipboard, localization, and visual-background capabilities. Sampled source supports the main call paths; optional browser/runtime integrations are shown only where documented.
Main entry points: App.tsx App orchestration · QRDecoder.ts QR decoder · MigrationParser.ts Migration parser · useClipboard.ts Clipboard hook
Components 23
Input handling
- File uploader
web/src/components/FileUploader.tsx - Clipboard hook
web/src/hooks/useClipboard.ts
Decode and parse
- Decode state
web/src/hooks/useQRDecoder.ts - QR decoder
web/src/core/QRDecoder.ts - Image loading
web/src/services/ImageService.ts - QR recognition
web/src/services/QRService.ts - Standard parser
web/src/parsers/StandardParser.ts - Migration parser
web/src/parsers/MigrationParser.ts - Migration payload
web/src/otpMigration.ts
OTP generation
- TOTP and URL service
web/src/services/TOTPService.ts - Live code timer
web/src/hooks/useTimer.ts
Results interface
- App orchestration
web/src/App.tsx - Results list
web/src/components/ResultsList.tsx - Account and QR card
web/src/components/AccountCard.tsx - Decode status
web/src/components/StatusMessage.tsx - Animated background
web/src/components/DotWave.tsx
Browser utilities
- Clipboard service
web/src/services/ClipboardService.ts - Base32 conversion
web/src/utils/base32.ts - Localization hook
web/src/hooks/useI18n.ts - Localization setup
web/src/i18n/index.ts
Other components
- User
- Vercel Analytics
- Network services
Connections 26
- User → File uploader: drops files
README.md - User → Clipboard hook: pastes input
README.md - File uploader → App orchestration: uploads file
web/src/App.tsx - Clipboard hook → Clipboard service: uses
web/src/hooks/useClipboard.ts - Clipboard hook → App orchestration: submits text
web/src/App.tsx - App orchestration → Decode state: requests decode
web/src/App.tsx - Decode state → QR decoder: invokes
web/src/hooks/useQRDecoder.ts - QR decoder → Image loading: loads image
web/src/core/QRDecoder.ts - QR decoder → QR recognition: decodes QR
web/src/core/QRDecoder.ts - QR decoder → Standard parser: parses standard
web/src/core/QRDecoder.ts - QR decoder → Migration parser: parses migration
web/src/core/QRDecoder.ts - QR decoder → TOTP and URL service: creates raw-secret URL
web/src/core/QRDecoder.ts - Migration parser → Migration payload: decodes payload
web/src/parsers/MigrationParser.ts - Migration parser → Base32 conversion: converts secret
web/src/parsers/MigrationParser.ts - Standard parser → TOTP and URL service: generates code
web/src/parsers/StandardParser.ts - Migration parser → TOTP and URL service: generates code and URL
web/src/parsers/MigrationParser.ts - App orchestration → Live code timer: starts timers
web/src/App.tsx - Live code timer → TOTP and URL service: refreshes codes
web/src/hooks/useTimer.ts - App orchestration → Results list: renders results
web/src/App.tsx - App orchestration → Decode status: renders status
web/src/App.tsx - Results list → Account and QR card: renders accounts
web/src/components/ResultsList.tsx - Account and QR card → Clipboard hook: copies values
- App orchestration → Animated background: mounts background
web/src/main.tsx - Localization hook → Localization setup: uses translations
- App orchestration → Vercel Analytics: renders analytics
web/src/App.tsx - Vercel Analytics → Network services: may send telemetry