How abhinavdatta/punarva works
PUNARVA is a browser-based battery diagnostics and firmware-tooling prototype. The main workflow runs from a routed Battery Check screen through pre-checks and timed sampling to a stored test record, then to reports, charts, comparison, and CSV export; readings can come from demo sampling or validated device transports. Other documented branches cover history/import, device settings, interactive technology views, and firmware compilation/flashing. Some page and service relationships rely on the README or SOURCE INDEX; unsampled details are not inferred.
Main entry points: App.tsx Route shell · testEngine.ts Test engine · ResultsReport.tsx Report and comparison · deviceStore.ts Device connection
Components 30
Diagnostics workflow
- Battery Check
src/pages/BatteryCheckPage.tsx - Test engine
src/state/testEngine.ts - Test state
src/state/testStore.ts - Demo sampler
src/services/demo/sampler.ts - Time-series charts
src/components/charts/TimeSeriesChart.tsx
Device and firmware
- Device connection
src/state/deviceStore.ts - Reading validation
src/services/validation.ts - Web Serial
src/services/device/transports.ts - WebSocket bridge
src/services/device/webSocketTransport.ts - Firmware flashing
src/pages/FlashPage.tsx - Flash state
src/state/flashStore.ts - ESP32 flasher
src/services/device/flasher.ts - Firmware compiler client
src/services/device/firmwareCompile.ts
Reports and history
- Test history
src/pages/HistoryPage.tsx - History state
src/state/historyStore.ts - Test report route
src/pages/ResultsPage.tsx - Report and comparison
src/components/results/ResultsReport.tsx - CSV export
src/services/csv/exportCsv.ts - CSV import
src/services/csv/importCsv.ts
Product experience
- Route shell
src/App.tsx - Overview dashboard
src/pages/OverviewPage.tsx - Technology view
src/pages/TechnologyPage.tsx - Settings
src/pages/SettingsPage.tsx - 3D product scene
src/components/three/BatteryTesterScene.tsx
Shared state and services
- Safe storage
src/services/storage/safeStorage.ts - Calibration service
src/services/calibration.ts - Calibration state
src/state/calibrationStore.ts
Other components
- User
- Browser device APIs
- Local compile bridge
Connections 39
- User → Route shell: opens
src/App.tsx - Route shell → Battery Check: routes to
src/App.tsx - Route shell → Test report route: routes to
src/App.tsx - Route shell → Test history: routes to
src/App.tsx - Route shell → Firmware flashing: routes to
src/App.tsx - Route shell → Overview dashboard: routes to
src/App.tsx - Route shell → Technology view: routes to
src/App.tsx - Route shell → Settings: routes to
src/App.tsx - Battery Check → Test engine: starts test
src/pages/BatteryCheckPage.tsx - Battery Check → Test state: reads state
src/pages/BatteryCheckPage.tsx - Test engine → Test state: updates phases
src/state/testEngine.ts - Test engine → Demo sampler: samples demo
src/state/testEngine.ts - Test engine → Device connection: reads readings
src/state/testEngine.ts - Test engine → History state: adds record
src/state/testEngine.ts - Device connection → Reading validation: validates payloads
src/state/deviceStore.ts - Device connection → Web Serial: connects transport
src/state/deviceStore.ts - Device connection → WebSocket bridge: connects transport
src/state/deviceStore.ts - Web Serial → Browser device APIs: uses serial API
README.md - WebSocket bridge → Browser device APIs: opens socket
README.md - Firmware flashing → Flash state: controls flashing
src/pages/FlashPage.tsx - Firmware flashing → Firmware compiler client: compiles source
src/pages/FlashPage.tsx - Flash state → ESP32 flasher: runs flasher
src/state/flashStore.ts - Firmware compiler client → Local compile bridge: requests compile
README.md - Test history → History state: shows records
README.md - Test history → CSV import: imports CSV
README.md - Test history → CSV export: exports CSV
README.md - History state → Safe storage: persists records
src/state/historyStore.ts - Test report route → Report and comparison: renders report
README.md - Report and comparison → CSV export: exports samples
src/components/results/ResultsReport.tsx - Report and comparison → Calibration service: compares baseline
src/components/results/ResultsReport.tsx - Report and comparison → Calibration state: reads reference
src/components/results/ResultsReport.tsx - Report and comparison → Time-series charts: renders response charts
src/components/results/ResultsReport.tsx - Calibration state → Calibration service: uses comparison logic
src/state/calibrationStore.ts - Calibration state → Safe storage: persists settings
src/state/calibrationStore.ts - History state → Safe storage: uses storage
src/state/historyStore.ts - Overview dashboard → 3D product scene: shows visualization
README.md - Overview dashboard → Time-series charts: shows live charts
README.md - Settings → Device connection: configures connection
src/pages/SettingsPage.tsx - Settings → Calibration state: configures calibration
src/pages/SettingsPage.tsx