Frontend migrated from Next.js to Vite + React Router in a single large commit

dropthejase replaced the entire Next.js App Router frontend with Vite and React Router v7 in one 135-file commit. The app is SPA-only behind CloudFront, so Next.js was earning very little; Vite builds faster and the S3 deploy is simpler. The cost is a rewrite of every page, every router import, and every layout file.

infrastructurechat-ui

5802aa6 is a single commit removing 23,426 lines and adding 14,955. The lock file alone changes by thousands of lines as the Next.js dependency tree is replaced. NEXT_PUBLIC_* env vars become VITE_*. The bun.lock disappears; package-lock.json with npm takes over.

The routing layer changes from Next.js App Router conventions to react-router-dom v7 createBrowserRouter / <Routes>. All useRouter, usePathname, useSearchParams hooks are replaced with React Router equivalents. The next/link imports are replaced with react-router <Link>. Server-side concerns (RSC, server actions, next/headers) are absent since the app was already static-export-only.

The static export config from Next.js is replaced by Vite's standard SPA build output, deployed to S3 and served via CloudFront with the 404→200 SPA fallback already in StorageStack.

A follow-up commit (7845ed4) adds useNavigate to the sidebar chat item so deleting the active chat navigates to /assistant, and adds the Vite env example file with VITE_* variables.

So what Consider this only if you are already committed to SPA-only delivery via CloudFront. The Vite build is faster and the deploy script simpler, but the full rewrite is a significant cherry-pick risk. Any future upstream PR touching Next.js-specific layout files will conflict.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from dropthejase/louis, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
5802aa6f Migrate frontend from Next.js to Vite + React Router Jason Lee 2026-05-11 ↗ GitHub
commit body
- Replace Next.js App Router with react-router-dom v7 SPA routing
- Remove all 'use client' directives, next/navigation, next/link imports
- Replace useRouter/usePathname with useNavigate/useLocation
- Replace useSearchParams() call with [searchParams] destructuring
- Add Amplify <Authenticator> as root auth gate, remove custom login/signup pages
- Add AuthProvider inside Authenticator render in App.tsx
- Consolidate Amplify config (including Identity Pool) in lib/aws/config.ts
- Build AgentCore invocation URLs from ARNs at runtime
- Replace NEXT_PUBLIC_* env vars with VITE_* throughout
- Replace uploadData key param with path to avoid public/ prefix
- Add key={id} wrapper on AssistantChatPage for unmount/remount on route change
- Replace process.env.NEXT_PUBLIC_API_BASE_URL with API_URL from config
- Account page uses React Router nested routes for /account/models
- WorkflowPage migrated from next/dynamic to direct import
- TypeScript compiles clean, Vite build succeeds
7845ed46 Add delete-active-chat navigation and env example file Jason Lee 2026-05-11 ↗ GitHub
- SidebarChatItem navigates to /assistant when deleting the active chat
- Add .env.local.example with VITE_* variable names for Vite migration

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-343.md from inside the repo you want the changes in.

⬇ Download capture-thread-343.md