@contractspec/example.saas-boilerplate
v3.8.25
Published
SaaS Boilerplate - Users, Orgs, Projects, Billing, Settings
Downloads
2,637
Readme
@contractspec/example.saas-boilerplate
Website: https://contractspec.io
SaaS Boilerplate - Users, Orgs, Projects, Billing, Settings.
What This Demonstrates
- Multi-domain SaaS architecture (billing, project, settings, dashboard).
- Per-domain entity/enum/event/handler/operations/presentation/schema pattern.
- React UI with hooks, modals, overlays, renderers, and dashboard.
- Contract-backed visualizations for portfolio status, tier mix, usage, and recent project activity.
- Feature definition, seeders, and test-spec patterns.
- RBAC, audit trail, and notification module integration.
src/docs/contains docblocks and documentation-facing exports.
Running Locally
From packages/examples/saas-boilerplate:
bun run devbun run buildbun run testbun run typecheck
Usage
Use @contractspec/example.saas-boilerplate as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
Architecture
src/billingis part of the package's public or composition surface.src/dashboardis part of the package's public or composition surface.src/docs/contains docblocks and documentation-facing exports.src/example.tsis the runnable example entrypoint.src/handlers/contains handlers or demo adapters wired to contract surfaces.src/index.tsis the root public barrel and package entrypoint.src/presentationsis part of the package's public or composition surface.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./billingresolves through./src/billing/index.ts. - Export
./billing/billing.entityresolves through./src/billing/billing.entity.ts. - Export
./billing/billing.enumresolves through./src/billing/billing.enum.ts. - Export
./billing/billing.eventresolves through./src/billing/billing.event.ts. - Export
./billing/billing.handlerresolves through./src/billing/billing.handler.ts. - Export
./billing/billing.operationsresolves through./src/billing/billing.operations.ts. - Export
./billing/billing.presentationresolves through./src/billing/billing.presentation.ts. - Export
./billing/billing.schemaresolves through./src/billing/billing.schema.ts. - Export
./dashboardresolves through./src/dashboard/index.ts. - The package publishes 48 total export subpaths; keep docs aligned with
package.json.
Local Commands
bun run dev— contractspec-bun-build devbun run build— bun run prebuild && bun run build:bundle && bun run build:typesbun run test— bun test --pass-with-no-testsbun run lint— bun lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsc --noEmitbun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rimraf dist .turbobun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun run prebuild— contractspec-bun-build prebuild
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
- Missing contract layers.
Notes
- Works alongside
@contractspec/lib.contracts-spec,@contractspec/lib.design-system,@contractspec/lib.example-shared-ui,@contractspec/lib.identity-rbac,@contractspec/lib.jobs, ...
