135 lines
6.5 KiB
Markdown
135 lines
6.5 KiB
Markdown
<!-- WEHUB_ZH_README -->
|
||
> [!NOTE]
|
||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||
> [English](./README.en.md) · [原始项目](https://github.com/wasp-lang/open-saas) · [上游 README](https://github.com/wasp-lang/open-saas/blob/HEAD/README.md)
|
||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||
|
||
## 欢迎使用你的新 SaaS 应用!🎉
|
||
|
||
<div style="display: flex; gap: 16px; align-items: center;">
|
||
<a href="https://www.producthunt.com/products/open-saas?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_source=badge-open-saas-2-0" target="_blank">
|
||
<img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=1023519&theme=neutral&period=weekly&topic_id=237&t=1760520428563" alt="Open SaaS 2.0 - Free, open-source SaaS starter kit with superpowers | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" />
|
||
</a>
|
||
<a href="https://www.producthunt.com/products/open-saas?embed=true&utm_source=badge-top-post-badge&utm_medium=badge&utm_source=badge-open-saas-2-0" target="_blank">
|
||
<img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=1023519&theme=neutral&period=daily&t=1760520428563" alt="Open SaaS 2.0 - Free, open-source SaaS starter kit with superpowers | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" />
|
||
</a>
|
||
</div>
|
||
|
||
https://github.com/user-attachments/assets/3856276b-23e9-455e-a564-b5f26f4f0e98
|
||
|
||
你决定使用 Open SaaS 模板来构建 SaaS 应用,很棒的选择!
|
||
|
||
本模板具备以下特点:
|
||
|
||
1. 完全开源(fully open-source)
|
||
2. 可免费使用与分发
|
||
3. 开箱即用,自带大量功能!
|
||
4. 可与你喜爱的 AI 编程工具或智能体(Claude Code、Cursor、Codex、OpenCode 等)配合使用
|
||
|
||
🧑💻 在此查看实际效果:[OpenSaaS.sh](https://opensaas.sh)
|
||
📚 在此查看文档:[Open SaaS Docs](https://docs.opensaas.sh)
|
||
|
||
## 里面有什么?
|
||
|
||
模板本身构建在一系列强大的工具与框架之上,包括:
|
||
|
||
- 🐝 [Wasp](https://wasp.sh) - 具备超强能力的全栈 React、NodeJS、Prisma 框架
|
||
- 🚀 [Astro](https://starlight.astro.build/) - Astro 轻量级「Starlight」文档与博客模板
|
||
- 💸 [Stripe](https://stripe.com), [Polar.sh](https://polar.sh), 或 [Lemon Squeezy](https://lemonsqueezy.com/) - 用于产品与支付
|
||
- 💅 [ShadCN UI](https://tailwindcss.com) - 用于组件与样式(还包含管理后台!)
|
||
- 🤖 [AI-Ready](https://docs.opensaas.sh/) - 面向 Claude Code、Cursor 或你喜爱的 AI 辅助编程工具的自定义插件、技能与规则
|
||
- 📈 [Plausible](https://plausible.io) 或 [Google](https://analytics.google.com/) Analytics
|
||
- 🤖 [OpenAI](https://openai.com) - 含函数调用(function calling)示例的 OpenAI API
|
||
- 📦 [AWS S3](https://aws.amazon.com/s3/) - 用于文件上传
|
||
- 📧 [SendGrid](https://sendgrid.com), [MailGun](https://mailgun.com), 或 SMTP - 用于发送邮件
|
||
- 🧪 [Playwright](https://playwright.dev) - 使用 Playwright 的端到端测试
|
||
|
||
由于我们使用 Wasp 作为全栈框架,可以借助其众多特性快速构建 SaaS,包括:
|
||
|
||
- 🔐 [Full-stack Authentication](https://wasp.sh/docs/auth/overview) - 几行代码即可实现邮箱验证 + 社交登录。
|
||
- ⛑ [End-to-end Type Safety](https://wasp.sh/docs/data-model/operations/overview) - 为后端函数添加类型,前端即可自动推断类型,无需安装或配置任何第三方库。对了,还有类型安全的链接!
|
||
- 🤖 [Jobs](https://wasp.sh/docs/advanced/jobs) - 在配置文件中定义函数,即可在后台运行定时任务或设置队列。
|
||
- 🚀 [One-command Deploy](https://wasp.sh/docs/advanced/deployment/overview) - 通过 CLI 一条命令即可将数据库、服务器和客户端轻松部署到 [Railway](https://railway.app) 或 [Fly.io](https://fly.io)。也可手动部署到你选择的任何其他托管服务。
|
||
|
||
若遇到问题或需要帮助,你还可以加入 Wasp 多元且友善的社区。
|
||
|
||
- 🤝 [Wasp Discord](https://discord.gg/aCamt5wCpS)
|
||
|
||
## 快速开始
|
||
|
||
### 简要说明
|
||
|
||
首先,在 macOS、Linux 或带 WSL 的 Windows 上安装最新版 [Wasp](https://wasp.sh/),请运行以下命令:
|
||
|
||
```bash
|
||
npm i -g @wasp.sh/wasp-cli
|
||
```
|
||
|
||
然后,使用以下命令创建新的 SaaS 应用:
|
||
|
||
```bash
|
||
wasp new -t saas
|
||
```
|
||
|
||
这会在新目录中创建 **Open SaaS 模板的干净副本**,你可以立即开始构建自己的 SaaS 应用!
|
||
|
||
### 详细说明
|
||
|
||
关于入门与使用本模板的一切信息,请参阅 [Open SaaS Docs](https://docs.opensaas.sh).
|
||
|
||
我们已详尽记录所有内容,包括安装说明、拉取模板更新、服务集成指南、SEO、部署等。🚀
|
||
|
||
## 获取帮助与提供反馈
|
||
|
||
有两种方式获取帮助或提供反馈(我们会尽量快速回复!):
|
||
|
||
1. [Open an issue](https://github.com/wasp-lang/open-saas/issues)
|
||
2. [Wasp Discord](https://discord.gg/aCamt5wCpS) -- 请将问题发至 #🙋questions 论坛频道
|
||
|
||
## 开发工具
|
||
|
||
### 代码质量工具
|
||
|
||
本仓库包含完善的代码质量工具,帮助维护代码规范:
|
||
|
||
#### Prettier(代码格式化)
|
||
|
||
Prettier 已配置为自动格式化所有 JavaScript、TypeScript 及其他受支持文件。
|
||
|
||
```bash
|
||
# Check if files are formatted correctly
|
||
npm run prettier:check
|
||
|
||
# Automatically format all files
|
||
npm run prettier:format
|
||
```
|
||
|
||
#### ESLint(代码检查)
|
||
|
||
ESLint 已配置 TypeScript 与 React 支持,用于发现潜在缺陷并强制执行代码质量标准。
|
||
|
||
```bash
|
||
# Run ESLint to check for issues
|
||
npm run lint
|
||
|
||
# Automatically fix fixable issues
|
||
npm run lint:fix
|
||
```
|
||
|
||
ESLint 配置包括:
|
||
|
||
- 通过 `@typescript-eslint` 提供 TypeScript 支持
|
||
- React 与 React Hooks 检查
|
||
- 针对 SaaS 应用调优的合理默认设置
|
||
- 自动支持 CommonJS(.cjs)、ES Modules(.mjs)和 TypeScript 文件
|
||
|
||
Prettier 与 ESLint 检查会在 CI/CD 流水线中自动运行,以确保代码质量。
|
||
|
||
有关用于维护衍生项目(如 opensaas.sh 和 template-test)的其他开发工具,请参阅 [tools/README.md](./tools/README.md)。
|
||
|
||
## 贡献
|
||
|
||
请注意,我们已尽量将 SaaS 应用的核心功能纳入本模板,但可能仍有一些功能缺失。
|
||
|
||
我们始终欢迎帮助收尾完善:欢迎贡献!详情请参阅 [CONTRIBUTING.md](/CONTRIBUTING.md)。
|