Add structured logging, navigation bar, and code cleanup

## Backend
- Add Pino logging framework with timestamps and structured output
- Replace all console.error statements (49+) with proper logging levels
- Fix Drizzle ORM bug: replace invalid .get() calls with .limit(1)
- Remove unused auth routes file (already in index.js)
- Make internal functions private (remove unnecessary exports)
- Simplify code by removing excessive debug logging

## Frontend
- Add navigation bar to layout with:
  - User's callsign display
  - Navigation links (Dashboard, QSOs, Settings)
  - Logout button with red color distinction
- Navigation only shows when user is logged in
- Dark themed design matching footer

## Documentation
- Update README.md with new project structure
- Update docs/DOCUMENTATION.md with logging and nav bar info
- Add logger.js to configuration section

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-16 08:11:57 +01:00
parent 512f4f682e
commit d959235cdd
13 changed files with 388 additions and 683 deletions

View File

@@ -24,6 +24,7 @@ The Ham Radio Award Portal is a full-stack web application designed to help amat
- **ORM**: Drizzle ORM - Type-safe database queries
- **Authentication**: JWT tokens via `@elysiajs/jwt`
- **Password Hashing**: bcrypt
- **Logging**: Pino - Structured logging with timestamps and log levels
**Frontend:**
- **Framework**: SvelteKit - Modern reactive framework
@@ -118,7 +119,8 @@ Defines the database structure using Drizzle ORM schema builder.
#### 4. Configuration (`src/backend/config/`)
- **database.js**: Database connection and client initialization
- **constants.js**: Application constants (JWT expiration, etc.)
- **jwt.js**: JWT secret configuration
- **logger.js**: Pino logger configuration with structured logging and timestamps
### Frontend Components
@@ -130,7 +132,14 @@ Defines the database structure using Drizzle ORM schema builder.
- **`/qsos`**: QSO logbook with filtering and LoTW sync
- **`/settings`**: LoTW credentials management
#### 2. Libraries
#### 2. Layout (`+layout.svelte`)
Global layout component providing:
- **Navigation bar**: Shows user's callsign, navigation links (Dashboard, QSOs, Settings), and logout button
- Only visible when user is logged in
- Responsive design with dark theme matching footer
#### 3. Libraries
**API Client** (`src/frontend/src/lib/api.js`)
- Centralized API communication
@@ -172,13 +181,15 @@ award/
├── src/
│ ├── backend/ # Backend server code
│ │ ├── config/
│ │ │ ├── constants.js
│ │ │ ── database.js
│ │ │ ├── database.js # Database connection
│ │ │ ── jwt.js # JWT configuration
│ │ │ └── logger.js # Pino logging configuration
│ │ ├── db/
│ │ │ └── schema/
│ │ │ └── index.js # Drizzle schema definitions
│ │ ├── services/
│ │ │ ├── auth.service.js
│ │ │ ├── job-queue.service.js
│ │ │ └── lotw.service.js
│ │ └── index.js # Main server entry point
│ │