MDMCore documentation
MDMCore is a Kotlin Multiplatform Mobile Device Management (MDM) system. A server holds the desired policy for each device; an Android agent (a Device Owner / DPC) pulls that policy, enforces it, and reports back what it actually observes; a Compose Multiplatform console views and edits policy. Everything speaks one shared, compiler-checked wire contract.
If you read nothing else, read The MDM loop — it’s the whole system in one page.
Reading order
- Architecture — the four parts, the module dependency star, and the design principles that hold it together.
- The MDM loop —
enroll → pull → enforce → report → detect drift, with sequence and state diagrams. - Protocol — the shared wire contract: every message type, the single compliance rule, and the canonical JSON config.
- HTTP API — every server endpoint: method, path, request/response, status codes.
- Components, one per part:
- The FCM doorbell — how a policy change wakes a device (push wakes, HTTP moves the data).
- Firebase setup — getting FCM working on the server and the agent.
- Development — build, run, and test every module; version catalog; an end-to-end recipe.
- Troubleshooting — the failures you’ll actually hit, and their fixes.
Document map
| Document | What it answers |
|---|---|
| architecture.md | What are the parts and how do they depend on each other? |
| mdm-loop.md | How does desired policy become enforced reality, and how is drift detected? |
| protocol.md | What exactly travels on the wire, and why can’t the parts disagree? |
| http-api.md | What are the endpoints and their request/response shapes? |
| server.md | How does the brain store policy and decide compliance? |
| agent.md | How does the Android agent enforce policy as Device Owner? |
| console.md | How does the console view and edit policy across desktop/web? |
| fcm-doorbell.md | How does a change reach a device without polling? |
| firebase-setup.md | How do I configure the service-account key and google-services.json? |
| development.md | How do I build, run, and test it — and run the whole loop? |
| troubleshooting.md | Why is enforcement / push / the build not working? |
Related files (not in docs/)
../README.md— project front page: overview + quick start that links back here.../CLAUDE.md— guidance for AI contributors (Claude Code). It overlaps with these docs but is written for an automated contributor and carries repo-specific working rules.../SOURCES.md— the external documentation (Android, Firebase, Ktor, Kotlin) that the design was grounded in, with the exact pages and Knowledge-Base ids used.
Conventions in these docs
- Code references point at the source as
path:line, e.g.protocol/src/commonMain/kotlin/com/arganaemre/mdmcore/protocol/Policy.kt. - Diagrams are Mermaid fenced code blocks. GitHub and Azure DevOps render them inline; anywhere else they remain readable as text.
- The docs describe the system as it is in the code, not aspirations. Where only one policy (camera) is enforced today, the docs say so.