feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
// First: fills the server module graph before anything renders.
|
|
|
|
|
import '../bootstrap/bootstrap.server';
|
|
|
|
|
import '../styles/app.css';
|
|
|
|
|
|
|
|
|
|
import { Element } from '@lumina/island/primitives/element';
|
|
|
|
|
import type { Metadata } from 'next';
|
2026-10-02 14:19:11 +00:00
|
|
|
import type { ReactNode } from 'react';
|
|
|
|
|
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
import { rootMetadata } from '../configs';
|
|
|
|
|
import { i18n } from '../i18n';
|
2026-10-02 15:42:11 +00:00
|
|
|
import { yekanBakh, yekanBakhLatin } from '../styles';
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
import { AppProviders } from './organisms/app-providers';
|
|
|
|
|
|
|
|
|
|
export function generateMetadata(): Metadata {
|
|
|
|
|
return rootMetadata();
|
|
|
|
|
}
|
2026-10-02 14:19:11 +00:00
|
|
|
|
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
|
|
|
return (
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
<Element
|
|
|
|
|
tag="html"
|
|
|
|
|
lang={i18n.language}
|
|
|
|
|
dir={i18n.dir()}
|
2026-10-02 15:42:11 +00:00
|
|
|
className={`${yekanBakh.variable} ${yekanBakhLatin.variable}`}
|
|
|
|
|
>
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
<Element tag="body">
|
|
|
|
|
<AppProviders>{children}</AppProviders>
|
|
|
|
|
</Element>
|
|
|
|
|
</Element>
|
2026-10-02 14:19:11 +00:00
|
|
|
);
|
|
|
|
|
}
|