Title
Migrate all the remaining REST APIs to tRPC for better client type safety.
Description
tRPC is already implemented and verified working, this migration will ensure strongly typed data across client and backend reducing chances of errors.
REST API Migration Inventory
✅ Already Migrated to tRPC / Not Migratable
| API Route |
Status |
Notes |
/api/trpc/[trpc] |
tRPC handler |
Core tRPC endpoint |
/api/auth/[...nextauth] |
Framework |
NextAuth.js handlers (required by framework) |
/api/auth/callback |
Framework |
WorkOS AuthKit callback (required by framework) |
/api/upload/proposal-attachment |
Cannot Migrate |
Multipart upload (Vercel Blob) - explicitly excluded |
/api/upload/speaker-image |
Cannot Migrate |
Multipart image upload |
/api/admin/speaker-image |
Cannot Migrate |
Multipart image upload |
/api/admin/gallery/upload |
Cannot Migrate |
Multipart gallery upload |
/api/travel-support/upload-receipt |
Cannot Migrate |
Multipart receipt upload |
📋 APIs to Migrate to tRPC
| API Route |
Method |
Description |
Priority |
/api/volunteer |
POST |
Create volunteer application |
Medium |
/api/proposal/[id]/action |
POST |
Proposal status changes |
High |
/api/admin/speakers |
GET |
List all speakers (admin) |
Medium |
/api/admin/clear-session |
GET/POST |
Clear session cookies (dev only) |
Low |
/api/speakers/search |
GET |
Search speakers by name/email |
Medium |
/api/proxy-image |
GET |
Proxy images from Sanity |
Low |
/api/badge/validate |
POST |
Validate OpenBadges credential |
Medium |
⚠️ Public/External APIs (Should Remain REST)
These are public-facing or external APIs that need REST endpoints for interoperability:
| API Route |
Method |
Reason to Keep as REST |
/api/badge/issuer |
GET |
OpenBadges 3.0 spec requires HTTP endpoint |
/api/badge/[badgeId]/json |
GET |
Public credential endpoint |
/api/badge/[badgeId]/image |
GET |
Returns SVG binary |
/api/badge/[badgeId]/download |
GET |
Returns SVG download |
/api/badge/[badgeId]/verify |
GET |
Public verification endpoint |
/api/badge/[badgeId]/achievement |
GET |
OpenBadges achievement endpoint |
/api/badge/.well-known/jwks.json |
GET |
JWKS per RFC 7517 |
/api/badge/keys/[keyId] |
GET |
JWK key endpoint |
/api/route |
GET |
Health check (Hello world) |
/api/dev |
GET |
Dev tools (development only) |
/api/dev/clear-storage |
GET |
Dev tools (development only) |
/api/cron/cleanup-orphaned-blobs |
GET |
Cron job (Vercel cron) |
/api/cron/sales-update |
GET |
Cron job (Vercel cron) |
/api/webhooks/checkin/ticket-sold |
POST |
External webhook receiver |
Summary
| Category |
Count |
| Total REST API routes |
29 |
| Already tRPC/Framework |
2 |
| Cannot migrate (multipart) |
5 |
| Should remain REST (external/public) |
14 |
| To migrate to tRPC |
7 |
Migration Tasks
Title
Migrate all the remaining REST APIs to tRPC for better client type safety.
Description
tRPC is already implemented and verified working, this migration will ensure strongly typed data across client and backend reducing chances of errors.
REST API Migration Inventory
✅ Already Migrated to tRPC / Not Migratable
/api/trpc/[trpc]/api/auth/[...nextauth]/api/auth/callback/api/upload/proposal-attachment/api/upload/speaker-image/api/admin/speaker-image/api/admin/gallery/upload/api/travel-support/upload-receipt📋 APIs to Migrate to tRPC
/api/volunteer/api/proposal/[id]/action/api/admin/speakers/api/admin/clear-session/api/speakers/search/api/proxy-image/api/badge/validateThese are public-facing or external APIs that need REST endpoints for interoperability:
/api/badge/issuer/api/badge/[badgeId]/json/api/badge/[badgeId]/image/api/badge/[badgeId]/download/api/badge/[badgeId]/verify/api/badge/[badgeId]/achievement/api/badge/.well-known/jwks.json/api/badge/keys/[keyId]/api/route/api/dev/api/dev/clear-storage/api/cron/cleanup-orphaned-blobs/api/cron/sales-update/api/webhooks/checkin/ticket-soldSummary
Migration Tasks
/api/proposal/[id]/action→proposal.action(High priority)/api/volunteer→volunteer.create(Medium priority)/api/admin/speakers→speakers.list(Medium priority)/api/speakers/search→speaker.search(Medium priority - may already exist)/api/badge/validate→badge.validate(Medium priority)/api/proxy-image→ Consider keeping as REST (returns binary)/api/admin/clear-session→ Low priority (dev only)