soroban-abacus-flashcards/apps/web/drizzle
Thomas Hallock 7b4c7c3fb6 feat: add worksheet sharing infrastructure with database persistence
Add complete sharing system for worksheet configurations:

Database Schema:
- New worksheet_shares table with short share IDs (7-char base62)
- Stores worksheetType, config JSON, views, creator IP hash, optional title
- Migration 0021 creates the table

Share ID Generation:
- Cryptographically secure base62 IDs (3.5 trillion combinations)
- Collision detection with retry logic (max 5 attempts)
- Validation function for ID format checking

API Endpoints:
- POST /api/worksheets/share - Creates share, returns URL
- GET /api/worksheets/share/[id] - Retrieves config, increments views
- Uses serializeAdditionConfig() for consistent config formatting

Share Modal:
- Auto-generates share link on open (no button needed)
- Displays QR code for mobile sharing (theme-aware colors)
- Copy to clipboard functionality with visual feedback
- Loading states during generation

Dependencies:
- Added qrcode + @types/qrcode for QR code generation

Config Serialization:
- Share uses same serializeAdditionConfig() as database auto-save
- Ensures version field and structure consistency
- Shared configs match database-saved settings exactly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 11:17:44 -06:00
..
meta feat: add worksheet sharing infrastructure with database persistence 2025-11-11 11:17:44 -06:00
0000_third_carnage.sql
0001_friendly_stingray.sql
0002_loose_ultimatum.sql
0003_naive_reptil.sql
0004_shiny_madelyne_pryor.sql
0005_flimsy_squadron_sinister.sql
0005_jazzy_mimic.sql
0006_pretty_invaders.sql
0007_access_modes.sql
0008_make_room_name_nullable.sql feat: improve room creation UX and add password support for share links 2025-10-14 07:09:22 -05:00
0009_add_display_password.sql fix(migrations): add migration 0009 for display_password column 2025-10-14 09:56:26 -05:00
0010_make_game_name_nullable.sql refactor: make game_name nullable to support in-room game selection 2025-10-14 11:30:27 -05:00
0011_add_room_game_configs.sql feat: add drizzle migration for room_game_configs table 2025-10-15 13:40:40 -05:00
0012_damp_mongoose.sql feat(abacus): add nativeAbacusNumbers setting to schema and UI 2025-10-31 20:44:16 -05:00
0013_add_player_stats.sql feat: add per-player stats tracking system 2025-11-03 10:53:54 -06:00
0013_conscious_firebird.sql fix(db): add statement-breakpoint to worksheet_settings migration 2025-11-06 08:26:09 -06:00
0014_remarkable_master_chief.sql fix(worksheets): remove foreign key constraint to support guest users 2025-11-06 08:26:09 -06:00
0015_early_pepper_potts.sql fix: correct GPT-5 API parameters and surface actual grading errors 2025-11-10 06:12:10 -06:00
0016_confused_the_enforcers.sql fix: correct GPT-5 API parameters and surface actual grading errors 2025-11-10 06:12:10 -06:00
0017_skinny_red_hulk.sql feat: add AI-powered worksheet grading with GPT-5 vision 2025-11-10 04:33:22 -06:00
0018_brief_red_wolf.sql feat: add AI-powered worksheet grading with GPT-5 vision 2025-11-10 04:33:22 -06:00
0019_broad_vance_astro.sql feat: add AI-powered worksheet grading with GPT-5 vision 2025-11-10 04:33:22 -06:00
0020_supreme_saracen.sql fix: correct GPT-5 API parameters and surface actual grading errors 2025-11-10 06:12:10 -06:00
0021_little_sentry.sql feat: add worksheet sharing infrastructure with database persistence 2025-11-11 11:17:44 -06:00