Everything downstream follows from these. Two are shaped by your constraints — the HRIQ API cost and PDPA — and the rest enforce the human-accountability model from the requirements spec.
The Portal reads from its own database, kept current by scheduled batch extraction from HRIQ. The expensive live API is avoided except for rare, high-value writes.
Backend in Python to reuse your existing extraction scripts and team familiarity. Your scripts become the ingestion backbone, not throwaway tooling.
A model never sees raw personal data it doesn't need, and never performs statutory or financial math. A gateway scrubs every prompt that crosses the trust boundary.
Payroll, levy, CPF, encashment and compensation run as tested Python code with traceable breakdowns — never an LLM.
Personal data is hosted in-region, the Portal is not publicly routable, and every action is written to an immutable audit log.
Your existing Python-to-Excel extraction is productionised into a scheduled pipeline. Extracted files land in a secure zone, are validated against a schema, then loaded into the Portal's operational store. The Portal queries that store — fast, and free of per-call API charges.
A conventional, boring-on-purpose layered design. Boring is correct for a compliance system — every layer is independently testable and the trust boundaries are explicit.
Chosen for PDPA fit, your Python capability, and longevity over novelty. All mainstream and hireable — important for the maintenance-ownership concern.
| Layer | Recommendation | Why |
|---|---|---|
| Frontend | React + TypeScript (Next.js) | Mature, component-driven, accessible; easy to find developers. |
| Backend | Python + FastAPI | Reuses your existing extraction scripts & team skills; fast, typed, well-documented. |
| Database | PostgreSQL | Relational integrity for payroll/audit; row-level security supports RBAC; strong encryption & backup tooling. |
| Background jobs | Celery or APScheduler + Redis | Runs scheduled extraction, monitoring scans, report generation. |
| Object storage | Encrypted blob store (scanned passports, medical records, letters) | Keeps large/sensitive files out of the relational DB; per-object access control. |
| Calculation engine | Pure Python module, 100% unit-tested | Deterministic statutory/financial math, isolated from AI and from the web layer. |
| Auth / SSO | OIDC / SAML (e.g. Microsoft Entra ID) + MFA | Likely already your corporate identity; restrict to the HR security group. |
| AI gateway | Internal service wrapping the model API | Single chokepoint for PII scrubbing, logging, purpose checks (§5). |
| LLM | Region-hosted, no-training endpoint (e.g. Azure OpenAI SG) or self-hosted open model for sensitive flows | Keeps inference in-region under a data-processing agreement; never a consumer endpoint. |
This is the part that protects you. The rule: the model only ever receives the minimum it needs, de-identified, through one auditable gateway — and it is never trusted with a calculation or a final decision.
| Control | Implementation |
|---|---|
| Access | SSO restricted to the HR security group; MFA enforced; Portal not publicly routable (corporate network / zero-trust access only). |
| Authorisation | App-level RBAC for the six roles + PostgreSQL row-level security so a query cannot return out-of-scope rows even if app logic fails. |
| Coverage mode | Temporary delegated access implementing the cross-training matrix (Payroll↔FW, FW→Staff, Staff→Payroll): Manager-approved, time-bounded, auto-expiring, and every action taken under delegation is flagged as such in the audit log. |
| Notifications | Time-critical alerts pushed to email/Teams; message content carries no sensitive personal data — it deep-links into the portal where RBAC applies. Unacknowledged critical alerts escalate up the reporting line. |
| Encryption | TLS 1.2+ in transit; AES-256 at rest for DB, object store and backups. |
| Secrets | Managed secrets vault (DB creds, model keys, HRIQ creds); no secrets in code or config files. |
| Audit | Append-only, tamper-evident log of every data change, AI call and human approval — user, timestamp, before/after. |
| Retention | Automated enforcement of the Employment Act retention clock with scheduled purge + pre-purge review. |
| Breach | Anomaly alerts (unusual access/export) + a documented PDPC-aligned breach-response workflow. |
| Residency | All personal data stored and processed in Singapore region, including the AI endpoint. |
| Assurance | Independent security review + penetration test before any phase that handles personal or financial data goes live. |
CVs are the single input to recruitment; AI does the data entry. Whether a candidate uploads through the public application page or HR uploads an agency/walk-in CV, the file follows one pipeline: stored encrypted, parsed by AI into structured fields, written to the database, and scored for fit — no manual keying.
The portal is HR-only, but the job scopes involve several non-HR actors. None of them get portal accounts — each gets a purpose-built channel. The secure one-time link pattern (single-purpose, expiring, no login, minimal data) serves every "respond to one question" case.
| Actor | Interaction | Channel |
|---|---|---|
| Hiring managers | Review shortlisted CV, register interest | One-time link (outbound email → response recorded in Recruitment) |
| Site supervisors | Confirm missing/abnormal OT entries; leave-coverage coordination | One-time link or email digest from the Assistant's chase queue |
| Candidates | Apply, upload CV, receive invites & offers | Public application page (§6B) + outbound email |
| EHS department | Incident reports in (trigger claim cases); weekly OT exception report out (fatigue monitoring) | Structured intake (form/file drop) inbound; scheduled report delivery outbound |
| Finance | Wage-subsidy/grant reconciliation; grading flags | File exchange / shared reports (INT-04) |
| Operations | Site-deployment data for tender cross-checks & headcount reconciliation | Batch file exchange (INT-04) |
| Head of HR / Director | Approvals above Manager DOA tier; HR Assurance Summary | Head of HR is a portal user; Director receives escalations via the Head of HR |
[EMPLOYEE_1], [AMOUNT_1]; only the skeleton crosses to the model.Note flow B touches no LLM at all — the highest-value monitoring is pure deterministic code. AI is the assistant, not the engine.
| Decision | Options / note |
|---|---|
| Cloud vs on-prem | Cloud SG-region (recommended, faster/cheaper) vs on-prem if company policy forbids cloud for HR data. |
| Identity provider | Confirm Entra ID / Google Workspace / other — drives SSO & possibly hosting. |
| Self-hosted vs API model | API model (simpler, region-locked) vs self-hosted open model (max data control, more ops). Can mix per sensitivity. |
| Extraction cadence | How fresh must each dataset be? Drives schedule and intra-day delta design. |
| Existing scripts | Share current Python extraction scripts so they can be assessed and folded into the ingestion layer. |