Skip to content

System context — Frappe, ERPNext, Lee Kim, and docs

Situate Lee Kim customizations within the same mental model as ERPNext and the Frappe Framework: web app, background jobs, database, and external services. This page also shows that this documentation site (Astro + Starlight on Cloudflare Pages) is not part of the ERP runtime.

Optional — repo

Documentation — separate deploy

External services

Frappe site — production

Users

Desk / Portal users

Developers

Frappe web + Desk UI

Scheduler / background workers

Whitelisted API — leekimerp.api

hooks.py — doc_events / cron

leekimerp app — DocTypes & scripts

erpnext / hrms apps

MariaDB

Xero

Stripe

DocuSign

ACRA / email / PDF…

Astro + Starlight

Cloudflare Pages

Custom socket.io

Notes

  • Desk is the standard Frappe/ERPNext UI; custom Pages and Print Formats extend it per site.
  • Lee Kim logic lives mainly under leekimerp/lee_kim_alliance_erp/, leekimerp/api/, and leekimerp/hooks.py.
  • The handover docs you are reading are static HTML; they do not process ERP transactions.

Understanding trust zones prevents accidental exposure of PII, financial data, or integration tokens.

ZoneTypical actorsTrust assumption
Desk (authenticated)Staff users with Frappe rolesSession + permission model; audit via Doc revision
Website / portalCustomers or applicantsOften limited DocTypes; may use guest APIs — treat as semi-trusted
Integration callbacksXero, Stripe, DocuSign, SingpassVerify signatures / OAuth state; never trust raw payload without checks
Background workersScheduler, email queueRun as site context; can mutate data without a human click
Docs site (static)Developers, auditorsUntrusted for secrets — must not embed credentials

Implication: Any @frappe.whitelist(allow_guest=True) endpoint sits on the boundary between public internet and your database. Maintain an explicit list (API inventory) and review periodically.

Use this as a working model for runbooks and access reviews (refine with your DPO):

ClassExamplesHandling
PublicMarketing copy, non-sensitive FAQsNormal web caching OK
InternalInternal notes, non-PII operational metricsDesk roles
ConfidentialCustomer financials, payroll, incorporation documentsStrict roles; encryption at rest via Frappe; limit exports
Regulated identifiersNRIC/FIN patterns, government IDs (where applicable)Minimize storage; follow local PDPA / sector rules

Singpass and MyInfo flows often involve regulated identifiers — treat related DocTypes and logs as highest sensitivity.

When an external system is down, the ERP should fail safely:

DependencyUser-visible symptomEngineering response
Xero APISync lag, invoice mismatchSurface status in DocType; queue retries; avoid double-posting
StripePayment link errorsDo not duplicate invoices; check webhook idempotency
Email providerMissing notificationsMonitor email queue; alert ops
MariaDBFull outageStop-the-line; restore from backup (Runbook)

Document SLOs (even informal) in your internal ops wiki; this handover site does not replace live monitoring.

Some deployments pair a Node / socket service with Frappe for realtime UI updates. If present in the repo (sockets/ or root package.json), treat it as a separate process with its own deploy and health checks — see Socket.io realtime.