Skip to content

Migrate admin app from Next.js App Router to TanStack Start#47

Draft
lorenzocorallo wants to merge 24 commits into
mainfrom
t3code/rewrite-to-tanstack-start
Draft

Migrate admin app from Next.js App Router to TanStack Start#47
lorenzocorallo wants to merge 24 commits into
mainfrom
t3code/rewrite-to-tanstack-start

Conversation

@lorenzocorallo

@lorenzocorallo lorenzocorallo commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

This PR migrates the admin application from Next.js App Router to TanStack Start, replacing the framework/runtime layer while preserving the existing admin surface and server capabilities.

The rewrite includes the route migration from src/app to src/routes, replacement of the old API and tRPC wiring with TanStack Start server functions, Better Auth integration updates for the new runtime, and the related dependency/tooling upgrades around React 19, Vite, Tailwind v4, TypeScript 6, and the Nitro production build.

Changes Beyond The Rewrite

  • Added AGENT_MODE for local agent-driven development, allowing direct access to dashboard flows without the normal auth and role redirects in development.
  • Added the Azure groups page.
  • Added the web guides section and related backend wiring.
  • Added the command palette and input-group UI primitives.
  • Migrated dashboard tables to TanStack Table v9 and added optimistic updates for Azure member edits.
  • Redesigned the dashboard layout with the shadcn sidebar and breadcrumb structure.
  • Refined the overall UI styling and standardized Lucide icon sizing.
  • Added a theme toggle.
  • Added skeleton and pending states across dashboard routes.
  • Added Sonner toast support.
  • Fixed login redirect behavior when a valid session already exists.
  • Moved session fetching to the Better Auth client and fixed the application baseURL handling.
  • Improved the account page.
  • Flattened Telegram user routes.
  • Fixed the add-user-to-group combobox flow.
  • Included follow-up linting and accessibility cleanup in UI components.

Testing

  • pnpm dev starts successfully.
  • pnpm build completes successfully.
  • pnpm start serves the production build.
  • pnpm typecheck passes.
  • pnpm check passes.
  • Dashboard routes, login behavior, and the main admin CRUD flows were manually exercised during development.

- Replace Next.js app shell with TanStack Start, Vite, and Nitro
- Remove legacy app router, shadcn scaffolding, and Next build config
- Update Docker, scripts, and lockfile for the new runtime
- Add Tailwind CSS v4 and shadcn/ui setup
- Refactor dashboard and auth screens onto the new component system
- Update docs and dependencies for the new UI stack
- Fix import ordering and type imports
- Add htmlFor/labels for accessibility
- Replace div[role=group] with fieldset
- Suppress auto-generated routeTree.gen.ts in biome check
- Simplify biome check scripts
- Added explicit size-4/5/6/7 className to icon components across dashboard, login, and onboarding routes
- Swapped login page logo from .png to .svg
- Added DataPageSkeleton, DetailPageSkeleton, DashboardPageSkeleton components
- Added shadcn/ui Skeleton component
- Set defaultPendingMs to 100ms in router config
- Replaced missing h2 titles with skeleton placeholders on account page
- Removed redundant h2 from DataToolbar
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ac2a72f2-8b8c-4644-be5b-504078bebd73

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…stack-start

# Conflicts:
#	src/app/dashboard/(active)/azure/members/create-assoc-member.tsx
@lorenzocorallo
lorenzocorallo marked this pull request as draft July 10, 2026 21:30
lorenzocorallo and others added 15 commits July 11, 2026 00:04
- Removed manual query/membersOnly/sort/pagination state from Azure/Telegram tables
- Replaced with globalFilteringFeature, rowSortingFeature, rowPaginationFeature
- Added page-size selector and first/last-page buttons to Pagination
- Controlled search input debounced with useDeferredValue in DataToolbar
- Added "Add group admin" dialog to user detail page
- Removed DashboardPageSkeleton
- Switched router.invalidate calls to sync mode
- Sync loader data to local state for optimistic updates
- Rollback UI on save failure for edit operations
- Only invalidate router on create, not edit
- Disable auto page reset for table
- New ThemeToggle component with dark/light mode switching
- Add dark mode CSS variables and component overrides
- Remove `/dashboard/telegram/users` layout route, flatten children under `/dashboard`
- Group navigation by section (Telegram, Azure, Web) with icons
- Extract reusable PageHeader component from DataToolbar
- Increase default button, input, and badge sizes
- Add DataTableHead variant for styled table headers
- Improve sidebar user section with Avatar component
- Remove hardcoded text colors, switch to theme tokens
- Replace ring-based card borders with border utility
- Use auth.getSession() instead of direct /api/auth/get-session fetch
- Set auth client baseURL from BACKEND_URL env var
- Remove local AdminSession type
- Fix Telegram groups table layout (min-width, full-width button)
- Fix sendEmailTo Zod validation
- Replace custom sidebar with shadcn Sidebar component
- Add DashboardBreadcrumb with route-based auto-generation
- Extract navigation data into dashboard-navigation module
- Add Base UI primitives: breadcrumb, collapsible, sheet, tooltip
- Persist sidebar state via cookie and category collapse via localStorage
- Bump @polinetwork/backend to ^0.17.0
- Add cmdk dependency and Command UI component
- Add InputGroup and Textarea UI components
- Add Azure groups dashboard route and navigation item
- Export AzureGroup type from API types
- Fix avatar border token (border-input)
- Remove tooltip arrow from TooltipContent
- Remove unused Separator import in dashboard-frame
This add an agent mode that allows agents to preview the changes
without having to mess around with authentication or permission checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants