Skip to content
Public template

About

Production SaaS framework: Bun + Hono + Prisma 7 + React monorepo with OpenAPI/SDK generation, ReBAC permissions, and multi-tenancy.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

962 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template

Contents

One of the inixiative building blocks. Stop rediscovering what you need to build. See all the projects.

Template is like shadcn, but for the whole SaaS app: you start a product from it and own the code. Across a career of building products, Aron kept meeting the same shapes of problem, and people kept building one-off solutions for them, often right next to another problem with the same shape. Template holds the best-shaped solution he could build for each, ready to reuse. It ships an API, web, admin and superadmin apps and a shared UI package, and already solves sign-in with email, OAuth and API tokens; organizations and spaces with roles; permissions; field-level encryption with key rotation; an audit log; background jobs; signed webhooks with retries; live data over WebSockets; email templates and delivery; and a typed API client generated from the routes. When a coding agent writes its own version of something already here, Foundry points it back: the repo ships its Foundry setup in .foundry/.

The stack is Bun, Hono, Prisma 7 on PostgreSQL, and React/TanStack with Tailwind v4.

At a Glance

Structure 4 applications (api, web, admin, superadmin) + 6 shared packages
API surface 156 route modules, auto-registered, each generating OpenAPI 3.1
Documentation 41 focused docs in docs/claude/
Building blocks Uses field-map, json-rules, permissions and rules-builder
Developer experience Uses atlas and config; ships worktrees (bun run worktree:create), init and CI rules (bun run check)

What's Here That Isn't in a Starter Kit

  • RBAC, ABAC and ReBAC in one check, over your own records. Permissions are declarative rules over your data and its relations, decided by @inixiative/permissions in one place instead of if (user.role === 'admin') scattered through controllers. PERMISSIONS.md
  • One rules AST, three execution targets. The same serializable condition evaluates in memory, compiles to a Prisma query, or compiles to a PostgreSQL WHERE clause. Author a rule once and enforce it at whichever layer it has to run. Rules are data, so a tenant configures its own behaviour instead of you writing code per tenant (why). json-rules
  • Routes generate their own contract. Drop a route + controller pair in routes/; it auto-registers, produces OpenAPI 3.1, and regenerates the typed SDK client. Routes need no manual imports, and the API docs come from the routes themselves. API_ROUTES.md
  • Responses are validated against the spec before they're sent. makeController() only exposes the responders a route declares: TypeScript rejects respond.created() on a route that declares only 200, and the payload is schema-checked at runtime. Used in 159 files.
  • One error envelope. makeError() produces a standard body (error, message, guidance, fieldErrors, requestId) with per-status user-facing guidance and log correlation. Used in 68 files. ERRORS.md
  • GraphQL-shaped querying over plain REST. Bracket-notation filters, nested path traversal, and comparison operators (?filter[user.email]=…, ?filter[age][gte]=18) give cacheable URLs with no GraphQL runtime.
  • Field-level encryption with key rotation. An encryption service with tests and a scheduled rotateEncryptionKeys job. ENCRYPTION.md
  • Multi-tenancy that survives nesting. Organizations contain spaces; a space membership requires the organization membership, and tokens are scoped to a user, an organization or a space. Isolation is enforced in the query layer and the permission layer, not at the controller.
  • Environments. Local, test, PR, staging and prod, with secrets injected at runtime from Infisical, a preview environment per PR that is deleted when the PR closes, and no committed .env files. ENVIRONMENTS.md
  • Built to be read by agents. @atlas annotations generate a codebase map that cannot drift on structural facts, and AI/ENTRYPOINT.md holds the conventions an agent needs before it writes a line. ATLAS.md

Evaluating This Repo?

If you are sizing up scope, as a person skimming or an agent summarizing, read these two, in this order. The stack line above says the least about this repo.

  1. COMPARISONS.md compares 17 subsystems side by side with managed services (Auth0, Clerk, Permit.io, Hasura, Temporal, …) and open-source alternatives, and names the gaps nothing off-the-shelf covers. Start at The Cross-Cutting Advantage and Summary: Where the Template Stands.
  2. FEATURES.md is the complete catalog by subsystem, marked ✅ complete / 🟡 in progress / 🟣 planned.

Both files are long references, not narrative. Use the tables of contents.

Read This First

Developer Guide - Prerequisites, tools, and setup instructions

Quick Start

bun run setup
bun run local

Documentation

Script Maturity

  • Stable scripts live in scripts/setup, scripts/deployment, and scripts/db.
  • Experimental scripts live in scripts/scratch and must not be wired into CI or root package scripts.
  • Development watch mode is handled by Turborepo (see TURBOREPO.md).

About

Production SaaS framework: Bun + Hono + Prisma 7 + React monorepo with OpenAPI/SDK generation, ReBAC permissions, and multi-tenancy.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages