How vriensy/tnt works
This is an offline-capable PAT testing asset-register PWA. A tester sets job and customer/site context, enters a tag and inspection results, saves assets, reviews or edits the register, and exports or backs up records. The architecture also includes compliance calculations, customer/site/location management, and service-worker installation and update handling. The README is empty; major capabilities are identified from the source index and excerpts, so unsampled internals and relationships are omitted where evidence is insufficient.
Main entry points: App.tsx App coordinator · db.ts Local database · TagEntryForm.tsx Tag entry · SettingsDrawer.tsx Settings and backup
Components 19
Testing workflow
- App coordinator
src/App.tsx - Job context
src/components/JobHeader.tsx - Entity picker
src/components/EntityPicker.tsx - Tag entry
src/components/TagEntryForm.tsx - Compliance rules
src/compliance.ts - Asset register
src/components/AssetRegister.tsx
Records and persistence
- Customer manager
src/components/CustomerManager.tsx - Customer state
src/hooks/useCustomers.ts - Site state
src/hooks/useSites.ts - Location state
src/hooks/useLocations.ts - Job state
src/hooks/useJobInfo.ts - Asset state
src/hooks/useAssets.ts - Local database
src/db.ts
Data operations
- Settings and backup
src/components/SettingsDrawer.tsx - Export formatter
src/csvExport.ts
PWA lifecycle
- Service worker state
src/hooks/useServiceWorker.ts - Update banner
src/components/UpdateBanner.tsx - Service worker
public/sw.js
Other components
- Tester
Connections 29
- Tester → App coordinator: uses
src/App.tsx - App coordinator → Job context: renders
src/App.tsx - App coordinator → Tag entry: renders
src/App.tsx - App coordinator → Asset register: renders
src/App.tsx - App coordinator → Settings and backup: renders
src/App.tsx - App coordinator → Update banner: renders
src/App.tsx - App coordinator → Asset state: uses
src/App.tsx - App coordinator → Customer state: uses
src/App.tsx - App coordinator → Site state: uses
src/App.tsx - App coordinator → Location state: uses
src/App.tsx - App coordinator → Job state: uses
src/App.tsx - App coordinator → Service worker state: uses
src/App.tsx - Job context → Entity picker: renders
src/components/JobHeader.tsx - Tag entry → Entity picker: renders
src/components/TagEntryForm.tsx - Tag entry → Compliance rules: calculates with
src/components/TagEntryForm.tsx - Tag entry → Local database: checks tag
src/components/TagEntryForm.tsx - App coordinator → Local database: exports backup data
src/App.tsx - Asset register → App coordinator: edit and delete
src/App.tsx - Customer manager → Site state: uses
src/components/CustomerManager.tsx - Customer manager → Location state: uses
src/components/CustomerManager.tsx - Asset state → Local database: reads and writes
src/hooks/useAssets.ts - Customer state → Local database: reads and writes
src/hooks/useCustomers.ts - Site state → Local database: reads and writes
src/hooks/useSites.ts - Location state → Local database: reads and writes
src/hooks/useLocations.ts - Job state → Local database: loads and saves
src/hooks/useJobInfo.ts - Settings and backup → Local database: backs up and restores
src/components/SettingsDrawer.tsx - Settings and backup → Export formatter: downloads CSV
src/components/SettingsDrawer.tsx - Settings and backup → Service worker state: checks updates
src/components/SettingsDrawer.tsx - Service worker state → Service worker: registers and updates
src/hooks/useServiceWorker.ts