Commit 13586d7
committed
refactor backend into modular packages and fix data pipeline bugs
Backend:
- Split monolithic database.go and handlers.go into focused modules
(aggregate_queries, flow_queries, maintenance, schema, models,
bandwidth_handlers, device_handlers, flow_handlers, stats_handlers, etc.)
- Add poll-time pre-aggregation (node pairs, bandwidth, traffic stats)
with atomic commit via CommitPollResults transaction
- Add rolling in-memory cache for sub-second recent data queries
- Add device cache with periodic refresh from Tailscale API
- Add rate limiting middleware with per-IP token bucket
- Chunked backfill: split large time ranges into 30-min chunks to
avoid API timeouts, with per-chunk progress commit
- Skip raw flow log insertion for historical data during backfill
to prevent database bloat (was causing 2GB+ growth)
- Run cleanup before initial poll to purge stale data on startup
- Fix timestamp skew in log_converter: prefer "start" over "logged"
- Fix rolling cache UniquePairs: use max() instead of replace
- Fix nil bandwidth slice serializing as JSON null instead of []
- Add proper 405 handling for method-not-allowed routes
- Add schema tests and handler tests
Frontend:
- Smart header stats: fall back to stats store when network data
unavailable (fixes zero stats on analytics page)
- BandwidthChart: abort stale fetch to prevent race condition
- FilterPanel: improved layout and responsiveness
- TimelineSlider: better touch/drag handling
- LogViewer/PortDetails: enhanced formatting and display
- Stats store: replace manual subscriptions with svelte get()
- Network store: refactored data flow and error handling
- Analytics page: improved chart layouts and interactions1 parent 6e0386f commit 13586d7
48 files changed
Lines changed: 5878 additions & 3630 deletions
File tree
- backend
- internal
- database
- handlers
- middleware
- services
- frontend/src
- lib
- components
- charts
- filters
- graph
- layout
- logs
- timeline
- services
- stores
- types
- utils
- routes
- analytics
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments