Multi-tenancy is the foundation of every B2B-ish app, but grit new doesn't have it. Adding it after the scaffold is painful — you have to retrofit Org + Membership tables, sprinkle orgId scoping through every handler, add an org switcher to the frontend, write the invite flow, etc.
Across 18 starter-kit build plans I'm shipping, 6 of the Grit-based ones need this from day one: CRM, Agent Control, ERP, High-Scale Marketplace, IoT Console, LMS-style multi-instructor.
Proposed fix:
New grit new ... --multitenant flag that:
- Generates
Organisation + Membership + Invitation models with Casbin role policies (Owner / Admin / Member / Viewer)
- Adds a
RequireOrgMembership middleware that scopes every protected handler to the org in the URL prefix (/o/:slug/...)
- Scaffolds org switcher + invite flow on the frontend (works with both
--next and --vite)
- Updates
grit generate resource to ALWAYS include an orgId foreign key when multi-tenancy is on
Saves every B2B-ish Grit user a week of setup.
Multi-tenancy is the foundation of every B2B-ish app, but
grit newdoesn't have it. Adding it after the scaffold is painful — you have to retrofit Org + Membership tables, sprinkleorgIdscoping through every handler, add an org switcher to the frontend, write the invite flow, etc.Across 18 starter-kit build plans I'm shipping, 6 of the Grit-based ones need this from day one: CRM, Agent Control, ERP, High-Scale Marketplace, IoT Console, LMS-style multi-instructor.
Proposed fix:
New
grit new ... --multitenantflag that:Organisation+Membership+Invitationmodels with Casbin role policies (Owner / Admin / Member / Viewer)RequireOrgMembershipmiddleware that scopes every protected handler to the org in the URL prefix (/o/:slug/...)--nextand--vite)grit generate resourceto ALWAYS include anorgIdforeign key when multi-tenancy is onSaves every B2B-ish Grit user a week of setup.