交互式 CLI 按数据库、部署运行时、邮件和支付选项生成项目配置,并自动禁用不兼容组合
Mystack — Vite 启动器模板
作者 0x0501
Mystack 是 TanStack Start 应用生成器与平台模板,通过交互式 CLI 选择数据库、部署运行时、邮件与支付方案,生成带认证、管理后台和国际化配置的项目。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
内置 Better Auth 认证,含邮箱密码、GitHub OAuth、Passkey 与 2FA
提供 OAuth 2.0/OIDC 身份提供方,暴露 RFC 发现元数据端点
基于角色的管理后台,含 OAuth 客户端管理与审计日志
Paraglide JS 全应用国际化,支持本地化 URL 路径与用户语言持久化
数据库与运行时组合覆盖 PostgreSQL、D1、Turso、Bun SQLite 及 Cloudflare Workers、Nitro、Bun
模板详细介绍
Mystack 是一个基于 TanStack Start 与 React 19 的应用生成器,仓库同时维护 CLI(@0x0501/mystack)和可运行的参考模板。使用 bunx @0x0501/mystack 启动交互式向导,或通过命令行参数指定数据库、部署运行时、邮件和支付选项,生成的项目会按所选组合配置代码、迁移、环境变量和依赖;不兼容的组合会被向导自动禁用,选择结果记录在 mystack.json 中。
生成的项目包含 Better Auth 认证(邮箱密码、GitHub OAuth、Passkey、2FA)、OAuth 2.0/OIDC 身份提供方、基于角色的管理后台与审计日志、Paraglide JS 全应用国际化、Base UI 无头组件与 Tailwind CSS v4 样式,以及可插拔的支付集成。数据库支持 PostgreSQL(Hyperdrive 或直连)、Cloudflare D1、Turso Cloud、Turso Local 和 Bun SQLite;部署运行时支持 Cloudflare Workers、Nitro/Node.js 和 Bun;邮件支持 Cloudflare Email 与 Resend;支付支持 Stripe、Polar、Creem、NOWPayments 或不启用。
README 说明根目录应用是 PostgreSQL + Cloudflare Workers 的参考模板,实际应用开发在生成的项目中进行。快速开始要求 Node.js 22.12+ 与 Bun,生成后需复制 .env.example、执行数据库迁移并运行开发服务器;开发环境中未配置邮件服务商凭据时,认证邮件会输出到控制台。README 未提供各集成的生产环境配置细节、性能数据或安全审计结论。
适合你的项目吗?
适用场景
- 需要从零搭建带认证、管理后台和国际化基础的全栈 TanStack Start 项目
- 希望按目标平台选择数据库与部署运行时,而不是从空模板手动拼装
- 需要为自有产品提供 OAuth 2.0/OIDC 身份提供方能力
- 计划接入 Stripe、Polar、Creem 或 NOWPayments 处理支付
适合人群
- 使用 TanStack Start 与 React 19 开发全栈应用的团队
- 需要预置认证、权限与审计能力的项目
- 面向 Cloudflare Workers、Node.js 或 Bun 部署的应用
- 需要多语言 URL 与本地化支持的产品
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
环境要求 Node.js 22.12+ 与 Bun,使用 bunx @0x0501/mystack 启动向导
- 2
生成项目后复制 .env.example 为 .env,执行 bun run db:migrate 再运行 bun run dev
- 3
使用 PostgreSQL Hyperdrive 配方时,先通过 bun run db:up 启动本地 Docker Compose Postgres
- 4
开发环境未配置邮件服务商凭据时,认证邮件会打印到控制台
- 5
README 未提供各支付与邮件服务商的生产环境配置步骤
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 需要 Node.js 22.12+ 与 Bun 环境才能运行 CLI 和生成项目。
- 生成项目后需按生成的 README 配置 .env 并执行数据库迁移,才能启动开发服务器。
- 开发环境未配置邮件服务商凭据时,认证邮件仅输出到控制台,不实际发送。
- 使用 PostgreSQL Hyperdrive 配方时需通过 Docker Compose 启动本地 Postgres。
- 部分数据库、部署、邮件与支付组合不兼容,向导会自动禁用这些组合。
- Turso Cloud 在生产环境需连接远程 libsql:// 服务,可能涉及外部云服务账号。
- Turso Local 仅支持 Nitro/Node.js 与 Bun 部署,不支持 Cloudflare Workers。
- Bun SQLite 仅支持 Bun 运行时部署。
- PostgreSQL Hyperdrive 选项仅支持 Cloudflare Workers 部署。
- Cloudflare D1 选项仅支持 Cloudflare Workers 部署。
- 应用开发在生成的项目中进行,本仓库维护 CLI 与参考模板。
- 根目录参考模板固定为 PostgreSQL + Cloudflare Workers 配置,其他组合由生成器产出。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Install Node.js 22.12+ and [Bun](https://bun.sh). Run the CLI directly from npm to launch the interactive setup wizard:
README 原文
Follow the generated `README.md` to configure `.env`, apply database migrations, and start your dev server:
README 原文
Open **http://localhost:3000**. In development, authentication emails are logged directly to the console when provider credentials are omitted.
README 原文
bun run db:up # Starts local Postgres in Docker Compose
README 原文
Mystack configures code, migrations, environment variables, and dependencies tailored to your chosen stack. The interactive wizard automatically disables incompatible combinations.
README 原文
| **Turso Cloud** | `turso-cloud` | Cloudflare, Nitro, Bun | Local `.local/turso-local.db` in dev; remote `libsql://` in prod |
README 原文
| **Turso Local (libSQL)** | `turso-local` | Nitro / Node.js, Bun | Local `file:.local/turso-local.db` (no cloud tokens required) |
README 原文
| **Bun SQLite** | `bun-sqlite` | Bun | Native `bun:sqlite` engine (`local.db`) |
README 原文
| **PostgreSQL (Hyperdrive)** | `pg-hyperdrive` | Cloudflare Workers | Cloudflare `HYPERDRIVE` connection pooling |
README 原文
| **Cloudflare D1** | `d1` | Cloudflare Workers | Cloudflare `DB` native binding |
README 原文
> **Note:** Use `mystack create` to start new projects. This repository maintains the CLI and the canonical reference template; application development happens in the generated project.
README 原文
https://github.com/0x0501/Mystack/blob/main/LICENSEhttps://github.com/0x0501/Mystack/blob/main/README.md| Root (`src/`, `scripts/`, `drizzle/`) | Canonical runnable reference template (PostgreSQL + Cloudflare Workers) |
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-19。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 83 / 100
- 技术栈
- Vite
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-10-19
- 截图检查日期
- 2026-10-19
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Vite。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: codex-user-requested-batch-review-20261021 · 2026-10-21
查看当时使用的来源资料
SHA-256: 04bf63d4b06d965d348d90b7117529829916be5646bc384520345476e024d949
2026-10-19T07:55:28.276Z
来源文件 / 仓库<p align="center">
<a href="https://mystack.sumku.cc">
<img src="./public/favicon.svg" width="80" height="80" alt="Mystack Logo" />
</a>
</p>
<h1 align="center">Mystack</h1>
<p align="center">
<strong>Configurable, production-grade TanStack Start application generator & platform template.</strong>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/@0x0501/mystack"><img src="https://img.shields.io/npm/v/@0x0501/mystack?style=flat-square&color=d6c69c&label=npm" alt="npm version" /></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License: MIT" /></a>
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.12.0-brightgreen?style=flat-square&logo=node.js" alt="Node.js version" /></a>
<a href="https://bun.sh"><img src="https://img.shields.io/badge/bun-%3E%3D1.2-fbf0df?style=flat-square&logo=bun&logoColor=black" alt="Bun" /></a>
<a href="https://tanstack.com/start"><img src="https://img.shields.io/badge/TanStack_Start-React_19-FF4154?style=flat-square&logo=react" alt="TanStack Start" /></a>
<a href="https://mystack.sumku.cc"><img src="https://img.shields.io/badge/website-mystack.sumku.cc-10110f?style=flat-square" alt="Website" /></a>
</p>
<p align="center">
<img src="./public/og.png" width="100%" alt="Mystack Open Graph Cover" />
</p>
---
Create a configured, production-ready **TanStack Start** application with **Mystack**. Instead of a rigid monolith or an empty starter, Mystack provides an interactive generator that lets you choose your database, deployment runtime, email, and payment providers.
Every generated project comes complete with hardened authentication (Better Auth with self-hosted OAuth2/OIDC provider, 2FA and passkeys), role-based administration, full-app internationalization (Paraglide JS), and headless Base UI presentation styled with Tailwind CSS v4.
> **Note:** Use `mystack create` to start new projects. This repository maintains the CLI and the canonical reference template; application development happens in the generated project.
## Quick Start
Install Node.js 22.12+ and [Bun](https://bun.sh). Run the CLI directly from npm to launch the interactive setup wizard:
```sh
bunx @0x0501/mystack
```
To create a project in a specific directory:
```sh
bunx @0x0501/mystack@latest create my-app
cd my-app
```
Follow the generated `README.md` to configure `.env`, apply database migrations, and start your dev server:
```sh
cp .env.example .env
bun run db:migrate
bun run dev
```
Open **http://localhost:3000**. In development, authentication emails are logged directly to the console when provider credentials are omitted.
### Common Recipes
#### 1. Zero-Cloud Local Development (Bun + SQLite)
No cloud accounts or Docker required — start building immediately:
```sh
bunx @0x0501/mystack@latest create my-app --yes --database bun-sqlite --deployment bun --email resend --payments none
cd my-app
cp .env.example .env
bun run db:migrate
bun run dev
```
#### 2. Cloudflare Edge Stack (PostgreSQL Hyperdrive + Workers)
The reference template configuration with edge deployment:
```sh
bunx @0x0501/mystack@latest create my-app --yes --database pg-hyperdrive --deployment cloudflare --email cloudflare --payments stripe
cd my-app
cp .env.example .env
bun run db:up # Starts local Postgres in Docker Compose
bun run db:migrate
bun run dev
```
#### 3. Serverless Turso + Resend + Polar
Distributed libSQL storage with modern email and billing:
```sh
bunx @0x0501/mystack@latest create my-app --yes --database turso-cloud --deployment cloudflare --email resend --payments polar
```
## Compatibility
Mystack configures code, migrations, environment variables, and dependencies tailored to your chosen stack. The interactive wizard automatically disables incompatible combinations.
### Supported Integrations
| Category | Badges & Supported Integrations |
|---|---|
| **Runtimes** | [](https://workers.cloudflare.com/) [](https://nitro.unjs.io/) [](https://bun.sh/) |
| **Databases** | [](https://www.postgresql.org/) [](https://developers.cloudflare.com/d1/) [](https://turso.tech/) [](https://bun.sh/) |
| **Email** | [](https://developers.cloudflare.com/email-routing/) [](https://resend.com/) |
| **Payments** | [](https://stripe.com/) [](https://polar.sh/) [](https://creem.io/) [](https://nowpayments.io/) |
### Database & Deployment Matrix
| Database Option | Flag | Supported Deployments | Connection & Characteristics |
|---|---|---|---|
| **PostgreSQL (Hyperdrive)** | `pg-hyperdrive` | Cloudflare Workers | Cloudflare `HYPERDRIVE` connection pooling |
| **PostgreSQL (Direct)** | `pg` | Nitro / Node.js, Bun | Direct `DATABASE_URL` app-role connection |
| **Cloudflare D1** | `d1` | Cloudflare Workers | Cloudflare `DB` native binding |
| **Turso Cloud** | `turso-cloud` | Cloudflare, Nitro, Bun | Local `.local/turso-local.db` in dev; remote `libsql://` in prod |
| **Turso Local (libSQL)** | `turso-local` | Nitro / Node.js, Bun | Local `file:.local/turso-local.db` (no cloud tokens required) |
| **Bun SQLite** | `bun-sqlite` | Bun | Native `bun:sqlite` engine (`local.db`) |
Your choices are recorded in `mystack.json` for reference.
## Features & Platform Capabilities
Mystack ships platform infrastructure so you can focus on building your product:
- 🛡️ **Hardened Better Auth**: Email/password authentication, GitHub OAuth, passkeys (WebAuthn), and two-factor authentication (2FA).
- 🔑 **OAuth 2.0 / OIDC Provider**: Built-in identity provider issuing tokens and exposing RFC discovery metadata (`/.well-known/openid-configuration`, `/.well-known/oauth-authorization-server/api/auth`).
- ⚡ **TanStack Start & React 19**: Full-stack type-safety, streaming SSR, TanStack Router file-based routing, server functions (`createServerFn`), and TanStack Query state caching.
- 🌐 **Full-App i18n**: First-class internationalization powered by Paraglide JS with SEO-friendly localized URL paths (`/`, `/de`) and automatic user locale persistence.
- 🎨 **Headless UI & Tailwind CSS v4**: Modular Base UI (`@base-ui/react`) primitives with customizable Tailwind CSS v4 design tokens and dark mode support.
- 🔒 **Row-Level Security (RLS)**: Isolated database transaction scopes with tenant/service context helpers.
- 🎛️ **Admin Console & Audit Log**: Role-based access control, peer admin protection, OAuth client management, and audit log tracking.
- 💳 **Pluggable Payments**: Modular checkout and webhook handling for Stripe, Polar, Creem, and NOWPayments (or `none`).
## Repository Structure
| Path | Purpose |
|---|---|
| Root (`src/`, `scripts/`, `drizzle/`) | Canonical runnable reference template (PostgreSQL + Cloudflare Workers) |
| [`packages/mystack/`](./packages/mystack/) | CLI generator, option catalog, and template adapters (`@0x0501/mystack`) |
| [`packages/website/`](./packages/website/) | Marketing site and catalog-backed stack configurator ([mystack.sumku.cc](https://mystack.sumku.cc)) |
| [`docs/`](./docs/) | Architectural decision records (ADRs), specs, and maintainer guides |
The root application is the canonical template source. See [ADR 0012](./docs/adr/0012-mystack-project-generation.md) for details on composition and template bundling.
## Documentation
- [Getting started](./docs/getting-started.md) — CLI installation, flags, and deployment walkthrough
- [Project guide](./docs/project-guide.md) — Working inside a generated application (bundled with the CLI)
- [Reference template](./docs/reference-template.md) — Maintainers' setup for the PostgreSQL / Workers reference app
- [Design](./DESIGN.md) — Headless Base UI integration, design tokens, and motion
- [Contributing](./docs/contributing.md) — Developing adapters and maintaining the CLI
- [Publishing](./docs/publishing.md) — Packaging and automated release workflows
- [Context & Glossary](./CONTEXT.md) — Ubiquitous language and architecture invariants
- [Documentation index](./docs/README.md) — Complete documentation and ADR catalog
## License
[MIT](./LICENSE)
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

cove
The Cove Stack: 🏝️ minimal TanStack Start template with Vite+, Better Auth, Drizzle ORM, shadcn/ui
Vite · SaaS

vite-react-boilerplate
A production ready, scalable starter template for Vite + React
Vite · 启动器

vital
Starter template for Vite with React (TypeScript). Supports Tailwind. Vitest and @react/testing-library config…
Vite · 启动器

react-vite-admin
This Starter utilizes React, Recoil, React Query, React Hooks, Typescript, Axios And Vite. 全新技术栈的后台管理系统
Vite · 后台

typescript-react_best_practices-vite_template
<⚡⚛️> Start your React project with Vite following code best practices (TypeScript, Linting, testing, CI/CD…)
Vite · 启动器

cloudflare-starter-kit
Template (boilerplate) repository for scaffolding Cloudflare Workers projects
Vite · 启动器
