- Deleted unused PouchDB configuration and types from core storage. - Removed Electron-related hooks and utilities that are no longer needed. - Introduced new local storage management for application keys. - Created a new environment wrapper for landing application. - Added public HTTP client for landing application with minimal configuration. - Implemented new PouchDB entities for items and POS configurations. - Updated main application entry point to reflect new storage structure.
40 lines
1.5 KiB
TypeScript
40 lines
1.5 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: import.meta.env.VITE_APP_NAME || 'fe-monorepo-web',
|
|
appVersion: import.meta.env.VITE_APP_VERSION || '0.0.0',
|
|
telemetryUrl: import.meta.env.VITE_FARO_URL || 'https://telemetry.eigen.co.id/collect',
|
|
otlpTraceUrl: import.meta.env.VITE_OTLP_TRACE_URL || 'https://telemetry.eigen.co.id/v1/traces',
|
|
environment: import.meta.env.VITE_ENV || 'development',
|
|
});
|
|
|
|
// ─── Application Bootstrap ──────────────────────────────────────
|
|
import './main.css';
|
|
import { lazy, StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import { setupI18n } from '@repo/core-i18n';
|
|
import { secureStorage, AppStorageKey } from './core/storage/local';
|
|
|
|
const App = lazy(() => import('./apps'));
|
|
|
|
async function bootstrap() {
|
|
// Initialize i18next and load language from secureStorage
|
|
await setupI18n({
|
|
storageAdapter: {
|
|
getLanguage: async () => await secureStorage.getItem<string>(AppStorageKey.LOCALE),
|
|
setLanguage: async (lng: string) => await secureStorage.setItem(AppStorageKey.LOCALE, lng),
|
|
},
|
|
});
|
|
|
|
createRoot(document.getElementById('app')!).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>,
|
|
);
|
|
}
|
|
|
|
bootstrap();
|