Project Icon

saas-starter-kit

Enterprise SaaS Starter Kit 全面的Next.js开源应用模板

saas-starter-kit是一个基于Next.js的开源企业级SaaS应用模板,集成了Tailwind CSS、Postgres、Prisma和TypeScript等现代技术栈。该项目提供身份认证、团队管理、国际化和暗黑模式等多项开箱即用功能,显著缩短开发周期。此外,它还支持SAML SSO、目录同步和Webhook等企业级特性,为开发者提供了构建安全可靠SaaS应用的全面解决方案。

BoxyHQ Banner

⭐ Enterprise SaaS Starter Kit

Github stargazers Github issues license Twitter LinkedIn Discord

The Open Source Next.js SaaS boilerplate for Enterprise SaaS app development.

Please star ⭐ the repo if you want us to continue developing and improving the SaaS Starter Kit! 😀

📖 Additional Resources

Video - BoxyHQ's SaaS Starter Kit: Your Ultimate Enterprise-Compliant Boilerplate
Blog - Enterprise-ready Saas Starter Kit

Next.js-based SaaS starter kit saves you months of development by starting you off with all the features that are the same in every product, so you can focus on what makes your app unique.

🛠️ Built With

  • Next.js This is a React framework that provides features such as server-side rendering and static site generation. It's used for building the user interface of your application. The main configuration for Next.js can be found in next.config.js.
  • Tailwind CSS This is a utility-first CSS framework for rapidly building custom user interfaces. It's used for styling the application. The configuration for Tailwind CSS can be found in postcss.config.js.
  • Postgres This is a powerful, open source object-relational database system. It's used for storing application data. The connection to Postgres is likely managed through Prisma.
  • React This is a JavaScript library for building user interfaces. It's used for creating the interactive elements of your application. The React components are located in the components directory.
  • Prisma This is an open-source database toolkit. It's used for object-relational mapping, which simplifies the process of writing database queries. Prisma configuration and schema can be found in the prisma directory.
  • TypeScript This is a typed superset of JavaScript that compiles to plain JavaScript. It's used to make the code more robust and maintainable. TypeScript definitions and configurations can be found in files like next-env.d.ts and i18next.d.ts.
  • SAML Jackson (Provides SAML SSO, Directory Sync) This is a service for handling SAML SSO (Single Sign-On). It's used to allow users to sign in with a single ID and password to any of several related systems i.e (using a single set of credentials). The implementation of SAML Jackson is primarily located within the files associated with authentication.
  • Svix (Provides Webhook Orchestration) This is a service for handling webhooks. It's used to emit events on user/team CRUD operations, which can then be caught and handled by other parts of the application or external services. The integration of Svix is distributed throughout the codebase, primarily in areas where Create, Read, Update, and Delete (CRUD) operations are executed.
  • Retraced (Provides Audit Logs Service) This is a service for audit logging and data visibility. It helps track user activities within the application i.e (who did what and when in the application). The usage of Retraced would be dispersed throughout the codebase, likely in the files where important actions are performed.
  • Stripe (Provides Payments) This is a service for handling payments. It's used to process payments for the application. The integration of Stripe is likely found in the files associated with billing and subscriptions.
  • Playwright (Provides E2E tests) This is a Node.js library for automating browsers. It's used to run end-to-end tests on the application. The Playwright configuration and tests can be found in the tests directory.
  • Docker (Provides Docker Compose) This is a platform for developing, shipping, and running applications. It's used to containerize the application and its dependencies. The Docker configuration can be found in the Dockerfile and docker-compose.yml.
  • NextAuth.js (Provides Authentication) This is a complete open-source authentication solution for Next.js applications. It's used to handle user authentication and authorization. The NextAuth.js configuration and providers can be found in the pages/api/auth/[...nextauth].ts file.

🚀 Deployment

Deploy with Vercel Deploy to Heroku Deploy to DO

✨ Getting Started

Please follow these simple steps to get a local copy up and running.

Prerequisites

  • Node.js (Version: >=18.x)
  • PostgreSQL
  • NPM
  • Docker compose

Development

1. Setup

  • Fork the repository
  • Clone the repository by using this command:
git clone https://github.com/<your_github_username>/saas-starter-kit.git

2. Go to the project folder

cd saas-starter-kit

3. Install dependencies

npm install

4. Set up your .env file

Duplicate .env.example to .env.

cp .env.example .env

5. Create a database (Optional)

To make the process of installing dependencies easier, we offer a docker-compose.yml with a Postgres container.

docker-compose up -d

6. Set up database schema

npx prisma db push

7. Start the server

In a development environment:

npm run dev

8. Start the Prisma Studio

Prisma Studio is a visual editor for the data in your database.

npx prisma studio

9. Testing

We are using Playwright to execute E2E tests. Add all tests inside the /tests folder.

Update playwright.config.ts to change the playwright configuration.

Install Playwright dependencies
npm run playwright:update
Run E2E tests
npm run test:e2e

Note: HTML test report is generated inside the report folder. Currently supported browsers for test execution chromium and firefox

Fully customizable boilerplate out of the box, see images below 👇👇👇

saas-starter-kit-poster

🥇 Features

  • Create account
  • Sign in with Email and Password
  • Sign in with Magic Link
  • Sign in with SAML SSO
  • Sign in with Google [Setting up Google OAuth]
  • Sign in with GitHub [Creating a Github OAuth App]
  • Directory Sync (SCIM)
  • Update account
  • Create team
  • Delete team
  • Invite users to the team
  • Manage team members
  • Update team settings
  • Webhooks & Events
  • Internationalization
  • Audit logs
  • Roles and Permissions
  • Dark mode
  • Email notifications
  • E2E tests
  • Docker compose
  • Prisma Studio
  • Update member role
  • Directory Sync Events
  • Avatar Upload
  • SAML SSO
  • Audit Log
  • Webhook
  • Payments
  • Security Headers

➡️ Coming Soon

  • Billing & subscriptions
  • Unit and integration tests

✨ Contributing

Thanks for taking the time to contribute! Contributions make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Please try to create bug reports that are:

  • Reproducible. Include steps to reproduce the problem.
  • Specific. Include as much detail as possible: which version, what environment, etc.
  • Unique. Do not duplicate existing opened issues.
  • Scoped to a Single Bug. One bug per report.

Contributing Guide

🤩 Community

  • Discord (For live discussion with the Open-Source Community and BoxyHQ team)
  • Twitter / LinkedIn (Follow us)
  • Youtube (Watch community events and tutorials)
  • GitHub Issues (Contributions, report issues, and product ideas)

🌍 Contributors

Made with contrib.rocks.

🛡️ License

Apache 2.0 License

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

吐司

探索Tensor.Art平台的独特AI模型,免费访问各种图像生成与AI训练工具,从Stable Diffusion等基础模型开始,轻松实现创新图像生成。体验前沿的AI技术,推动个人和企业的创新发展。

Project Cover

SubCat字幕猫

SubCat字幕猫APP是一款创新的视频播放器,它将改变您观看视频的方式!SubCat结合了先进的人工智能技术,为您提供即时视频字幕翻译,无论是本地视频还是网络流媒体,让您轻松享受各种语言的内容。

Project Cover

美间AI

美间AI创意设计平台,利用前沿AI技术,为设计师和营销人员提供一站式设计解决方案。从智能海报到3D效果图,再到文案生成,美间让创意设计更简单、更高效。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号