English | 简体中文 | 日本語
Nebutra

Sailor — Skip to production.

The production layer for agent-built software: auth, billing for global and China rails, multi-tenancy and an AI gateway in one command, running locally with zero keys. You own the code. Open source under Apache-2.0.

Nightly: scaffold from zero npm: create-sailor License: Apache-2.0 GitHub stars

Website · Docs · Compare · Discussions · LINUX DO

A real run of npx create-sailor@latest: download the template, write the project, print next steps

**You** — scaffold, then run it. No keys, no Postgres to install (PGlite runs locally): ```bash npx create-sailor@latest my-app cd my-app && pnpm dev # app :3001 · site :3000 · gateway :3002 ``` **Your agent** (Claude Code, Cursor, Codex, …) — install the skill, then ask it to build: ```bash npx skills add Nebutra/Nebutra-Sailor --skill sailor ``` | In the box | Where it lives | | --- | --- | | Billing: Creem for cards worldwide (merchant of record) + WeChat Pay / Alipay; subscriptions, credits, entitlements, usage | `packages/commerce/billing` | | Multi-tenancy: a `/// @rls` line in `schema.prisma` generates the Postgres policies (91 today) | `packages/platform/db`, `packages/iam/tenant` | | One API: Hono gateway mounted in Next at `/api` (one process), or deployed on its own | `backends/gateway` | | Auth: Better Auth with organizations, plus an OIDC identity provider | `packages/iam/auth`, `apps/idp` | | One provider per domain — Resend, S3-compatible storage (R2 / OSS), QStash, Redis, pgvector search, Sentry, PostHog, Turnstile. A key makes it live; without one it falls back locally | `nebutra status --json` | | Guards an agent can't quietly break: `AGENTS.md` / `CLAUDE.md` / `DESIGN.md`, Biome and shrink-only lint ratchets | `pnpm lint` | | Design system: `@nebutra/ui`, W3C DTCG tokens, 541 Geist icons, 7 brand languages, Storybook | `packages/design` | | China switch: `NEBUTRA_LOCALE=cn` puts WeChat Pay / Alipay first at checkout, Aliyun first for SMS, and the project ships an ICP footer and an AIGC notice component; OSS goes through the S3 adapter | `@nebutra/contracts/market` | | CLI: `nebutra status` for agents, device-flow `nebutra login` | `npx nebutra` | **Not in the box:** a provider menu (one adapter per domain — write your own against the interface), a hosting choice (you get Next `standalone` builds and Dockerfiles), phone-first sign-in (Better Auth's phone plugin is not wired yet), template upgrades by three-way merge, mobile or desktop apps, and a small codebase — this is a full monorepo, not a 50-file starter. Side by side with other starters: [nebutra.com/sailor/compare](https://nebutra.com/sailor/compare). **License:** Apache-2.0 — this repository, every npm package and the project you generate. Details in [License](#license).
## Tech Stack What create-sailor gives you: apps/web calls the Hono gateway at /api, which reaches Postgres with generated row-level security; each capability goes live with a key and otherwise falls back locally or stays off One answer per layer — what Nebutra runs in production ([ADR 2026-09-24](docs/architecture/2026-09-24-sailor-convergence.md)). | Layer | Choice | | --- | --- | | App | Next.js 16 · React 19 · TypeScript · Tailwind 4 | | API | Hono gateway (`backends/gateway`) · oRPC · Zod | | Data | Postgres + Prisma 7 · generated RLS · pgvector · ClickHouse (metering) · PGlite locally | | Auth | Better Auth (organizations) · OIDC provider (`apps/idp`) · CASL permissions | | Payments | Creem + WeChat Pay / Alipay | | Messaging | Resend · Twilio Verify + Aliyun SMS · QStash · Redis | | Storage | One S3-compatible adapter (Cloudflare R2, Aliyun OSS) | | Observability | Sentry · PostHog · OpenTelemetry | | UI | `@nebutra/ui` (Radix) · W3C DTCG tokens · Geist icons · Storybook | | AI | Vercel AI SDK · MCP · Python FastAPI service only for batch / ML work | | Tooling | pnpm · Turborepo · Biome · Vitest · Playwright · changesets |
## Platform Capabilities Sailor ships **one provider per domain** ([ADR 2026-09-24](docs/architecture/2026-09-24-sailor-convergence.md)): every platform package reads its keys from the environment and falls back to a local implementation without them, so `pnpm dev` works with an empty `.env`. Each package ships an in-memory implementation for tests and a strict TypeScript contract enforced by architecture tests under [tests/architecture/](tests/architecture/).
CapabilityPackageProviders (auto-detected)
Authentication@nebutra/authBetter Auth (organizations, passkeys)
Identity Provider@nebutra/oauthOIDC (oidc-provider) · Redis-backed sessions
Permissions@nebutra/permissionsCASL — RBAC + ABAC, Hono middleware, React <Can />
Multi-tenancy@nebutra/tenantAsyncLocalStorage context · Prisma RLS bridge
Captcha@nebutra/captchaCloudflare Turnstile
Vault (secrets)@nebutra/vaultAWS KMS envelope · local HKDF (dev)
Audit log@nebutra/auditAppend-only with hash chain
Cache@nebutra/cacheRedis over the Upstash REST protocol · in-memory
Rate limit@nebutra/rate-limitSliding window · token bucket (Upstash)
Queue@nebutra/queueQStash · in-memory
Search@nebutra/searchPostgres — pgvector + full-text
Storage / Uploads@nebutra/uploadsOne S3-compatible adapter (Cloudflare R2, Aliyun OSS) · local FS
Notifications@nebutra/notificationsBuilt-in dispatch — in-app · email · push · SMS · chat
Webhooks@nebutra/webhooksBuilt-in HMAC-signed delivery with retries
SMS@nebutra/smsTwilio Verify + Aliyun
Email@nebutra/emailResend + React Email templates
Billing@nebutra/billingCreem (cards worldwide, merchant of record) + WeChat Pay/Alipay — subscriptions, usage, entitlements
Metering@nebutra/meteringClickHouse real-time aggregation
Event bus@nebutra/event-busMulti-tenant Pub/Sub · Fan-out · Request-Reply
Saga orchestrator@nebutra/sagaNative TS workflows with auto-rollback compensations
Feature flags@nebutra/feature-flagsDatabase-backed with env-driven overrides
Design tokens@nebutra/design-syncW3C DTCG, git-only
Status aggregation@nebutra/statusOpenStatus · Atlassian StatusPage
Admin tooling@nebutra/admin-toolingThin admin (dashboard + impersonate only) + integration recipes for Retool, Metabase, Hex — Sailor expects you to use best-of-breed internal tools instead of self-building. See docs/admin/.

## Project Structure ``` Nebutra-Sailor/ ├── apps/ # User-facing apps (Next.js) │ ├── landing/ # Marketing site (nebutra.com) │ ├── web/ # Main SaaS dashboard (app.nebutra.com) │ ├── studio/ # Sanity CMS (studio.nebutra.com) │ ├── sailor-docs/ # Public product docs (nebutra.com/docs) │ ├── idp/ # Identity provider service (OAuth 2.0 / OIDC) │ ├── storybook/ # Component playground │ ├── mail-preview/ # Email template preview │ ├── sleptons/ # Sleptons companion app ├── packages/ # Shared TS libraries (categorized in W3b) │ ├── ai/ # 42 pkgs — e.g. agents, agent-runtime, ai-providers, startup-os, knowledge-rag, mcp │ ├── commerce/ # 9 pkgs — e.g. billing, metering, contracts, license, access-gate, waitlist │ ├── design/ # 9 pkgs — e.g. ui, tokens, design-tokens, brand, theme, icons, fonts │ ├── iam/ # 8 pkgs — auth, audit, vault, oauth, permissions, tenant, identity, captcha │ ├── integrations/ # 17 pkgs — e.g. queue, search, email, notifications, storage, webhooks, cache │ ├── ops/ # 5 pkgs — cli, create-sailor, preset, sanity, china-compliance │ └── platform/ # 21 pkgs — e.g. db, logger, repositories, rate-limit, feature-flags, i18n, status ├── backends/ # No-UI backends (split by language à la vercel/vercel) │ ├── gateway/ # TypeScript / Hono — BFF, auth, tenancy, routing │ └── python/ # FastAPI — only when ML/batch/specialized libs justify │ ├── _shared/ # Cross-service primitives (auth, db, queue client) │ └── ai/ # LLM, embeddings, agent orchestration ├── infra/ # Infrastructure (split by concern in W2.2) │ ├── iac/ # terraform + k8s + ecs + cloudflare + railway │ ├── runtime/ # nginx + docker + analytics + compose files │ ├── data/ # database (RLS) + clickhouse (init + dbt) │ └── ops/ # observability + deployment scripts ├── ops/ # Declared provider state per brand, checked daily by platform-reconcile ├── workflows/ # Event-driven business workflows (extracted in W2.3) │ ├── inngest/ # Serverless background jobs + cron │ └── pusher/ # Real-time messaging glue ├── e2e/ # Playwright E2E tests (smoke / golden / sleptons) ├── tests/ # Architecture invariants + load tests + UI governance └── docs/ # Architecture documentation ```
## Documentation Each component has its own README with setup instructions and API documentation:
Services AI
Packages Billing · Legal · UI · Tokens · Marketing UI · Brand · DB · Cache · Rate Limit · MCP · AI Providers · Analytics
Design Docs
Infrastructure Docker · Terraform · Inngest · Pusher · Observability

## CLI & Website ### Use the CLI from npm For new projects, start from npm instead of cloning and pruning the full monorepo: ```bash # Scaffold a new Sailor project npx create-sailor@latest npm create sailor@latest pnpm create sailor@latest bunx create-sailor@latest # Operate an existing Sailor project npx nebutra --help npm install -g nebutra ``` | Package | Use it for | | ------- | ---------- | | [`create-sailor`](https://www.npmjs.com/package/create-sailor) | Scaffold a new Nebutra Sailor project. Zero questions: the same converged stack every time (`--json` for agents and CI). | | [`nebutra`](https://www.npmjs.com/package/nebutra) | Operate an existing project: `status` (what is live, what needs a key), `sync`, `db`, `dev`, device-flow `login`. | ### nebutra.com [`nebutra.com`](https://nebutra.com) is the public product surface for Nebutra Sailor and the place where we dogfood the platform ourselves. We will use it to publish product updates, commercial licensing, hosted capabilities, launch workflows, and real examples built on this monorepo. The public tool station lives at [`forge.nebutra.com`](https://forge.nebutra.com) — codecs, text, hashing, documents, and image tools, with the same implementations available over API / MCP.
## Getting Started ### Prerequisites
Node.jsv22+
pnpmv11.28.5+
Python3.11+ (for microservices)
### Work on this monorepo To build a product, scaffold with `npx create-sailor@latest` (top of this page). Clone this repository to contribute to Sailor itself: ```bash # Clone the repository git clone https://github.com/Nebutra/Nebutra-Sailor.git cd Nebutra-Sailor # Install dependencies pnpm install # Set up environment variables cp .env.example .env # Generate Prisma client & run dev servers pnpm db:generate && pnpm dev ``` ### Commands | Command | Description | | ------------------ | -------------------------------------------- | | `pnpm dev` | Start all apps in dev mode | | `pnpm build` | Build all packages (auto-syncs brand assets) | | `pnpm lint` | Lint all packages | | `pnpm typecheck` | Type check all packages | | `pnpm db:studio` | Open Prisma Studio | | `pnpm brand:sync` | Sync brand assets to apps | | `pnpm brand:init` | Initialize white-label branding | | `pnpm brand:apply` | Apply custom branding |
## White-label Fork this repo and customize it for your own brand: ```bash # Interactive setup wizard pnpm brand:init # Add your logos to brand.config/assets/ # Apply your branding pnpm brand:apply ``` See [WHITELABEL.md](WHITELABEL.md) for full documentation.
## Contributing We love our contributors! Here's how you can help: | | | | -------------------- | ----------------------------------------------------------------- | | **Report Bugs** | [Open an issue](https://github.com/Nebutra/Nebutra-Sailor/issues) | | **Feature Requests** | Suggest new features via issues | | **Pull Requests** | Submit PRs for features or fixes | ### Development Workflow ``` 1. Fork the repository 2. Create a feature branch (git checkout -b feat/amazing-feature) 3. Commit your changes (git commit -m 'feat: add amazing feature') 4. Push to the branch (git push origin feat/amazing-feature) 5. Open a Pull Request ```
## Versioning & Release Cadence Every published package is in the **0.x range** while public APIs are still settling. Per [SemVer §4](https://semver.org/#spec-item-4), the major-version-zero contract means **any 0.x release may include breaking changes** — pin to an exact version (`"nebutra": "0.3.1"`) rather than a caret range in production until we cut a 1.0. - Versioning is driven by [changesets](https://github.com/changesets/changesets). Each PR that touches a published package must include a `.changeset/*.md` declaring patch/minor/major intent — CI enforces this gate. - Per-package `CHANGELOG.md` is generated by `changeset version` and committed alongside the version bump (see e.g. [`packages/ops/cli/CHANGELOG.md`](packages/ops/cli/CHANGELOG.md)). - The Release workflow is **manual** (`workflow_dispatch`) — no surprise releases on PR merges. We batch related changes and cut a coordinated release. - Pre-1.0 major API moves (e.g. CLI command renames, package categorization) ship as a **release candidate** first: `nebutra@0.4.0-rc.0` lands on the `next` dist-tag, soaks for ≥ 1 week, then graduates to `latest`. Install RCs with `npm i nebutra@next`. - npm publishes carry **provenance attestations** once npm trusted-publishing is enabled at the registry side (the workflow side is already wired — see [`release.yml`](.github/workflows/release.yml) `NPM_CONFIG_PROVENANCE: "true"`). Verify a published tarball with `npm view --json | jq .dist.attestations`. We will signal **API stability** by cutting a `1.0.0` release. Until then, treat the surface as "production-ready in shape, evolving in detail."
## License **Nebutra Sailor is open source under the [Apache License 2.0](./LICENSE).** That covers this repository, every published npm package (`@nebutra/*`, `nebutra`, `create-sailor`), the Sailor-Template mirror, and every project `create-sailor` generates (it ships the Apache-2.0 `LICENSE` and a `NOTICE`). Build a commercial product on it, keep your source closed, run it as a hosted service, fork it — all free, with no fee, licence key, registration or copyleft. When you redistribute the source, keep `LICENSE` and `NOTICE`, keep existing copyright notices, and mark the files you changed (Apache-2.0 §4). Trademarks are separate: Apache-2.0 does not grant them (§6). Naming your own product something unrelated needs no permission; using the Nebutra or Sailor names needs a trademark licence ([TRADEMARK.md](./TRADEMARK.md)). **Paid plans do not sell permission.** They sell what a code licence cannot give you: a support commitment, response SLAs, indemnification, compliance paperwork (DPA, security pack, continuity undertaking), and trademark rights. Community $0 · Team $2,000/yr · Enterprise from $30,000/yr — see [docs/legal/commercial-support.md](docs/legal/commercial-support.md). Copyright 2025–2026 Wuxi Nebutra Intelligence Technology Co., Ltd.. > Relicensed to Apache-2.0 on 2026-10-16 (previously FSL-1.1-ALv2 for the > repository and MIT for npm packages; AGPL-3.0-only before 2026-07-26). > Versions released earlier keep the licence they shipped with. See > [docs/legal/license-history.md](docs/legal/license-history.md). Licensing questions: **legal@nebutra.com** · [Licensing FAQ](docs/legal/licensing-faq.md) ### Brand Assets & Trademarks While the source code is open-source, the **brand assets** (the "Nebutra" name, "Nebutra Sailor", logos, icons, and illustrations) are protected trademarks of Wuxi Nebutra Intelligence Technology Co., Ltd. You may not use our brand assets to endorse your own products or services. If you clone or fork this repository to build your own product, you **must** replace all Nebutra logos and branding with your own. Please see our [Trademark Policy](TRADEMARK.md) and [Brand Guidelines](BRAND_GUIDELINES.md) for more information.
---
Nebutra

Every release, growth goes live.

Made by Nebutra Intelligence · © 2024-present Wuxi Nebutra Intelligence Technology Co., Ltd.


Website

X

Contact