The borrower-facing loan-application SPA — a white-labelled, multi-brand onboarding & repayment funnel used directly by loan applicants and their guarantors.
quapay-webv1 · PM2 app name qualoan-webv1 · ~1,193 commits to src/ since the last doc refresh (2026-04-07)router.tsx, Redux slices, service layer, git history) rather than from older internal notes. Where the previous documentation conflicted with the code, the code won — the biggest conflict is called out immediately below.
los-partner, which is the internal staff/DSA CRM. los-webv1 has no dashboard and no staff role model; it is a phone-OTP-gated, white-labelled loan-application funnel that borrowers and guarantors use on their own devices. This page and its Product & flows companion document what the repo actually is.
A single React SPA, statically built and served behind nginx, talking to the web auth surface of los-backend plus a handful of KYC and payment vendors directly from the browser.
@vitejs/plugin-react-swc, TypeScript 5.7@tailwindcss/vite + Headless UI + custom src/common/ui primitivesuseRoutes, code-split via React.lazy + Suspenseaxios calls in src/services/api/*, pushed into slices manuallyuseSignup, useGrievanceForm)string-similarity for fuzzy bank/lender searchui-react-liveness) + Digilocker via Digitap v2 / Signzy, plus react-webcam and FingerprintJS device fingerprinting@cashfreepayments/pg-react SDK; Razorpay is redirect/status-callback only (no SDK dep). PaymentMethodEnum also lists PAYTRING, MANUAL@marsidev/react-turnstile gates OTP login and complaint formssrc/ top-level directories and what lives in each.
| Directory | Purpose |
|---|---|
src/pages/* | Thin route wrappers (autoLogin, cashfee, contactUs, grievanceComplaint, loans/loanRequest, phoneVerification, profile/specificProfile, referral, rejected, repaynow, review, whistleblowerComplaint) — mostly just wrap a features/* component in MainLayout. |
src/features/workflow | The core multi-step onboarding wizard — by far the largest feature. ~13 sub-features: aadhaarKYC, alternateNumbers, bankAccount, documents, employmentInfo, existingLoans, geo-location, guarantors, income-proof (bank-statement upload + Account Aggregator consent), pan-kyc-details, photoAndVideo (liveness), underwriting-evaluation, plus brand-template variant folders common/v8|v16|v19|v24|v29. |
src/features/loan, loanApplication | The /apply amount & tenure form (borrower-only). |
src/features/loanRequest | Re-loan / top-up request against an existing loan id. |
src/features/profile, specificProfile | Profile viewing + repay section. |
src/features/review, rejection | Soft/hard-reject terminal screens. |
src/features/paytering, cashfee | Payment status-sync / Razorpay-status / Cashfree callback handling. |
src/features/phoneVerification, emailVerification, alternatePhoneNumber | OTP flows. |
src/features/grievanceComplaint, whistleblowerComplaint | Turnstile-gated compliance forms, open to anyone. |
src/features/theamProvider | Runtime brand ThemeProvider (directory name is a typo for "theme"). |
src/redux/slices | user, userDetails, workflow, employment, bankAccount, documents, loanCredibility, aaConsentRequests, alternatePhoneNumbers, userGeoLocation, plus index (brand/app bootstrap — theme, logo, workflow step config, tracking). |
src/services/api/*.ts | One file per backend resource: auth, workflow, kyc, employment, document, other-documents, user-bank-account, user-details, user-devices, guarantors, underwriting, aa, digilocker, consolidation-lines, loans, payment, referral, common, alternate-numbers, web, plus grievance.service.ts / whistleblower.service.ts. |
src/services/axios.ts | Base axios client + apiV2/apiV3 versioned clients, shared 401-refresh interceptor. |
src/common/ui, dialog, Security, GeolocationPrompt | Shared UI primitives, modal/dialog system, device/session integrity component, geolocation-permission prompt. |
src/hooks | useDevice (device registration), useAwsSignedUrl, useBrandMeta, useAccountLabel, useQueryParams, handelLogout, useV6CardAutoscroll. |
src/config | brand-ui.config.ts, brand-version.config.ts (the StepCode → t1…t30 UI-template resolver), support-faq.config.ts. |
src/constant/enum.ts | UserRoleEnum (used) + vestigial PartnerUserRoleEnum (unused, see §05). |
./features/loan/ui directory exists outside src/ — only two levels deep and not referenced anywhere in router.tsx. It appears to be a leftover or work-in-progress scaffold, not part of the live app. Safe to ignore when navigating the codebase, but worth cleaning up.
From src/router.tsx. There is no leads/CAM/collections/reports/admin/global-search surface anywhere in this app — see the correction callout above.
| Route | Purpose |
|---|---|
/ | HomeRedirect — token present → /loan-application, else → /phone-verification |
/phone-verification | OTP login/signup, Turnstile-gated |
/repay-now | Public repayment entry (also duplicated as an always-open route outside the public group) |
/auto-login | Machine/deep-link auto-login |
/r/:code | Referral landing page |
/contact-us | Contact form |
/grievance_redressal_complaint | Grievance complaint form, Turnstile-gated |
/complaint | Whistleblower complaint form, Turnstile-gated |
/digitap/digilocker/redirect/:brandId/:userId/:onboardingStep | Digitap Digilocker KYC redirect callback (no auth gate, ID-scoped by URL params) |
/signzy/digilocker/redirect/..., /signzy/digilocker/failed/... | Signzy Digilocker redirect / failure callbacks |
/signzy/cibil/success | Signzy CIBIL callback |
/payment/cashfree, /payment/status-sync, /payment/razorpay-status | Payment gateway redirect/status-reconciliation callbacks |
ProtectedRoutes, requires Redux accessToken)| Route | Purpose |
|---|---|
/loan-application | The step-wizard (WorkflowPage) — the main onboarding journey |
/apply | Amount & tenure submission → create-loan. BorrowerOnlyRoutes-gated (backend also 400s for guarantors) |
/loan/:loanId/request | Re-loan/top-up request against a specific existing loan |
/profile, /profile/:profileId | Profile viewing + repay section |
/rejected | Shown when loan status is HARD_REJECTED / BRE_REJECTED / DELETED, or user is_blocked |
/review | Shown when loan status is SOFT_REJECTED (manual review pending) |
* (catch-all) | Redirect to /phone-verification |
/phone-verification), Turnstile-captcha-gated, via src/features/phoneVerification (useSignup hook). On success the backend issues an access token (+ refresh, cookie-based via withCredentials: true) stored in Redux (state.user.accessToken) — not directly read from localStorage by app logic, though the axios failure path does localStorage.clear().src/services/axios.ts implements a single shared interceptor: queues concurrent failed requests while one refreshToken() call is in flight; on refresh failure it force-navigates to /phone-verification, clears localStorage, and calls logout(). Two versioned instances (apiV2, apiV3) share identical interceptor logic for endpoints versioned differently from the default v1.ProtectedRoutes/PublicRoutes in router.tsx), plus one narrow business-rule guard, BorrowerOnlyRoutes (checks selectIsGuarantor), which blocks guarantors from the create-loan /apply form. There is no broader permission/role matrix.InternalPages bootstrap — the router root component does app bootstrap on mount: fetches the brand index config (theme/logo/workflow steps/tracking), fetches getUser() when a token exists and redirects to /rejected or /review based on loan status, and enforces a minimum web-version check (ensureLatestWebVersion) — a forced-reload-on-stale-build mechanism (see §07/UX quirks on the Product page).domain header (window.location.host); the backend uses this to resolve which lender brand is making the request. Multi-tenant by hostname, not by path or subdomain convention alone.This is not an RBAC system. The only role distinction the app actually implements is borrower-vs-guarantor; everything else that looks like "permissions" is really a brand/template/status resolver.
UserRoleEnum { BORROWER = 93, GUARANTOR = 94 } — the only role enum consumed anywhere in src. Drives selectIsGuarantor and the BorrowerOnlyRoutes guard, which is the sole role-based branch in the entire app.selectUserStatus: HARD_REJECTED/BRE_REJECTED/DELETED → /rejected; SOFT_REJECTED → /review) and by brand config (workflow_steps, web_template_version → which of ~30 UI templates render per onboarding step, per lender brand).src/constant/enum.ts also declares PartnerUserRoleEnum (SUPER_ADMIN, ADMIN, LOANS, LOAN_OPS, COLLECTIONS, SANCTION_MANAGER, SANCTION_HEAD, CREDIT_EXECUTIVE, COMPLETED_LOANS, REPORT, VIEW_DASHBOARD, …) — a copy-paste of the backend's staff-role enum that is declared and never referenced anywhere else in src. It implements nothing in this app; treat it as dead code left over from a shared type file, not evidence of staff functionality here.
The single biggest architectural fact about this repo: one codebase serves roughly 15 lender brands at runtime, via a brand config fetched from the backend at bootstrap — not via separate builds or deploys per brand.
On app load, InternalPages fetches the brand index config keyed off the request hostname (the domain header). That config supplies the theme (colors, logo — CSS-variable tokens documented in docs/thems.md: primaryColor, secondaryColor, backgroundColor, surfaceColor, primaryTextColor, secondaryTextColor, successColor, warningColor, errorColor → mapped to Tailwind tokens like bg-primary, text-textPrimary), the ordered list of onboarding workflow_steps, and — per step — a web_template_version that selects which of up to ~30 alternate UI template implementations (t1…t30) renders that step. src/config/brand-version.config.ts is the StepCode → template resolver; several brand-variant folders exist directly under features/workflow/common/v8|v16|v19|v24|v29.
features/workflow/common/v8t16 for Fins Panda" — most day-to-day frontend work in this repo is brand-specific UI variant work rather than a universal change to one canonical flow. Any diagram of "the" onboarding journey (see Product page §02) is really a diagram of a configurable flow whose concrete screens vary by brand.
| Layer | Detail |
|---|---|
| Primary build/deploy | Dockerfile.production — multi-stage node:20-alpine build → static dist/ served by nginx:stable-alpine, with a locked-down nginx.conf (X-Frame-Options SAMEORIGIN, HSTS, CSP allowing self + https). |
| Dev build | Dockerfile.dev runs npm run dev in node:18-alpine. |
| Alternate deploy path | ecosystem.config.cjs (PM2) runs npm run start → npx serve -l 5173 dist as app name qualoan-webv1 — a non-Docker deploy path that coexists with the Docker/nginx one. |
| Build resources | Build script bumps Node heap to 6GB (--max-old-space-size=6144) via tsc -b && vite build — a large/slow TS build, consistent with the many per-brand template folders. |
| Theming | Brand theme (colors/logo) is served from the backend brand-config endpoint and applied at runtime via ThemeProvider (src/features/theamProvider) — not hardcoded per deploy. |
~1,193 commits touching src/ since the last doc refresh (2026-04-07) — all thematically consistent with a borrower funnel under active per-brand iteration, not new staff features.
status_id to loan-based status tracking (selectUserStatus), a meaningful backend-contract shift reflected in the user slice.