A little housekeeping for jedmund.com
Phase 1 Batch 5: Music Integration type safety improvements Fixed 19 any-type errors across 6 music integration files: 1. src/lib/utils/albumEnricher.ts (4 errors) - Created RecentTracksData interface - Fixed getAppleMusicDataForNowPlaying: return Album['appleMusicData'] | null - Fixed cacheRecentTracks: parameter RecentTracksData - Fixed getCachedRecentTracks: return RecentTracksData | null - Fixed getCachedRecentTracks: data typing 2. src/lib/utils/lastfmStreamManager.ts (4 errors) - Created RecentTracksResponse interface - Fixed fetchFreshRecentTracks: return RecentTracksResponse - Fixed getRecentAlbums: parameter RecentTracksResponse - Fixed updateNowPlayingStatus: parameter RecentTracksResponse - Fixed getNowPlayingUpdatesForNonRecentAlbums: parameter RecentTracksResponse 3. src/lib/utils/lastfmTransformers.ts (2 errors) - Created LastfmTrack interface - Fixed trackToAlbum: parameter LastfmTrack - Fixed mergeAppleMusicData: parameter Album['appleMusicData'] 4. src/lib/utils/nowPlayingDetector.ts (4 errors) - Created LastfmRecentTrack and RecentTracksResponse interfaces - Fixed processNowPlayingTracks: parameters with proper types - Fixed detectNowPlayingAlbums: parameters with proper types - Updated appleMusicDataLookup callback: return Album['appleMusicData'] | null 5. src/lib/utils/simpleNowPlayingDetector.ts (3 errors) - Created LastfmTrack interface - Fixed processAlbums: recentTracks parameter to LastfmTrack[] - Fixed appleMusicDataLookup callback: return Album['appleMusicData'] | null - Fixed mostRecentTrack variable type and date handling - Fixed trackData type in tracks.find() 6. src/lib/utils/simpleLastfmStreamManager.ts (2 errors) - Created RecentTracksResponse interface - Fixed getRecentAlbums: parameter RecentTracksResponse Progress: 32 any-type errors remaining (down from 51) |
||
|---|---|---|
| .storybook | ||
| docs | ||
| prd | ||
| prisma | ||
| scripts | ||
| src | ||
| static | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| .node-version | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| CLAUDE.md | ||
| eslint.config.js | ||
| LOCAL_SETUP.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| railpack-plan.json | ||
| README.md | ||
| svelte.config.js | ||
| SVG_ANALYSIS_REPORT.md | ||
| test-db.ts | ||
| test-form-loading.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
jedmund.com
Personal portfolio website built with SvelteKit featuring a content management system for showcasing creative work, writing, and personal interests.
Features
- Content management system for organizing and displaying various types of media
- Photo galleries with masonry layout and infinite scrolling
- Blog/journal section for long-form writing
- Music listening history integration via Last.fm API
- Gaming activity tracking from Steam and PlayStation
- Project showcase pages with detailed case studies
- Responsive design with customizable themes
Tech Stack
- SvelteKit with Svelte 5 (Runes mode)
- Redis for caching external API responses
- SCSS for styling
- Integration with Last.fm, Steam, PSN, iTunes, and Giant Bomb APIs
Development
Install dependencies:
npm install
Start development server:
npm run dev
Build for production:
npm run build
Environment Variables
Required environment variables:
LASTFM_API_KEY- Last.fm API key for music dataREDIS_URL- Redis connection URL for caching
Optional environment variables:
DEBUG- Enable debug logging for specific categories (e.g.,DEBUG=musicfor music-related logs)
Commands
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run check- Type check with svelte-checknpm run lint- Check formatting and lintingnpm run format- Auto-format code with prettier
Database Management
Quick Start
Sync remote production database to local development:
# This backs up both databases first, then copies remote to local
npm run db:backup:sync
Prerequisites
-
PostgreSQL client tools must be installed (
pg_dump,psql)# macOS brew install postgresql # Ubuntu/Debian sudo apt-get install postgresql-client -
Set environment variables in
.envor.env.local:# Required for local database operations DATABASE_URL="postgresql://user:password@localhost:5432/dbname" # Required for remote database operations (use one of these) REMOTE_DATABASE_URL="postgresql://user:password@remote-host:5432/dbname" DATABASE_URL_PRODUCTION="postgresql://user:password@remote-host:5432/dbname"
Backup Commands
# Backup local database
npm run db:backup:local
# Backup remote database
npm run db:backup:remote
# Sync remote to local (recommended for daily development)
npm run db:backup:sync
# List all backups
npm run db:backups
Restore Commands
# Restore a backup to local database (interactive)
npm run db:restore
# Restore specific backup to local
npm run db:restore ./backups/backup_file.sql.gz
# Restore to remote (requires typing "RESTORE REMOTE" for safety)
npm run db:restore ./backups/backup_file.sql.gz remote
Common Workflows
Daily Development
Start your day by syncing the production database to local:
npm run db:backup:sync
Before Deploying Schema Changes
Always backup the remote database:
npm run db:backup:remote
Recover from Mistakes
# See available backups
npm run db:backups
# Restore a specific backup
npm run db:restore ./backups/local_20240615_143022.sql.gz
Backup Storage
All backups are stored in ./backups/ with timestamps:
- Local:
local_YYYYMMDD_HHMMSS.sql.gz - Remote:
remote_YYYYMMDD_HHMMSS.sql.gz
Safety Features
- Automatic backups before sync operations
- Confirmation prompts for all destructive operations
- Extra protection for remote restore (requires typing full phrase)
- Compressed storage with gzip
- Timestamped filenames prevent overwrites
- Automatic migrations after local restore