48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
// ─── Observability Bootstrap (MUST be first) ────────────────────
|
|
// Initializes Grafana Faro + OTel auto-instrumentation before any
|
|
// React code or HTTP requests are executed.
|
|
import { initTelemetry } from '@repo/core-api/observability/setup';
|
|
|
|
initTelemetry({
|
|
appName: ENV.APP_NAME,
|
|
appVersion: ENV.APP_VERSION,
|
|
telemetryUrl: ENV.FARO_URL,
|
|
otlpTraceUrl: ENV.OTLP_TRACE_URL,
|
|
environment: ENV.APP_ENV,
|
|
});
|
|
|
|
// ─── Application Bootstrap ──────────────────────────────────────
|
|
import './main.css';
|
|
import { lazy, StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import { setupI18n } from '@repo/core-i18n';
|
|
import { appStorage, AppStorageKey } from './core/storage/local';
|
|
import { ENV } from './core/environment';
|
|
|
|
const App = lazy(() => import('./apps'));
|
|
|
|
async function bootstrap() {
|
|
// Initialize i18next and load language from appStorage
|
|
await setupI18n(
|
|
{
|
|
storageAdapter: {
|
|
getLanguage: async () => {
|
|
return appStorage.getItem<string>(AppStorageKey.LANGUAGE);
|
|
},
|
|
setLanguage: async (lng: string) => {
|
|
await appStorage.setItem(AppStorageKey.LANGUAGE, lng);
|
|
},
|
|
},
|
|
},
|
|
ENV.DEFAULT_LANGUAGE,
|
|
);
|
|
|
|
createRoot(document.getElementById('app')!).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>,
|
|
);
|
|
}
|
|
|
|
bootstrap();
|