Canmetry Community is a fully client-side CAN log analysis app built with React, TanStack Router, and browser-side parsers for BLF / ASC / CSV / MF4 plus DBC decoding.
The repository is organized around one core idea:
Load raw CAN logs and DBC files in the browser, build an in-memory analysis session, then expose the same session through three UI surfaces: Graph, Trace, and DBC.
User files
├─ CAN log (.blf / .asc / .csv / .log / .mf4)
└─ DBC files (.dbc)
↓
Browser file reads
↓
Format-specific parsers in src/lib/can/
↓
ClientAnalysisSession (single local workspace state)
├─ rawFrames
├─ decoded signal points
├─ DBC metadata
├─ channel ↔ DBC mapping
└─ saved workspace layout
↓
UI tabs
├─ Graph (decoded signals / chart workspace)
├─ Trace (raw frames / decoded row detail)
└─ DBC (DBC browser / bit layout / attributes)
src/router.tsx creates the TanStack Router instancesrc/routes/index.tsx is the main analysis screengraphtracedbcThis means all three views share the same loaded files and session state.
The main client-side state container is ClientAnalysisSession in src/modules/analyses/client-session.ts.
It owns:
ArrayBufferThe session is exposed to React through useSyncExternalStore, so the app can keep one mutable analysis workspace without adding a global client state library.
Location: src/lib/can/
Parsers are implemented in the browser and do not require a backend.
blf-reader.ts — Vector BLF readerasc-reader.ts — Vector ASC / .log readercsv-reader.ts — CSV readermf4-reader.ts — ASAM MDF4 readeriterate-log.ts — chooses parser by filename / extensionShared frame shape:
The parser stage is intentionally loss-light: it first turns every supported format into a common frame model before higher-level decoding happens.
Location: src/lib/can/client-decode.ts
Responsibilities:
Important behavior:
Location: src/lib/can/dbc-catalog.ts
This module builds a richer inspection model from DBC text for the DBC tab:
This is separate from the runtime decode index because the DBC tab needs browse-oriented structures, not just ID lookup.
Location:
src/lib/analysis-project.tssrc/lib/analysis-workspace-layout.tssrc/lib/analysis-workspace.tsProject export/import stores:
The exported file is .blfproject.json.
src/routes/index.tsx renders a shared top toolbar and one of three panes:
SignalViewer for GraphFrameViewer for TraceDbcViewer for DBCThe active tab is persisted into the layout snapshot so imported projects can reopen in the same view.
Main modules:
src/blocks/signal-viewer/index.tsxsrc/blocks/signal-workspace/use-signal-workspace.tssrc/blocks/signal-workspace/signal-chart.tsxsrc/blocks/signal-workspace/signal-table-panel.tsxThe Graph tab is a small workspace inside the app:
The chart implementation is custom rather than Recharts-driven, because the app needs:
Main modules:
src/blocks/frame-viewer/index.tsxsrc/blocks/frame-viewer/FrameTable.tsxsrc/blocks/frame-viewer/FrameDetailPanel.tsxsrc/blocks/frame-viewer/frame-filter.tssrc/blocks/frame-viewer/frame-bit-heatmap.tssrc/blocks/frame-viewer/frame-sparkline.tsTrace uses pre-extracted rawFrames from the session and layers on:
Main modules:
src/blocks/dbc-viewer/index.tsxsrc/blocks/dbc-viewer/message-list.tsxsrc/blocks/dbc-viewer/signal-table.tsxsrc/blocks/dbc-viewer/bit-matrix.tsxsrc/blocks/dbc-viewer/detail-panel.tsxsrc/blocks/dbc-viewer/bit-layout.tsThe DBC tab is independent from signal parsing in the sense that:
The layout is optimized for fast inspection:
ClientAnalysisSession.loadLog() validates size and formatextractRawFramesFromLog() scans frames into a common raw row model.dbc filesdecodeLogWithDbcs() iterates log frames againThe app is designed for static hosting.
pnpm devpnpm buildpnpm build:pagesNo server-side parsing, database, queue, or worker is required for the community edition.
| Path | Purpose |
|---|---|
src/routes/index.tsx |
Main page and Graph/Trace/DBC tab switching |
src/modules/analyses/client-session.ts |
Local analysis session state |
src/lib/can/client-decode.ts |
DBC decode pipeline, raw rows, parse results |
src/lib/can/iterate-log.ts |
Format detection and parser dispatch |
src/lib/analysis-project.ts |
Project export/import schema |
src/blocks/signal-workspace/ |
Graph workspace |
src/blocks/frame-viewer/ |
Trace UI |
src/blocks/dbc-viewer/ |
DBC browser UI |