diff --git a/CLAUDE.md b/CLAUDE.md index 7bcaa97..db43246 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -146,8 +146,10 @@ The award system is JSON-driven and located in `award-definitions/` directory. E 2. **`dok`**: Count unique DOK (DARC Ortsverband Kennung) combinations - `target`: Number required - `confirmationType`: "dcl" (DARC Community Logbook) + - `filters`: Optional filters (band, mode, etc.) for award variants - Counts unique (DOK, band, mode) combinations - Only DCL-confirmed QSOs count + - Example variants: DLD 80m, DLD CW, DLD 80m CW 3. **`points`**: Point-based awards - `stations`: Array of {callsign, points} @@ -202,6 +204,14 @@ The award system is JSON-driven and located in `award-definitions/` directory. E - `POST /api/dcl/sync`: Queue DCL sync job - `GET /api/jobs/:jobId`: Get job status - `GET /api/jobs/active`: Get active job for current user +- `GET /*`: Serves static files from `src/frontend/build/` with SPA fallback + +**SPA Routing**: The backend serves the SvelteKit frontend build from `src/frontend/build/`. +- Paths with file extensions (`.js`, `.css`, etc.) are served as static files +- Paths without extensions (e.g., `/qsos`, `/awards`) are served `index.html` for client-side routing +- Common missing files like `/favicon.ico` return 404 immediately +- If frontend build is missing entirely, returns a user-friendly 503 HTML page +- Prevents ugly Bun error pages when accessing client-side routes via curl or non-JS clients **DCL Service**: `src/backend/services/dcl.service.js` - `fetchQSOsFromDCL(dclApiKey, sinceDate)`: Fetch from DCL API @@ -277,6 +287,77 @@ To add a new award: 6. Update documentation in `docs/DOCUMENTATION.md` 7. Test with sample QSO data +### Creating DLD Award Variants + +The DOK award type supports filters to create award variants. Examples: + +**DLD on 80m** (`dld-80m.json`): +```json +{ + "id": "dld-80m", + "name": "DLD 80m", + "description": "Confirm 100 unique DOKs on 80m", + "caption": "Contact 100 different DOKs on the 80m band.", + "category": "darc", + "rules": { + "type": "dok", + "target": 100, + "confirmationType": "dcl", + "displayField": "darcDok", + "filters": { + "operator": "AND", + "filters": [ + { "field": "band", "operator": "eq", "value": "80m" } + ] + } + } +} +``` + +**DLD in CW mode** (`dld-cw.json`): +```json +{ + "rules": { + "type": "dok", + "target": 100, + "confirmationType": "dcl", + "filters": { + "operator": "AND", + "filters": [ + { "field": "mode", "operator": "eq", "value": "CW" } + ] + } + } +} +``` + +**DLD on 80m using CW** (combined filters, `dld-80m-cw.json`): +```json +{ + "rules": { + "type": "dok", + "target": 100, + "confirmationType": "dcl", + "filters": { + "operator": "AND", + "filters": [ + { "field": "band", "operator": "eq", "value": "80m" }, + { "field": "mode", "operator": "eq", "value": "CW" } + ] + } + } +} +``` + +**Available filter operators**: +- `eq`: equals +- `ne`: not equals +- `in`: in array +- `nin`: not in array +- `contains`: contains substring + +**Available filter fields**: Any QSO field (band, mode, callsign, grid, state, satName, etc.) + ### Confirmation Systems - **LoTW (Logbook of The World)**: ARRL's confirmation system @@ -316,11 +397,14 @@ Both LoTW and DCL return data in ADIF (Amateur Data Interchange Format): ### Recent Commits -- **Uncommitted**: fix: logger debug level not working - - Fixed bug where debug logs weren't showing due to falsy value handling - - Changed `||` to `??` in logger config to properly handle log level 0 (debug) - - Added `.env` file with `LOG_LEVEL=debug` for development - - Debug logs now show DCL API request parameters with redacted API key +- `7201446`: fix: return proper HTML for SPA routes instead of Bun error page + - When accessing client-side routes (like /qsos) via curl or non-JS clients, + the server attempted to open them as static files, causing Bun to throw + an unhandled ENOENT error that showed an ugly error page + - Now checks if a path has a file extension before attempting to serve it + - Paths without extensions are immediately served index.html for SPA routing + - Also improves the 503 error page with user-friendly HTML when frontend build is missing +- `223461f`: fix: enable debug logging and improve DCL sync observability - `27d2ef1`: fix: preserve DOK data when DCL doesn't send values - DCL sync only updates DOK/grid fields when DCL provides non-empty values - Prevents accidentally clearing DOK data from manual entry or other sources