Skip to content

Start guide — documentation map & code reading order

Single entry point for developers taking over the codebase: where to read first, how docs map to folders, and how requests and batch jobs flow through Frappe and custom code.

  • Backend engineers familiar with Python and ideally Frappe / ERPNext.
  • Anyone who needs to change integrations (Xero, Stripe, DocuSign), payroll hooks, or Lee Kim–specific DocTypes.

This site is grouped into Start, Tutorial, Reference, and Operations. Use Reference for facts and schema; use Tutorial for guided paths and scenarios.

Operations

Deployment & security

Reference

Platform primer

Architecture & stack

Modules & integrations

DocType reference — generated

API, hooks, overrides

Tutorial

Reading order & code map

Scenario: Billing → Xero

Scenario: Payroll

Start

Start guide — this page

Overview & how to read

Deliverables

The Git repo root contains the Frappe app leekimerp/ and this docs site under docs/. A separate socket.io stack may live at repo root (sockets/ / package.json); see Socket.io realtime.

Repo root

leekimerp/ Frappe app

docs/ Astro + Starlight

sockets/ optional

hooks.py

api/

lee_kim_alliance_erp/

1. Reference vs implementation

2. Platform primer

3. Architecture overview + request flow

4. Module catalog + Lee Kim overview

5. DocType reference — skim by category

6. Integrations you will touch — Xero / Stripe / payroll

7. API inventory + doc events + schedulers

Details: Reading order & code map.

How a Desk / HTTP request reaches your code

Section titled “How a Desk / HTTP request reaches your code”
Module Python / api/*.pyhooks.py / doc_eventsFrappe web serverBrowser / API clientModule Python / api/*.pyhooks.py / doc_eventsFrappe web serverBrowser / API clientHTTP / RPC / whitelisted APIRoute to handlerDoc save / validate / on_updatetasks.run / hook methods

End-to-end touchpoints span Billing, Sales Invoice, custom Xero helpers, and webhooks. See the full walkthrough: Scenario: Billing → Xero.

Billing Paid

Application / services

Sales Invoice — if used

Xero sync / invoice

Xero webhook

Use this as a default ramp; your tech lead may reorder by business priority.

  • Read Reference vs implementation so you know where the commercial template ends and repo facts begin.
  • Skim Platform primer and confirm your local Bench can run the app (Deployment & operations).
  • Open leekimerp/hooks.py and note: doc_events, scheduler_events, after_migrate, and any override_doctype_class entries — these are extension points you will touch again.
  • Do not change production integration keys on day one; use UAT or read-only inspection.
  • Deep-read Xero, Stripe, and Singpass — even if you do not work on all three, they illustrate webhook + OAuth + guest API patterns used elsewhere.
  • Cross-check Whitelisted API inventory for allow_guest=True surfaces; file follow-ups if production exposure is unclear.

Documentation vs code — how to resolve drift

Section titled “Documentation vs code — how to resolve drift”
SituationAction
Doc says a method exists; grep does not find itSearch leekimerp/api/ for renames; update docs or log an ADR if behavior intentionally changed (Architecture decisions).
DocType field table differs from DeskPrefer JSON in repo (*.json under doctype/) over static HTML; regenerate DocType reference if your pipeline supports it.
Integration behavior changed with ERPNext upgradeAdd an ADR; re-run integration tests and attach Test evidence.

Environment variables and config (conceptual)

Section titled “Environment variables and config (conceptual)”

Frappe sites rarely use a single .env file for everything. Typical patterns:

LayerWhere names appearNotes
Bench / sitesite_config.jsonDB, encryption key, sometimes integration secrets
App DocTypesXero / Stripe / DocuSign / Singpass settingsOften per-company or per-site
Docs build onlyPUBLIC_SITE_URL for AstroNot used by ERP runtime

Never commit secrets. Use Environment matrix as the checklist of what exists, not values.

Pick a read-only task first: e.g. add logging around an integration branch in UAT, or extend a DocType list view filter with QA sign-off. Avoid schema changes and guest API changes until you understand Security checklist.

AreaRiskMitigation
Guest HTTP APIsAbuse, data leakageInventory + network controls + rate limits
Webhooks (Xero, Stripe)Signature mismatch, duplicate processingIdempotent handlers; monitor Error Log
Scheduler jobsSilent failure, duplicate emailsMonitor job logs; test in staging
DocType overridesBreak on ERPNext upgradePin versions; read upstream diffs
GoalPage
Frappe vs ERPNext vs this appPlatform primer
System context (runtime + docs site)System context
Sidebar groups → features & codeFeature inventory by category
Link-level ERD (Mermaid)ER diagrams by domain
Which diagrams to add nextDiagram roadmap
Step-by-step code pathsReading order & code map
Field-level schemaDocType reference
Naming rules for docsDocumentation conventions
DocType documentation strategyDomain documentation strategy