MCPcopy
hub / github.com/boxyhq/saas-starter-kit

github.com/boxyhq/saas-starter-kit @v1.6.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.6.0 ↗
684 symbols 2,228 edges 281 files 5 documented · 1%
README

BoxyHQ Banner

⭐ Enterprise SaaS Starter Kit

<a href="https://github.com/boxyhq/saas-starter-kit/stargazers"><img src="https://img.shields.io/github/stars/boxyhq/saas-starter-kit" alt="Github stargazers"></a>
<a href="https://github.com/boxyhq/saas-starter-kit/issues"><img src="https://img.shields.io/github/issues/boxyhq/saas-starter-kit" alt="Github issues"></a>
<a href="https://github.com/boxyhq/saas-starter-kit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/boxyhq/saas-starter-kit" alt="license"></a>
<a href="https://twitter.com/BoxyHQ"><img src="https://img.shields.io/twitter/follow/BoxyHQ?style=social" alt="Twitter"></a>
<a href="https://www.linkedin.com/company/boxyhq"><img src="https://img.shields.io/badge/LinkedIn-blue" alt="LinkedIn"></a>
<a href="https://discord.gg/uyb7pYt4Pa"><img src="https://img.shields.io/discord/877585485235630130" alt="Discord"></a>

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

Extension points exported contracts — how you extend this code

Session (Interface)
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
types/next-auth.d.ts
JacksonSSO (Interface)
(no doc) [2 implementers]
lib/jackson/sso/utils.ts
CustomTypeOptions (Interface)
(no doc)
i18next.d.ts
TeamFeature (Interface)
(no doc)
types/base.ts
AcceptInvitationProps (Interface)
(no doc)
components/invitation/AcceptInvitation.tsx
AuthLayoutProps (Interface)
(no doc)
components/layouts/AuthLayout.tsx
TeamInviteEmailProps (Interface)
(no doc)
components/emailTemplates/TeamInvite.tsx
JoinProps (Interface)
(no doc)
components/auth/Join.tsx

Core symbols most depended-on inside this repo

goto
called by 65
tests/e2e/support/fixtures/sso-page.ts
credentialLogin
called by 29
tests/e2e/support/fixtures/login-page.ts
validateWithSchema
called by 28
lib/zod/index.ts
throwIfNotAllowed
called by 28
models/user.ts
throwIfNoTeamAccess
called by 28
models/team.ts
recordMetric
called by 27
lib/metrics.ts
loggedInCheck
called by 26
tests/e2e/support/fixtures/login-page.ts
sendAudit
called by 14
lib/retraced.ts

Shape

Function 473
Method 117
Interface 68
Class 26

Languages

TypeScript100%

Modules by API surface

tests/e2e/support/fixtures/settings-page.ts25 symbols
tests/e2e/support/fixtures/login-page.ts20 symbols
delete-team.js18 symbols
tests/e2e/support/fixtures/member-page.ts17 symbols
tests/e2e/support/fixtures/sso-page.ts15 symbols
models/team.ts15 symbols
tests/e2e/support/fixtures/directory-sync-page.ts14 symbols
tests/e2e/support/fixtures/api-keys-page.ts11 symbols
models/user.ts11 symbols
models/apiKey.ts8 symbols
lib/svix.ts8 symbols
lib/nextAuth.ts8 symbols

Dependencies from manifests, versioned

@boxyhq/metrics0.2.9 · 1×
@boxyhq/react-ui3.3.45 · 1×
@boxyhq/saml-jackson1.35.0 · 1×
@faker-js/faker9.3.0 · 1×
@heroicons/react2.2.0 · 1×
@next-auth/prisma-adapter1.0.7 · 1×
@playwright/test1.49.1 · 1×
@prisma/client6.1.0 · 1×
@retracedhq/logs-viewer2.8.0 · 1×
@retracedhq/retraced0.7.18 · 1×

For agents

$ claude mcp add saas-starter-kit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact