(01) work
Build once. Scale forever.
What it is
Framework M is an open-source Python framework for building multi-tenant enterprise applications. You describe your data as DocTypes, and the framework generates the REST API, validation, role-based permissions, database schema and CRUD UI from that one definition. The M stands for modular, multi-tenant and metadata-driven. It is in beta and released under the Apache 2.0 licence.
The problem it solves
Batteries-included frameworks make the first months fast. The trouble starts later, when an application needs multi-tenancy, enterprise sign-in, or a deployment that spans more than one service. The project calls this the productivity cliff, and its answer is a "zero cliff" architecture: keep the fast start of DocTypes, automatic CRUD, permissions and workflows, but build it on enterprise-grade foundations from day one.
How it is built
The core uses hexagonal architecture, also called ports and adapters. Business logic talks to ports; adapters plug real infrastructure into them. That lets an application start as a modular monolith and split into microservices later without a rewrite.
- Runtime: async Python 3.12+, Litestar, SQLAlchemy 2.0 and Pydantic v2, with PostgreSQL by default.
- Adapters: events on Redis, NATS, Kafka or RabbitMQ; storage on local disk, S3, MinIO or Azure Blob; identity through SQL auth, JWT, Keycloak, Okta or Azure AD.
- Desk UI: React, TypeScript and Refine, generated from the DocTypes and updated in real time over WebSockets.
- Quality: strict typing with mypy, test-driven development, and 19 recorded architecture decisions.
Everyday work happens through the m command:
m new app
m new doctype
m migrate
m dev
m prod
What I built
- Architected the async, metadata-driven core on hexagonal architecture, so apps can start as a modular monolith and split into microservices without a rewrite.
- Implemented DocType-driven development with Pydantic: one model definition generates the REST API, validation, role-based permissions, database schema and CRUD UI.
- Designed pluggable adapters for storage, authentication (OIDC and Keycloak), events (Kafka), caching and multi-tenancy, on a Kubernetes-ready, PostgreSQL-backed async runtime.
- Enforced strict typing and test-driven development, and shipped the docs, a browser playground and one-click dev environments.
How it compares
| Compared with | What Framework M adds |
|---|---|
| Frappe / ERPNext | Adds an async runtime, hexagonal architecture, native multi-tenancy, OIDC-ready auth and Kubernetes-native deployment. Built on lessons learned from Frappe. |
| Django + DRF | Adds the DocType abstraction, automatic CRUD, built-in permissions, a workflow engine and multi-tenancy without building them from scratch. |
| FastAPI / Litestar | Adds a business application layer (DocTypes, controllers, permissions, reporting, workflows) on top of an async framework. |
| Odoo | Fully open source under Apache 2.0, with a modern Python stack and cloud-native architecture. |
| Low-code platforms | Full code ownership, on-premise deployment, no vendor lock-in, and extensible with standard Python. |
Source: Framework M README
If you know Frappe
| Frappe | Framework M |
|---|---|
| bench new-app | m new app |
| bench new-doctype | m new doctype |
| bench migrate | m migrate |
| bench start | m prod |
Outcome and links
- test coverage, backend and frontend combined
- 98.51%
- type hints
- 100%
- architecture decision records, all implemented
- 19
- Python
- 3.12+