feat (nextjs) Phase 3 - API routes, Server Actions, TypeScript migration #115
+2,275
−1,251
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Completes the React → Next.js 15 + TypeScript migration for the frontend (Issue #87). This PR adds API route proxying, Server Actions, and finishes all remaining TypeScript conversions.
With this PR, the full migration is complete all 5 phases done.
What's in this PR
API Routes
app/api/health/route.ts— Backend health check proxyapp/api/search/route.ts— Search proxy to Python backendapp/api/store/route.ts— Metadata store proxyapp/api/anonymize/route.ts— File anonymization proxy (routes to JS or Python based on file type)app/api/ipfs/upload/route.ts— IPFS upload proxy to JS backendapp/api/preview/[type]/route.ts— Dynamic preview proxy for image/spreadsheet/pdf/dicomapp/api/proxy/route.ts— General backend proxyServer Actions
app/actions.ts—searchDocuments(),storeMetadata(),checkHealth()TypeScript Conversions
app/layout.js→app/layout.tsxwithMetadatatypeapp/page.js→app/page.tsxwith typed state (ViewType, typed wallet handlers)types/ethereum.d.ts—window.ethereumTypeScript declarationsBuild & Config
tsconfig.json— target updated toES2018tailwind.config.js— content paths now include.ts/.tsxextensionsnext.config.js— image optimization (avif/webp), compression enabled, vendor chunk splittingDocumentation
README.md— complete rewrite with architecture diagram, full project structure, tech stack tableMIGRATION.md— detailed file mapping (React → Next.js), key changes, build verificationRelated
Closes #87
Follows #90 (Phase 1) and #94 (Phase 2)