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 group | URL prefix | Layout | Primary use |
|---|---|---|---|
(common) | none | Full shell with sidebar + header + footer | All main app pages |
(solo) | none | Bare — no chrome | Auth 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 sidebar | Demo variant 2 |
(demo3-layout) | /demo-3/ | Demo 3 header + sidebar + right sidebar | Demo variant 3 |
(demo4-layout) | /demo-4/ | Demo 4 dark theme + hero section | Demo 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:
// 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:
| Category | Behavior | Examples |
|---|---|---|
| Public | Always accessible, no redirect | /auth/login-1, /auth/forgot-password, /auth/signup-1 |
| Anonymous | Redirect authenticated users to /dashboards/crypto | Same as public paths |
| Protected | Redirect unauthenticated users to /auth/login-1 | Everything else |
To add a new public route, update src/config/routes/path.ts:
// src/config/routes/path.ts
export const publicPaths = [
'/auth/login-1',
'/auth/forgot-password',
'/auth/signup-1',
'/your-new-public-route', // ← add here
];The proxy receives URLs with the locale prefix already present (e.g. /en-US/auth/login-1).
The isPublicPath helper in src/utilities/helpers/path.ts strips the locale segment before
matching against the config arrays. Make sure your paths in path.ts do not include the
locale prefix.
Static params generation
The root layout generates static params for the default locale:
// 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:
| Route | Method | Description |
|---|---|---|
/api/auth/[...nextauth] | GET, POST | Auth.js v5 handler (handlers from auth.ts) |
/api/menus/[locale] | GET | Returns serialized menu items for the given locale |