The app bootstraps in two stages: DOM render with Redux persistence, then themed routing with JWT auth.

Stage 1 — src/index.tsx

Redux persist config whitelists only users:

Stage 2 — src/App.tsx

Provider nesting (outer → inner):
  1. ThemeCustomization — MUI theme, palette, typography
  2. RTLLayout — RTL support wrapper
  3. Locales — react-intl messages
  4. ScrollTop — scroll restoration on route change
  5. JWTProvider — auth state, token, login/logout
  6. RouterProviderrouter from routes/index.tsx
  7. Snackbar — global toast notifications

JWT initialization side effects

On mount, JWTProvider:
  1. Reads serviceToken from localStorage
  2. Validates JWT expiry with jwt-decode
  3. Calls GET /user/verifyToken to restore user
  4. Calls getSocket(userId) to connect Socket.IO
Until isInitialized is true, a full-page <Loader /> is shown.

Router creation

routes/index.tsx:
Login routes and main app routes are separate route config objects merged into one browser router.

Default landing path

config.ts sets APP_DEFAULT_PATH = '/dashboard'. GuestGuard redirects logged-in users there after login.