Bootstrap & Initialization
Sequence
index.html loads
→ main.ts bootstraps AppModule
→ AppModule constructor
· tryAddNoIndex() — adds <meta robots=noindex> for white-label hosts
· handlePlaid() — captures Plaid OAuth redirect state from the URL
→ APP_INITIALIZER providers run (in registration order, all awaited)
→ StoreModule.forRoot() hydrates; AuthModule's persistent meta-reducer
restores the auth slice from localStorage
→ AuthEffects.init$ fires: if an auth token exists, dispatch login({ authToken })
→ login$ → userRequested → loadUser$ → getUserByToken()
· EventLoggerService.identify(user)
· dispatch userLoaded, userPermissionsRequested,
userDashboardStatusRequested, loadBalance
→ loadedUserPermissions$ → PermissionsService.getUserPermissions(user)
→ userPermissionsLoaded({ permissions })
→ GlobalSubscriptionsService.init() mirrors permissions into NgxPermissions
and starts all session-scoped subscriptions
→ Router activates BaseComponent (AuthGuard) and the requested lazy route
APP_INITIALIZER providers
Declared in src/app/core/initializers/app-initializer.provider.ts and
registered in AppModule.providers.
| Provider | Effect |
|---|---|
|
Loads |
|
Seeds |
|
Sets and activates the default language, then blocks on the first
|
|
Wires |
|
Registers a CloudWatch counter for Daily Summary data-load failures. |
|
|
|
Registers the SVG icon set with |
|
|
Two further providers are values rather than initializers:
|
|
|
Tunes |
AppModule constructor behaviour
constructor(private readonly meta: Meta, private readonly oauthTokenService: OauthTokenService) {
this.tryAddNoIndex();
this.handlePlaid();
}
tryAddNoIndex()-
If the current URL contains any of
volusion,pro,lendio,neweggcapital,morecommerce,crm2,c2fo, a<meta name="robots" content="noindex">tag is injected. These are white-label or partner-branded hosts that must not be indexed. handlePlaid()-
When the URL carries an
oauth_state_idquery parameter the app is returning from a Plaid OAuth redirect. The full URL is stored onOauthTokenService.oauthToken, the previously savedlink_tokenis read out oflocalStorageintoOauthTokenService.linkToken, and thelocalStorageentry is removed.PlaidModulepicks these up to resume the Link session.
Third-party SDK configuration
All SDK configuration is read from environment at module-import time.
| Module | Configured with | Notes |
|---|---|---|
|
|
The generated Payability API client. |
|
|
Seller Card issuance. |
|
|
Bank linking. |
|
|
Segment only auto-loads in production; elsewhere it must be triggered manually. |
|
|
Custom metrics. |
|
Route allow-list |
Only |
|
|
PWA caching is production-only. |
Environment settings
config/environment.template is rendered into src/environments/environment.ts.
EnvironmentService (src/environments/environment.service.ts) types it.
| Key | Meaning |
|---|---|
|
Build provenance, surfaced in the UI footer. |
|
Toggles |
|
Reserved for mocked data sources. |
|
The |
|
Core Payability API endpoints. |
|
Marketplace service endpoint. |
|
Frontend action/task services. |
|
Document service endpoint. |
|
Global client identifier passed to the API client. |
|
Airwallex card service base URL. |
|
TabaPay iframe origin (card funding). |
|
AG Grid Enterprise licence. |
|
Segment write key. |
|
Referral programme landing page. |
|
Sandbox toggles for the card and banking SDKs. |
|
Metrics ingestion endpoint. |
|
Help centre widget. |
|
reCAPTCHA v3 site key. |
|
Session-replay project key. |