<aside> 🔁 Synced from GitHub #d6f4ced70ff8. Edit in the paidhr-system-docs repository, not here: changes made in Notion are overwritten.

</aside>

Web app

Repo: web-app · React (Create React App), TypeScript, Tailwind, antd, react-query, Zustand stores · deployed as an Azure Static Web App (staticwebapp.config.json) · errors to Sentry

In one paragraph

One React app serves four audiences from one codebase: HR admins (the dashboard), employees (self-service), managers (direct reports and performance) and approvers (approval screens and one-click email landing pages). It also hosts public pages: sign-in, careers and candidate pages, surveys and referral landing. It talks to three backends through separate axios instances.

Layout of the code

Folder Holds
src/pages/auth, new-auth, 2fa, OAuth Sign-in, password reset, two-factor, Google/Microsoft sign-in
src/pages/onboarding, dashboard/new-company-onboarding Company setup wizard
src/pages/dashboard/* Admin: people, payroll, paymentSchedules, wallets, earnWageAccess, performance, calendar, documents, tasks, kyc, promotions, extras/{audits,settings}
src/pages/employee-dashboard/* Employee: requests, payslip, wallet, time-and-attendance, performance-new, job-and-pay, benefits, documents, assets, disciplinary, survey, tasks, onboarding, profile
src/pages/manager-dashboard/* Managers: direct-reports, performance, profile
src/pages/approval/* Approver views: requests, payroll, payment-schedules, absence, suspensions, violations
src/features/hiring The newer hiring experience, with its own API client
src/services/*Service.ts One service per domain: all API calls live here
src/stores/* Zustand stores (auth, company, payroll, requests, time-tracking, feature flags…)
src/components, components/new-stuff Shared UI, including the newer report table
src/utils/request.ts Creates the axios instances and their interceptors

How it talks to the backends

src/services/serviceInstances.ts maps every domain to an axios instance, so moving a domain to another backend is a one-line change:

Instance Backend Auth header Domains
newArchAxiosInstance core-backend (REACT_APP_NEW_ARCH_BASE_URL / REACT_APP_BASE_URL) Authorization: Bearer (+ refresh_token) auth, onboarding, employees, people, benefits, payroll, payment schedules, requests, performance, company, documents, assets, announcements, audit, custom fields
ewaAxiosInstance ewa-service (REACT_APP_EWA_BASE_URL) access_token EWA, time & attendance, loans, integrations, OAuth settings, files, customization settings
walletAxiosInstance wallet-service (REACT_APP_PADE_WALLET_BASE_URL) access_token + API key wallet

Other configuration: Google Maps (geofences), CSVBox (bulk uploads), Mixpanel, HubSpot, Customer.io, reCAPTCHA, Handhold (in-app guides), Microsoft and Google client ids.

Permissions in the UI

RequireRoutePermit guards routes and the usePermissions hook hides or shows actions from the permissions in the session. Admins are treated as holding everything, so the UI can show an action the backend then refuses for an admin. See roles.

Conventions that prevent real bugs

These come from defects that reached production (full text in web-app/.claude/skills/web-app-conventions):

  1. Read .data. utils/request returns the whole envelope { data, code, message, success, errors }. Type queries as IBaseRes so reading the wrong level fails to compile. A leave date picker once read the wrong level and greyed out no public holidays for months.
  2. Id fields differ per endpoint (id, paygradeId, paygrade_id). Read them defensively. With antd Select, an undefined option value silently becomes the option's index, which once added the wrong pay grades to a live policy.
  3. Booleans are compared to the string "yes" on the server. Sending true can turn a feature off while the save reports success.
  4. Verify the payload, not the types. Use Playwright to drive the form and read the request body.
  5. Preserve file encoding (some files are UTF-8 with BOM).