This implementation adds DMR user information enrichment to the dmr-nexus dashboard by:
- Periodically syncing the RadioID.net user database
- Storing user information (callsign, name, location) in SQLite
- Enriching the dashboard UI with clickable links and detailed information
- DMRUser (
pkg/database/models.go):- Stores radio ID, callsign, first/last name, city, state, country
- Helper methods for
FullName()andLocation()formatting
- DMRUserRepository (
pkg/database/dmruser_repository.go):- CRUD operations for DMR users
- Efficient batch upsert for syncing large datasets
- Query by radio ID or callsign
- Syncer (
pkg/radioid/syncer.go):- Downloads CSV from https://radioid.net/static/user.csv
- Parses CSV and stores in database
- Runs on startup and every 24 hours
- Handles errors gracefully
-
User Lookup Endpoint (
/api/user/:radio_id):- Returns user information for a specific radio ID
- Used for on-demand lookups
-
Enhanced DTOs:
TransmissionDTOnow includescallsignfieldDynamicBridgeDTOincludes active user info (callsign, name, location)
- Main application (
cmd/dmr-nexus/main.go):- Initializes user repository
- Starts RadioID syncer in background
- Wires user repository to web API
Enhanced bridge cards to display detailed information when someone is actively transmitting:
- Radio ID: Clickable link to RadioID.net
- Callsign: Clickable link to QRZ.com
- Name: First and last name of the operator
- Location: City, State, Country formatted
Added new column and clickable links:
- Callsign Column: New column showing operator callsign
- Radio ID Links: Click to view on RadioID.net
- Callsign Links: Click to view on QRZ.com
Comprehensive test coverage includes:
-
DMRUser Model Tests (
pkg/database/dmruser_test.go):TestDMRUser_FullName: Tests name formattingTestDMRUser_Location: Tests location formattingTestDMRUserRepository_Upsert: Tests create/updateTestDMRUserRepository_GetByCallsign: Tests callsign lookupTestDMRUserRepository_Count: Tests counting recordsTestDMRUserRepository_UpsertBatch: Tests batch operations
-
RadioID Syncer Tests (
pkg/radioid/syncer_test.go):TestSyncer_parseCSV: Tests CSV parsingTestSyncer_parseCSV_InvalidData: Tests error handlingTestNewSyncer: Tests syncer creationTestSyncer_Start_Cancellation: Tests graceful shutdown
All existing tests continue to pass, confirming no breaking changes.
-
RadioID.net Database: https://radioid.net/static/user.csv
- CSV format with DMR user database
- Periodically synced every 24 hours
-
RadioID.net Lookup: https://radioid.net/database/view?id={radio_id}
- View detailed information for a specific radio ID
-
QRZ.com Lookup: https://www.qrz.com/db/{callsign}
- View ham radio callsign information
-
Database Efficiency:
- Batch upserts in groups of 1000 records
- Indexed on radio_id (primary key) and callsign
- Typical database size: ~170,000 users
-
API Performance:
- User lookups use indexed queries
- Optional enrichment (only when data available)
- No blocking operations in request path
-
Sync Performance:
- Non-blocking background sync
- Generous timeout (5 minutes) for large file
- Graceful error handling
- No credentials required for RadioID.net CSV
- External links open in new tab with
rel="noopener noreferrer" - No SQL injection risks (using GORM ORM)
- CodeQL scan passed with 0 alerts
Possible future improvements:
- Add caching layer for frequent lookups
- Support incremental updates instead of full sync
- Add user search/filter functionality
- Display statistics about database (last sync time, user count)
- Add UI indicator for database sync status