Skip to content

Migrate web app from CRA to Next.js for SSR and SEO#448

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/migrate-to-nextjs-app
Draft

Migrate web app from CRA to Next.js for SSR and SEO#448
Copilot wants to merge 4 commits intomasterfrom
copilot/migrate-to-nextjs-app

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 26, 2025

The web app needed SEO capabilities after prerender.io trial expiration. Migrated from Create React App to Next.js 13 with server-side rendering to enable search engine crawling with proper meta tags.

Changes

Next.js Setup

  • Installed Next.js 13, upgraded React 17→18
  • Created pages/ directory with routes matching existing structure
  • Added _app.js for Redux provider, _document.js for HTML structure
  • Configured next.config.js with SASS support

SSR Compatibility

  • Wrapped browser API access in typeof window !== 'undefined' checks
  • Updated createExcerpt(), Home, MainCV components for SSR safety
  • Migrated react-helmet to Next.js Head component
  • Dynamic routes use getServerSideProps for on-demand rendering

Routing

  • Created NavLink compatibility wrapper for Next.js router
  • Replaced react-router-dom with Next.js Link and useRouter
  • All existing routes preserved with same paths

Deployment

  • Updated Dockerfile to run Next.js server instead of static build
  • Created start.sh to orchestrate nginx (hub), backend, and Next.js server
  • Next.js runs on port 8080, backend on 8082, hub on 8081

Build Output

Route (pages)                              Type      Size
/                                          Static    12.6 kB
/blog/[id]                                 SSR       45.2 kB  
/cv/[language]/[id]                        SSR       4.41 kB
/portfolio/[language]/[position]           SSR       2.4 kB

Static pages pre-rendered at build time. Dynamic pages server-rendered on request with proper meta tags for crawlers.

Preserved

  • All React components in src/ unchanged
  • Redux state management
  • Existing styles and UI
  • API integration layer
Original prompt

This section details on the original issue you should resolve

<issue_title>Migration to Next.js</issue_title>
<issue_description>Because web is a public-facing website, we need SEO, so that means server-side rendering is necessary. Up to this point, prerender.io was used for SEO, but that trial has expired.

  • Convert the app into a Next.js app with server side rendering, mainly for SEO. All other back-end services should remain intact.
  • Styling will remain the same
  • Minimal changes to keep components and front-end logic the same, just server-side render for crawlers</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 26, 2025 23:27
Co-authored-by: carkod <14939793+carkod@users.noreply.github.com>
Co-authored-by: carkod <14939793+carkod@users.noreply.github.com>
Co-authored-by: carkod <14939793+carkod@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert app to Next.js with server-side rendering Migrate web app from CRA to Next.js for SSR and SEO Nov 26, 2025
Copilot AI requested a review from carkod November 26, 2025 23:35
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.

Migration to Next.js

2 participants