Skip to content

Packages

Machize is a set of small, focused packages under the @machize/* scope. Each works on its own; together they form the framework. Versions move in lockstep.

Foundation

PackagePurpose
@machize/coreDI container, plugin lifecycle, AsyncLocalStorage context, hooks
@machize/configNamespaced, typed configuration with dot-path access
@machize/envZod-validated environment variables with an aggregated report
@machize/eventsTyped domain event bus with wildcards and priorities
@machize/loggerPino logger, auto-enriched with request/tenant context, redaction

Infrastructure

PackagePurpose
@machize/fastifyHTTP adapter — typed routes, request enrichers, route guards
@machize/prismaTenant-scoping client extension, per-tenant LRU client pool, ctx().db
@machize/cacheRedis/Memory drivers, tags, TTL, stampede protection, per-tenant keys
@machize/queueBullMQ jobs with Zod payloads and context propagation to workers
@machize/schedulerFluent cron: schedule.job(X).daily().at('03:00')
@machize/storageS3/MinIO/local under one contract, tenant isolation, signed URLs
@machize/mailerTyped declarative mails, SMTP/log/memory drivers, tenant sender
@machize/cliThe mach command framework

SaaS domain

PackagePurpose
@machize/tenancyResolvers, per-request tenant context, lifecycle hooks
@machize/authPassword hashing, JWT with refresh rotation, sessions, /auth routes
@machize/permissionsRoles, wildcard permissions, policies, tenant scoping, super admin
@machize/subscriptionsPlans, trials, feature limits, gateway drivers, idempotent webhooks
@machize/auditAppend-only trail, auto-records hooks and domain events
@machize/activityUser-facing activity feed (Spatie Activitylog-style)
@machize/notificationsMulti-channel: in-app, mail, custom drivers, preferences

Developer experience & product

PackagePurpose
create-machizeProject scaffolder
@machize/testingcreateTestApp, mail/queue fakes, time travel
@machize/sdkType-safe client inferred from Zod endpoint definitions
@machize/generatormach make code scaffolding
@machize/adminHeadless admin kit — table/form/validation from Zod schemas
@machize/dashboardHeadless dashboard model — billing metrics, section registry
@machize/admin-reactReact binding: DataTable, ResourceForm, data hooks

The dependency rule

A package may only depend on packages in a lower layer (foundation → infrastructure → domain → product). Same-layer packages communicate through events and core contracts, never direct imports — which is why any package can be adopted on its own.

Released under the MIT License.