Skip to main content

System Overview

The Refer-a-Friend Candescent implementation is a React CDX Widget deployed into the Candescent OLB via Module Federation. It replaces the Q2 Tecton server-side Python extension and all Q2 SDK dependencies with the Candescent CDX Widget SDK and Candescent DevEx REST APIs.

High-Level Architecture

RAF High-Level Architecture — Member (Web Browser) connects to Candescent OLB hosting the RAF CDX Widget via Module Federation. The widget communicates with the Candescent Platform (SDK: useUserContext, SDK: useBranding, DevEx: Accounts, Activity, Customers, Transfers, and Alerts APIs) and the RAF Backend Service (Referral Code Management, Campaign Management, Eligibility Engine, Reward Payout, FI Configuration, Monthly Reporting on AWS ECS Fargate). The RAF Backend persists data to a PostgreSQL Database (referrals, campaigns, rewards, popup_state). The RAF Backend also calls Candescent DevEx APIs for eligibility checks and reward transfers.

Component Architecture


End-to-End Member Flow


Q2 to Candescent Migration Map

This table maps every major Q2 SDK construct to its Candescent equivalent.

Framework Layer

Q2 (Tecton)Candescent (CDX Widget)Notes
Q2TectonServerRequestHandlerPlatformSDK.getInstance()Entry point for all SDK functionality
Python Tornado async handlerReact functional componentWidget is a pure client-side SPA
Jinja2 HTML templatesReact JSX + MUI componentsComponent-based rendering
self.get_tecton_form()React component returnNo server-side rendering
self.get_template()React JSX componentTemplate → Component
self.router dictReact Router / conditional rendersRoute-based navigation
self.form_fieldsuseState / form event handlersClient-side state management
self.session_cacheuseState / useRefReact component state
self.loggerconsole / logging serviceBrowser-based logging

Authentication & User Context

Q2 SDKCandescent EquivalentAPI / Hook
self.context.online_useruseUserContext()CDX SDK hook
online_user.user_idcontext.userIdFrom useUserContext()
online_user.customer_idcontext.customerIdFrom useUserContext()
online_user.ssnGET /ux-users/v1/customers/{id}DevEx REST
UserLogon.get(user_id)context.loginNameFrom useUserContext()

Account & Transaction Data

Q2 SDKCandescent EquivalentEndpoint
self.context.account_listgetHttpClient().get('/db-accounts/v1/accounts')DevEx
GetUserAccountListGET /db-accounts/v1/accounts?userId={id}DevEx
HostAccount.get(id)GET /db-accounts/v1/accounts/{hostAccountId}DevEx
GetAccountHistoryByIdGET /banking-activity/v2/account-history/{hostAccountId}DevEx
GeneratedTransactionsInternal RAF DB queryOwn backend

Fund Transfers

Q2 SDKCandescent EquivalentEndpoint
FundsTransferFromUnassociatedAccountByUiWithPandIandAdditionalDataPOST /db-transfers/v1/transfersDevEx

Customer Data

Q2 SDKCandescent EquivalentEndpoint
User.get(user_id)GET /ux-users/v1/customers/{id}DevEx
User.get_many(user_ids)Multiple GET /ux-users/v1/customers/{id}DevEx

Configuration

Q2 (WedgeAddress)Candescent Equivalent
WedgeAddress.get("InviteFriend")FI App Configuration JSON
self.wedge_address_configs["KEY"]config["KEY"] from loaded JSON
WEDGE_ADDRESS_CONFIGS defaults dictDefault config in widget source

Data Flow: Reward Payout


Deployment Model

The RAF CDX Widget is deployed as a Module Federation remote into the Candescent OLB host. Key build constraints:
  • React pinned to 18.2.0 (matches OLB host)
  • MUI pinned to 7.3.4
  • Axios pinned to 1.14.0
  • SDK: @cdx-extensions/di-sdk@1.1.2, @cdx-extensions/di-sdk-web@2.1.2