Refactor: Extract shared code and add security improvements
Security fixes:
- Add domain format validation and LIKE escaping in /from/[domain]
- Add AT URI format validation in vote API (format, length, collection match)
- Add in-memory rate limiting for API endpoints (60/min vote, 30/min search)
Code deduplication:
- Extract post queries to src/lib/server/queries/posts.ts
- Extract enrichment logic to src/lib/server/enrichment.ts
- Extract FTS5 sanitization to src/lib/server/search/sanitize.ts
Files reduced:
- src/routes/+page.server.ts: 69 -> 23 lines
- src/routes/new/+page.server.ts: 59 -> 20 lines
- src/routes/from/[domain]/+page.server.ts: 65 -> 38 lines
New test coverage: 64 tests passing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>