Routing

Jumbo React Next uses the Next.js 16 App Router with a [lang] dynamic segment for built-in internationalization. All routes live under src/app/[lang]/ and are organized into route groups that determine which layout each page receives.

Route structure

Every URL in the app includes the locale as the first path segment:

/en-US/dashboards/misc
/ar-SA/dashboards/crypto
/fr-FR/apps/mail/inbox

When a request arrives without a locale prefix (e.g. /dashboards/misc), the proxy automatically redirects it to /en-US/dashboards/misc. See the Proxy & Middleware guide for details.

Route groups

Route groups (parenthesized folder names) are invisible in URLs and control which layout wraps each page:

Route groupURL prefixLayoutPrimary use
(common)noneFull shell with sidebar + header + footerAll main app pages
(solo)noneBare — no chromeAuth pages, error pages, lock screen
(demo1-layout)/demo-1/Demo 1 header (no sidebar)Demo variant 1
(demo2-layout)/demo-2/Demo 2 header + temporary sidebarDemo variant 2
(demo3-layout)/demo-3/Demo 3 header + sidebar + right sidebarDemo variant 3
(demo4-layout)/demo-4/Demo 4 dark theme + hero sectionDemo variant 4

The (common) and (solo) groups do not add a URL segment. The demo-* groups each add their segment prefix.

Available routes

Dashboards

/[lang]/dashboards/crm
/[lang]/dashboards/crypto
/[lang]/dashboards/ecommerce
/[lang]/dashboards/intranet
/[lang]/dashboards/listing
/[lang]/dashboards/misc
/[lang]/dashboards/news

Apps

/[lang]/apps/chat
/[lang]/apps/chat/[...category]
/[lang]/apps/contact
/[lang]/apps/contact/[...category]
/[lang]/apps/mail/[...folder]
/[lang]/apps/invoice
/[lang]/apps/plan-subscription

User

/[lang]/user/profile-1  …  /[lang]/user/profile-4
/[lang]/user/social-wall
/[lang]/user/settings/public-profile
/[lang]/user/settings/[...slug]

Auth (solo layout)

/[lang]/auth/login-1
/[lang]/auth/login-2
/[lang]/auth/signup-1
/[lang]/auth/signup-2
/[lang]/auth/forgot-password
/[lang]/auth/reset-password

Extra pages (solo layout)

/[lang]/extra-pages/404
/[lang]/extra-pages/500
/[lang]/extra-pages/lock-screen

Catch-all routes

The mail and contact apps use catch-all segments to capture folder/category paths:

typescript
// src/app/[lang]/(common)/apps/mail/[...folder]/page.tsx
interface Props {
  params: Promise<{ lang: string; folder: string[] }>;
}
 
export default async function MailFolderPage({ params }: Props) {
  const { folder } = await params;
  const folderPath = folder.join('/'); // e.g. 'inbox', 'sent', 'labels/work'
  // ...
}

Route protection

Routes are protected at the proxy level, not with per-page auth() calls. Three categories are defined in src/config/routes/path.ts:

CategoryBehaviorExamples
PublicAlways accessible, no redirect/auth/login-1, /auth/forgot-password, /auth/signup-1
AnonymousRedirect authenticated users to /dashboards/cryptoSame as public paths
ProtectedRedirect unauthenticated users to /auth/login-1Everything else

To add a new public route, update src/config/routes/path.ts:

typescript
// src/config/routes/path.ts
export const publicPaths = [
  '/auth/login-1',
  '/auth/forgot-password',
  '/auth/signup-1',
  '/your-new-public-route',  // ← add here
];

Static params generation

The root layout generates static params for the default locale:

typescript
// src/app/[lang]/layout.tsx
export async function generateStaticParams() {
  return [{ lang: 'en-US' }];
}

To enable static generation for additional locales at build time, add them to this array.

API routes

Two API routes exist outside the [lang] segment:

RouteMethodDescription
/api/auth/[...nextauth]GET, POSTAuth.js v5 handler (handlers from auth.ts)
/api/menus/[locale]GETReturns serialized menu items for the given locale