This project delivers an offline-first Point of Sale (POS) for ERPNext v15/v16, built with Kotlin Multiplatform (KMP) to share business logic and UI across Android, iOS, and Desktop.
- Create and manage Sales Invoices and Payments.
- Manage POS cashbox opening/closing operations.
- Keep local catalog, customers, pricing, and stock for offline work.
- Sync local pending operations with ERPNext when connectivity returns.
Layers in shared commonMain:
- UI (
ui/,views/,navigation/) - Domain (
domain/models,domain/usecases) - Data (
data/repositories,data/mappers) - Local (
localSource/entities,localSource/dao,localSource/relations) - Remote (
remoteSource/api,remoteSource/dto,remoteSource/sdk) - Sync (
sync/SyncManager.kt,sync/SyncWorker.kt)
- Shared code:
composeApp/src/commonMain/kotlin/com/erpnext/pos - Android:
composeApp/src/androidMain - iOS:
composeApp/src/iosMainandiosApp/ - Desktop:
composeApp/src/desktopMain
- Local-first writes with sync status tracking (
PENDING,SYNCED,FAILED). - Push pending local documents to ERPNext.
- Pull incremental updates and reconcile local state.
docs/project_full_flow.mddocs/tools_and_stack.mddocs/business_and_sync_flows.mddocs/erpnext_whitelisted_dto_contract.mddocs/dto_field_matrix_v1.mddocs/api_endpoint_inventory.mddocs/multi_instance_login_and_session.mddocs/function_diagram.md
This repository includes versioned hooks in .githooks/.
- Install hooks once per clone:
./scripts/install-git-hooks.sh- What runs automatically:
pre-commit: runs Spotless only on staged.kt/.kts, auto-applies format, re-stages files, then validates.pre-push:./gradlew spotlessCheck detekt test :androidApp:compileDebugKotlin
- Emergency bypass:
SKIP_GIT_HOOKS=1 git commit -m "..."
SKIP_GIT_HOOKS=1 git push- Spotless + ktfmt for code format (
.ktand.gradle.kts). - Detekt for static analysis with baseline per module:
composeApp/detekt-baseline.xmlandroidApp/detekt-baseline.xml- configured as blocking (
ignoreFailures=false) to prevent new debt from being merged.
- Dependabot for automated dependency update PRs (Gradle + GitHub Actions).
./gradlew spotlessCheck
./gradlew spotlessApply
./gradlew detektGitHub Actions workflows:
Quality Gate: runs on PR/push and executesspotlessCheck,detekt,test, and:androidApp:compileDebugKotlin.- Dependabot (
.github/dependabot.yml): weekly automated dependency PRs for Gradle and GitHub Actions.