Code Reference — jbwui
High-level guide to the front-end code. All paths relative to st-integration/jbwui/src/.
Application Shell
Section titled “Application Shell”| File | Responsibility |
|---|---|
index.js | CRA entry; renders <App/> in StrictMode |
App.js | Router (createBrowserRouter) + providers: AuthProvider, MUI ThemeProvider, CssBaseline |
AuthContext.jsx | Global 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.jsx | Redirects unauthenticated users to / |
hooks/useIdleTimer.js | Activity-based idle timer with pause/resume |
layouts/RootLayout.js | Public shell (bare <Outlet/>) |
layouts/HomeLayout.js | Authenticated shell: TopBar + Sidebar + content outlet |
layouts/OnboardingLayout.jsx | Wizard card shell for the onboarding steps |
themes/theme.js | Active MUI theme (custom palette + typography variants). Other files in themes/ are unused factories |
utils/encryption.js | AES encrypt/decrypt (crypto-js) for signin/reset URL payloads — ⚠ hardcoded key |
Pages (pages/)
Section titled “Pages (pages/)”| File | Screen |
|---|---|
SignIn.js | Login; handles invited-user autofill (/signin/:id encrypted payload), routes by role post-login |
Register.js | Dealer/user self-registration (Register_old.js is a legacy copy) |
VerifyUser.js / ResetPassword.js / ChangePassword.js | Forgot-password initiate / reset with code / forced new-password |
Overview.js | Admin dashboard: DealerCards KPIs + LatestOnboardingCard + JbwAdminTools |
DealerDetails.jsx | Dealer dashboard: DealerInfo, KPIs, TenantsList, AgreementsClaimsTabs, release-notes dialog |
Onboarding.js | Dealer list (ClientGrid) + onboard new dealer + per-dealer tenant sync |
AgreementsSyncHome.jsx | Agreement sync console: 3 tabs via AgreementSyncGrid, admin dealer search, sync trigger |
UsersList.js | User management (delegates to sections/users/userscard.jsx) |
TransactionLogs.jsx | Sync/transmission logs |
JBWarrantiesFrame.jsx | JB&Associates claims iframe embed |
ToDoHome.jsx | Email-notification/to-do inbox |
onboarding/ClientName.jsx → ClientLocation.jsx → ClientPlatform.jsx → ClientCustom.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”Chrome/navigation: 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: JbwAdminTools.jsx (vertical-tab launcher) → DealerAdminTool.jsx, AddDealerTOJB360Tool.jsx, InvoiceAdminTools.jsx, ClaimManagmentAdminTool.jsx, DealerSummaryAdminTool.jsx, InvoiceSummary.jsx, ClaimsAdminTool.jsx.
Agreements & sync: 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: ClaimsList.jsx, ClaimsGrid.jsx, CreateClaimDialog.jsx, DuplicateClaimDialog.jsx, PotentialClaimsCreateDialog.jsx, DownloadClaimsTool.jsx, JBWClaimsIframDialog.jsx (postMessage bridge to jbandassociates.biz).
Invoices: InvoiceList.jsx, InvoiceDetailsDialog.jsx, InvoiceSummary.jsx.
Dealer/tenant: 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: ChangePasswordDialog.jsx, ResetPasswordDialog.jsx, UserRegistrationDialog.jsx.
Logs: TransmissionDetailsList.jsx, TransmissionGrid.jsx, TransmissionDetails.jsx.
Primitives/misc: 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/): dealerdetails/DealerCards.jsx, dealerdetails/DealerInfo.jsx, overview/latestOnboardingCard.jsx, overview/RevenueCard.jsx, users/userscard.jsx.
Service Modules
Section titled “Service Modules”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.
| Module | Endpoints (relative to gateway) |
|---|---|
agreementServices.js | GET agreements/dealer/{dealerId}; GET/POST/PATCH agreements/{id}/equipments; GET agreements/{id}/agreementdetails; POST agreements/{id}/duplicateagreement; PUT agreements/{id}/equipmentsync; GET agreements/dealer/{id}/invoicesearch; POST agreements/dealer/{id}/newinvoiceagreement; GET agreements/dealer/{id}/stequipments; PATCH agreements/{id}/updateinfo; GET agreements/jbw/{id}; GET agreements/{id}/getstinstalledequipment; GET /stlocations/search/tenant |
agreementMatchDataService.js | GET agreementsync/{dealerId} (paged/tabbed); PUT agreementsync/{matchId}/location; PUT agreementsync/approve; GET agreementsync/{dealerId}/spcall (sync trigger); POST agreementsync/{dealerId}/fileupload; PATCH agreementsync/dismissagreement; PUT agreementsync/{matchId}/update |
ClaimsServices.js | GET claims/{dealerId}; PATCH claims/reject/{id}; PATCH claims/claimidupdate/{id}; PATCH /claims/stupdate; GET claims/search; GET claims/{dealerId}/download; PUT claims/admtools; PUT claims/claimidupdate; POST claims/{dealerId}/createpotentialclaim |
dealerServices.js | GET /dealer/{id}/verify, /onboard, /cardsdata, /transmissiondetails(+history), /gettenantinfo, /getworkizinfo; PATCH /dealer/{id}; POST newdealeronboard; GET /dealer/nononboardedlist, /latestonboardeddealers, /pendinglist, /dealer?key=&type=; PUT /dealer/{id}/admtools; dealer location lookups; POST dealer |
dealerRegisterServices.js | POST dealerregister/add; GET dealerregister(...); PUT dealerregister/userstatus; PATCH dealerregister/{id}/updatereleasenotestatus |
dealeronboard.js | GET /dealeronboard; GET dealeronboard/search?key= |
tenantServices.js | GET /tenant/{id}, /tenant/dealer/{dealerId}; PATCH /tenant/{id}; PUT /tenant/{id}/autoprocessagreement |
InvoiceService.js | GET /invoices/invoicedetails/{id}; GET /invoices?...; GET /invoices/summarylist; PATCH /invoices?... |
emailNotifcationService.js | GET/PATCH emailnotifications; POST /agreements/sendagreementemail |
signupService.js | POST /signup, /changepassword, /resetpassword |
stlocationService.js | GET stlocations/search/{dealerid} |
equipmentService.js | GET /equipment/types |
TblProductsServices.js | GET tblproducts/search?key= |
adminDashboardServices.js | GET admindashboard/cardsdata |
customDataServices.js | GET /customdata |
contactusService.js | POST contactus |
JWBServiceTitenService.js | POST /jbwservicetitan (ST credential verify) |
JBWServiceWorkizService.js | GET /workiz/accountverify |
JBWAgreementsService.js | GET /jbwagreements/agreement/{jbwAgreementID} |
jbwAuthServices.js | Cognito (non-HTTP): signUp/confirm, authenticate, forgot/confirm password, new-password challenge, getSession/refreshSession, signOut |