Skip to content

Code Reference — jbwui

High-level guide to the front-end code.

All paths relative to st-integration/jbwui/src/.

FileResponsibility
index.jsCRA entry; renders <App/> in StrictMode
App.jsRouter (createBrowserRouter) + providers: AuthProvider, MUI ThemeProvider, CssBaseline
AuthContext.jsxGlobal auth/session provider: current user, Cognito session, group/role, dealer, onboarding state, sign-in/out, proactive token refresh (60 s loop, refresh <5 min to expiry), 30-min idle timeout, session-expired dialog. Persists token to localStorage
RouteGuard.jsxRedirects unauthenticated users to /
hooks/useIdleTimer.jsActivity-based idle timer with pause/resume
layouts/RootLayout.jsPublic shell (bare <Outlet/>)
layouts/HomeLayout.jsAuthenticated shell: TopBar + Sidebar + content outlet
layouts/OnboardingLayout.jsxWizard card shell for the onboarding steps
themes/theme.jsActive MUI theme (custom palette + typography variants). Other files in themes/ are unused factories
utils/encryption.jsAES encrypt/decrypt (crypto-js) for signin/reset URL payloads — ⚠ hardcoded key
FileScreen
SignIn.jsLogin; handles invited-user autofill (/signin/:id encrypted payload), routes by role post-login
Register.jsDealer/user self-registration (Register_old.js is a legacy copy)
VerifyUser.js / ResetPassword.js / ChangePassword.jsForgot-password initiate / reset with code / forced new-password
Overview.jsAdmin dashboard: DealerCards KPIs + LatestOnboardingCard + JbwAdminTools
DealerDetails.jsxDealer dashboard: DealerInfo, KPIs, TenantsList, AgreementsClaimsTabs, release-notes dialog
Onboarding.jsDealer list (ClientGrid) + onboard new dealer + per-dealer tenant sync
AgreementsSyncHome.jsxAgreement sync console: 3 tabs via AgreementSyncGrid, admin dealer search, sync trigger
UsersList.jsUser management (delegates to sections/users/userscard.jsx)
TransactionLogs.jsxSync/transmission logs
JBWarrantiesFrame.jsxJB Warranties claims iframe embed
ToDoHome.jsxEmail-notification/to-do inbox
onboarding/ClientName.jsxClientLocation.jsx
ClientPlatform.jsxClientCustom.jsx / ClientId.jsx (ServiceTitan) or ClientAccountId.jsx (Workiz) → CLientConnect.jsx
4–5-step onboarding wizard; platform choice branches the path; final step calls createNewOnboarding

Components (components/, ~72 files) — by group

Section titled “Components (components/, ~72 files) — by group”

Most UI complexity lives in the agreements/claims workflows and dealer onboarding groups — start there; the rest is chrome, dialogs, and primitives.

Chrome/navigation — the authenticated app frame: role-based menu, top bar utilities, loader, and session dialog.

Sidebar.jsx (role-based menu), TopBar.jsx (greeting, admin global dealer search, release notes, contact support, user menu, staging banner), UserProfileMenu.jsx, GlobalLoader.jsx (listens to api-loading events), SessionExpiredDialog.jsx

Admin tools — the Admin Tools console: a vertical-tab launcher and one panel per tool.

JbwAdminTools.jsx (launcher) → DealerAdminTool.jsx, AddDealerTOJB360Tool.jsx, InvoiceAdminTools.jsx, ClaimManagmentAdminTool.jsx, DealerSummaryAdminTool.jsx, InvoiceSummary.jsx, ClaimsAdminTool.jsx

Agreements & sync — core agreement UI, the match/approve sync grid, equipment dialogs, and JBW push/upload/download helpers. The workhorse group.

AgreementsClaimsTabs.jsx (Agreements/Claims/Invoices tabs), AgreementList.jsx, AgreementsGrid.jsx, AgreementSyncGrid.jsx (the match/approve grid), AgreementDetails.jsx, AgreementInfo.jsx, AgreementEquipmentForm.jsx + Agm* equipment dialogs, AgreementSyncFileUpload.jsx, AgreementSyncDataDownload.jsx / AgreementSyncDownloadMenu.jsx, NewAgreementDialog.jsx, DuplicateAgreementCreateDialog.jsx, EquipmentsTable.jsx

Claims — claims grids and creation/duplication dialogs, including the bridge into the JB Warranties iframe.

ClaimsList.jsx, ClaimsGrid.jsx, CreateClaimDialog.jsx, DuplicateClaimDialog.jsx, PotentialClaimsCreateDialog.jsx, DownloadClaimsTool.jsx, JBWClaimsIframDialog.jsx (postMessage bridge to jbandassociates.biz)

Invoices — invoice list and detail dialogs.

InvoiceList.jsx, InvoiceDetailsDialog.jsx, InvoiceSummary.jsx

Dealer/tenant — dealer search/forms, tenant grids and dialogs, and the ST location/product lookups used in matching.

DealerSearch.jsx, AdminDealerSearch.jsx, DealerForm.jsx, ClientGrid.jsx, TenantsList.jsx, TenantGrid.jsx, TenantsDialog.jsx, TenantsMultiSelect.jsx, BusinessUnitSelect.jsx, STLocationSearch.jsx / STLocationSearchPopup.jsx, TblProductsSearch.jsx

Auth dialogs — password lifecycle and user registration.

ChangePasswordDialog.jsx, ResetPasswordDialog.jsx, UserRegistrationDialog.jsx

Logs — the sync/transmission log views.

TransmissionDetailsList.jsx, TransmissionGrid.jsx, TransmissionDetails.jsx

Primitives/misc — small reusable inputs, indicators, charts, and one-off dialogs.

IconTextField.jsx, JbwSwitch.jsx, JbwAvatar.jsx, JBWDateLabel.jsx, JBWAlertDialog.jsx, JBWReleasaNotesDialog.jsx, ContactUsDialog.jsx, EmailNotificationBtn.jsx, CopyToClipboardButton.jsx, GradientCircularProgress.jsx, ClientProgressBar.jsx, RevenueChart.jsx, MultiSelectChipsComponent.jsx, gridNoRowOverLay.jsx

Sections (sections/) — page-scoped composites for dealer details, overview, and users.

dealerdetails/DealerCards.jsx, dealerdetails/DealerInfo.jsx, overview/latestOnboardingCard.jsx, overview/RevenueCard.jsx, users/userscard.jsx

All in services/, all through the shared axios instance (services/configs/axiosConfig.js, baseURL = REACT_APP_AWS_GATEWAY_BASE_URL). Cognito config in services/configs/cognitoConfig.js; auth operations in services/jbwAuthServices.js.

One module per backend domain — representative endpoints below; the complete method+path→Lambda map is the jbw-sam routes table.

ModulePurposeRepresentative endpoints
agreementServices.jsAgreement CRUD, equipment rows, the JBW pushGET agreements/dealer/{dealerId} · PUT agreements/{id}/equipmentsync (creates in JBW) · GET/POST/PATCH agreements/{id}/equipments · +7 more (invoice search, ST equipment, duplicate, lookups)
agreementMatchDataService.jsMatch/approve console + sync triggerGET agreementsync/{dealerId} (paged/tabbed) · GET agreementsync/{dealerId}/spcall (sync trigger) · PUT agreementsync/approve · +4 more (location match, file upload, dismiss, update)
ClaimsServices.jsClaims grid + JBW claim-status syncGET claims/{dealerId} · PATCH /claims/stupdate (JBW → DB sync) · POST claims/{dealerId}/createpotentialclaim · +6 more (reject, claim-id updates, search, download, admin tools)
dealerServices.jsDealer lookup, dashboards, onboarding kick-off, admin toolsGET /dealer?key=&type= · POST newdealeronboard · GET /dealer/{id}/gettenantinfo / /getworkizinfo (sync triggers) · PUT /dealer/{id}/admtools · +9 more (verify, cards, transmission logs, lists)
dealerRegisterServices.jsRegistration + user statusPOST dealerregister/add · PUT dealerregister/userstatus · +2 more
dealeronboard.jsOnboarded-dealer list/searchGET /dealeronboard · GET dealeronboard/search?key=
tenantServices.jsST tenant configGET/PATCH /tenant/{id} · PUT /tenant/{id}/autoprocessagreement · +1 more
InvoiceService.jsInvoice lookups + admin updatesGET /invoices/invoicedetails/{id} · +3 more
emailNotifcationService.jsNotification inbox + agreement emailsGET/PATCH emailnotifications · POST /agreements/sendagreementemail
signupService.jsAuth-adjacent HTTPPOST /signup, /changepassword, /resetpassword, /resetpasswordexpireduser (resend expired invite / admin password reset — :17-20)
userservice.jsSign-in user lookup + Terms-of-Use acceptanceGET user?email= · PUT user/updateterms (the path literal at :9 has a cosmetic trailing space — stripped by URL parsing, harmless)
stlocationService.js / equipmentService.js / TblProductsServices.js / adminDashboardServices.js / customDataServices.js / contactusService.jsSingle-endpoint helpersGET stlocations/search/{dealerid} · GET /equipment/types · GET tblproducts/search · GET admindashboard/cardsdata · GET /customdata · POST contactus
JWBServiceTitenService.js / JBWServiceWorkizService.jsPlatform verification at onboardingPOST /jbwservicetitan (ST creds) · GET /workiz/accountverify
JBWAgreementsService.jsJBW agreement lookupGET /jbwagreements/agreement/{jbwAgreementID}
jbwAuthServices.jsCognito (non-HTTP)signUp/confirm · authenticate · forgot/confirm password · new-password challenge · getSession/refreshSession · signOut