Before starting work on this ticket, ensure you have:
- Completed the previous sprints and tickets.
- Familiarized yourself with the existing React application structure.
- Basic understanding of Next.js. If not, go through the official Next.js documentation.
Migrate the current React application to Next.js. The aim is to leverage server-side rendering, better performance, and routing capabilities provided by Next.js.
For a step-by-step guide on how to transition from React to Next.js, refer to: https://nextjs.org/docs/migrating/from-react
- Initialize a Next.js App: Begin by setting up a new Next.js project using the
create-next-app
command. This will help in understanding the default structure Next.js provides. - File & Directory Structure: Adapt the existing React file and directory structure to fit the Next.js paradigm. Especially, move pages to the
pages/
directory to make use of Next.js's file-system based routing. - Routing: Replace React Router (if being used) with Next.js's in-built file-system based routing. Make use of
next/link
for internal links. - State Management: If the app uses context or other state management libraries, ensure they are compatible with Next.js. Make use of
getServerSideProps
orgetStaticProps
if server-side data fetching is necessary. - Styling: Ensure that the styling and CSS-in-JS libraries being used are compatible with Next.js.
- Authentication: As the app has Auth0 integrated, ensure that authentication flows work correctly with Next.js.
- Testing: Ensure that all components and pages work as expected. Migrating to Next.js might cause unexpected issues, so thorough testing is crucial.
- Optimization: Leverage Next.js features like Image Optimization, ISR, etc., where possible.
- Ensure that all existing functionality and components of the React app are working as expected after the migration.
- Maintain the integrity of the main files and ensure the application can be presented and demonstrated without issues.
Want us to review it? Post the following on labs-web:
- Link to your forked repo with the migrated Next.js codebase.
- Link to a Loom video demonstrating the successful migration and showcasing the application's functionality post-migration.
- A brief document highlighting any challenges faced during migration and how they were addressed.
Remember, the primary goal is to smoothly transition the app to Next.js without losing any existing functionality. Good luck!