03. Development Standards

Core Standards (Start Here)

Core Principles

  1. Evidence over assumption

  2. Reuse existing stable patterns before inventing new ones

  3. Journey UI first for consistency

  4. Deterministic, testable data handling

  5. No silent failures

  6. Minimal-disruption improvements

Mobiloan Decision Framework

A) Build New vs Reuse

  1. Search for similar feature/pattern in repo

  2. Reuse unless clearly broken

  3. New pattern only if:

    • removes repeated bugs/complexity

    • applicable in at least 3 places in 30 days

    • documented and test-backed

B) UI Component Choice (Journey-first)

  1. Use Journey component where possible

  2. Else compose from Journey primitives

  3. Only then use custom UI with reusable wrapper + docs

C) Data Storage: Local vs Remote

  1. Critical and offline-sensitive flows: local-first + sync

  2. Enforce retention limits for list/history growth

  3. Multi-tenant/white-label values via config mapping, never hardcoded

D) API Change Decision

  1. Extend existing service wrapper first

  2. New endpoint must include validation, error mapping, retries, logging

  3. Avoid endpoint sprawl by consolidation

E) Error Handling

  1. User-actionable errors: clear message + recovery action

  2. Transient errors: retry/backoff + non-blocking status

  3. Logic errors: contextual logs + fail-fast in dev

F) Performance

  1. Assume low-end mobile constraints

  2. Lists >50 items: paginate/virtualize

  3. Network-heavy views: dedupe, cache, cancel stale work

Naming and Structure (Initial Baseline)

  • Views: mobile/<domain>*.view.xml

  • View logic: mobile/<domain>*.js

  • Shared app helpers: mobile/app.js

  • Backend units: cloudcode/<module>/index.js

Detailed naming conventions will be finalized after full repo-wide architecture extraction.

Last updated