This PR updates the Next.js app directory structure for improved route organization for URL paths and adds a landing page. This allows the main app and the landing page to have separate and distinct layout templates. Here's an overview of the changes:
src/app
(home) - This route group helps organize related routes under home without reflecting the group name in the URL path. The URL path would be: unipath.io/home/
home/page.js - Serves as the entry point for the home page.
starred - A subdirectory that could contain specific pages like starred items. To be removed.
tasks - A subdirectory that could contain specific pages like task items.
layout.js - Provides a specific layout shared to all pages within the home directory.
(landing)
page.js - Represents the main page within the landing section of the app. The URL path would be: unipath.io/, since this is for the landing page.
layout.js - Root layout. Defines a shared layout for both the landing page and the home page.
Key Points:
Route groups like (home) and (landing) are enclosed in parentheses to exclude them from the URL path.
Each route group can have its own layout.js, allowing for distinct layouts within the same URL hierarchy.
We want the landing page and the main app pages to have separate layouts. They both inherit from the stripped-down root layout.js file, which allows us to configure details that both layouts would need such as favicon icon, etc.
Overall Review of Changes:
This PR updates the Next.js app directory structure for improved route organization for URL paths and adds a landing page. This allows the main app and the landing page to have separate and distinct layout templates. Here's an overview of the changes:
src/app
(home)
- This route group helps organize related routes underhome
without reflecting the group name in the URL path. The URL path would be:unipath.io/home/
home/page.js
- Serves as the entry point for the home page.starred
- A subdirectory that could contain specific pages like starred items. To be removed.tasks
- A subdirectory that could contain specific pages like task items.layout.js
- Provides a specific layout shared to all pages within thehome
directory.(landing)
page.js
- Represents the main page within the landing section of the app. The URL path would be:unipath.io/
, since this is for the landing page.layout.js
- Root layout. Defines a shared layout for both the landing page and the home page.Key Points:
(home)
and(landing)
are enclosed in parentheses to exclude them from the URL path.layout.js
, allowing for distinct layouts within the same URL hierarchy.For more details on the route group feature and its usage, refer to the official Next.js Route Groups Documentation.
Reason for Change
We want the landing page and the main app pages to have separate layouts. They both inherit from the stripped-down root layout.js file, which allows us to configure details that both layouts would need such as favicon icon, etc.
Tested:
Yes