M Modules
Reusable, composable modules for Framework M applications.
Philosophy: Base App vs Plugin
Section titled “Philosophy: Base App vs Plugin”
business-mis the Base App. It provides domain primitives — focused, reusable, composable cores likem-core(Party, Item, Address). Products likewms,crm,fna, and regional compliance likem-indiaare Plugins / Extension Apps.
🧪 Showcase: Progressive Decomposition
Section titled “🧪 Showcase: Progressive Decomposition”Business M is a living laboratory for Progressive SOA. It demonstrates how a single codebase can scale:
- Monolith (Indie): Local SQL JOINs for maximum consistency.
- Macroservice (RPC): NATS Request/Response for distributed domain lookups (Showcased in Finance).
- Autonomous Microservice (CQRS): Event-driven projections for high-throughput survival (Showcased in WMS - Distribution Centers resolving Outlets).
Available Modules
Section titled “Available Modules”| Module | Description | Depends On | Status |
|---|---|---|---|
| m-core | Party, Address, Item, UOM | - | 🔄 Planning |
| m-invoice | Invoice DocTypes | m-core | 🔄 Planning |
| m-ledger | Port/Adapter for Book-Keeper/Stock-Keeper | - | 🔄 Planning |
| m-hr-core | Employee, Designation, PayScale | m-core | 🔄 Planning |
Regional Compliance
Section titled “Regional Compliance”| Module | Description | Depends On | Status |
|---|---|---|---|
| m-regional | Port Specification for Compliance | - | ✅ Defined |
| m-india | India GST, E-Invoice, GSTR Adapter | m-invoice, m-regional | 🔄 Planning |
| Extension Guide | How to plug in regional logic | - | 💡 Guide |
Other Modules
Section titled “Other Modules”| Module | Description | Depends On | Status |
|---|---|---|---|
| m-imprest | Cash/Imprest Account Management | m-ledger | 🔄 Planning |
| m-leave | Leave Types, Applications, Credits | m-hr-core | 🔄 Planning |
| m-medical | Medical Claims (Form 97) | m-hr-core | 🔄 Planning |
| m-pension | Pension Lifecycle (PPPO→FPPO) | m-hr-core, m-ledger | 🔄 Planning |
How Modules Work
Section titled “How Modules Work”1. Apps Import Modules
Section titled “1. Apps Import Modules”[project]dependencies = [ "framework-m", "m-invoice", # Core invoicing "m-india", # India GST (optional)]2. Modules Export DocTypes
Section titled “2. Modules Export DocTypes”from .doctypes import PurchaseInvoice, SalesInvoice, InvoiceItem3. Apps Use DocTypes
Section titled “3. Apps Use DocTypes”from m_invoice import PurchaseInvoice
async def receive_goods(supplier_id: str, items: list): invoice = PurchaseInvoice( supplier=supplier_id, items=items, ) await invoice.save()Module Guidelines
Section titled “Module Guidelines”- Single responsibility — One domain per module
- No app-specific logic — Generic, reusable
- Optional dependencies — e.g., m-india requires m-invoice
- Event-driven — Publish events, don’t call apps directly
- Book Keeper integration — Use ledger for financial data