{"repo":"boxyhq/saas-starter-kit","free":true,"listed":false,"github":"https://github.com/boxyhq/saas-starter-kit","clone":"git clone https://github.com/boxyhq/saas-starter-kit.git","description":"🔥 Enterprise SaaS Starter Kit - Kickstart your enterprise app development with the Next.js SaaS boilerplate 🚀","language":"TypeScript","stars":4905,"topics":["boilerplate","boilerplates","hacktoberfest","js-boilerplate","next-auth","nextjs","nodejs","react","saas","saas-app","saas-application","saas-boilerplate","saas-kit","starter-kit","starter-template","tailwindcss","typescript"],"license":"Apache-2.0","category":"saas_starter","readme_excerpt":"<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/boxyhq/jackson/assets/66887028/871d9c0f-d351-49bb-9458-2542830d7910\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/boxyhq/jackson/assets/66887028/4073c181-0653-4d5b-b74f-e7e84fe79da8\">\n  <img alt=\"BoxyHQ Banner\" src=\"https://github.com/boxyhq/jackson/assets/66887028/b40520b7-dbce-400b-88d3-400d1c215ea1\">\n</picture>\n\n# ⭐ Enterprise SaaS Starter Kit\n\n<p>\n    <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>\n    <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>\n    <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>\n    <a href=\"https://twitter.com/BoxyHQ\"><img src=\"https://img.shields.io/twitter/follow/BoxyHQ?style=social\" alt=\"Twitter\"></a>\n    <a href=\"https://www.linkedin.com/company/boxyhq\"><img src=\"https://img.shields.io/badge/LinkedIn-blue\" alt=\"LinkedIn\"></a>\n    <a href=\"https://discord.gg/uyb7pYt4Pa\"><img src=\"https://img.shields.io/discord/877585485235630130\" alt=\"Discord\"></a>\n</p>\n\nThe Open Source Next.js SaaS boilerplate for Enterprise SaaS app development.\n\nPlease star ⭐ the repo if you want us to continue developing and improving the SaaS Starter Kit! 😀\n\n## 📖 Additional Resources\n\nVideo - [BoxyHQ's SaaS Starter Kit: Your Ultimate Enterprise-Compliant Boilerplate](https://www.youtube.com/watch?v=oF8QIwQIhyo) <br>\nBlog - [Enterprise-ready Saas Starter Kit](https://boxyhq.com/blog/enterprise-ready-saas-starter-kit)\n\nNext.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.\n\n## 🛠️ Built With\n\n- [Next.js](https://nextjs.org)\n  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`.\n- [Tailwind CSS](https://tailwindcss.com)\n  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`.\n- [Postgres](https://www.postgresql.org)\n  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.\n- [React](https://reactjs.org)\n  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.\n- [Prisma](https://www.prisma.io)\n  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.\n- [TypeScript](https://www.typescriptlang.org)\n  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`.\n- [SAML Jackson](https://github.com/boxyhq/jackson) (Provides SAML SSO, Directory Sync)\n  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.\n- [Svix](https://www.svix.com/) (Provides Webhook Orchestration)\n  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.\n- [Retraced](https://github.com/retracedhq/retraced) (Provides Audit Logs Service)\n  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.\n- [Stripe](https://stripe.com) (Provides Payments)\n  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.\n- [Playwright](https://playwright.dev) (Provides E2E tests)\n  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.\n- [Docker](https://www.docker.com) (Provides Docker Compose)\n  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.\n- [NextAuth.js](https://next-auth.js.org) (Provides Authentication)\n  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.\n\n## 🚀 Deployment\n\n<a href=\"https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fboxyhq%2Fsaas-starter-kit&env=NEXTAUTH_SECRET,SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSWORD,SMTP_FROM,DATABASE_URL,APP_URL\">\n<img width=\"90\" alt=\"Deploy with Vercel\" src=\"https://vercel.com/button\" />\n</a>\n\n<a href=\"https://heroku.com/deploy\" alt=\"Deploy to Heroku\">\n<img alt=\"Deploy to Heroku\" src=\"https://www.herokucdn.com/deploy/button.svg\" />\n</a>\n\n<a href=\"https://cloud.digitalocean.com/apps/new?repo=https://github.com/boxyhq/saas-starter-kit/tree/main\" alt=\"Deploy to DO\">\n<img width=\"200\" alt=\"Deploy to DO\" src=\"https://www.deploytodo.com/do-btn-blue-ghost.svg\" />\n</a>\n\n## ✨ Getting Started\n\nPlease follow these simple steps to get a local copy up and running.\n\n### Prerequisites\n\n- Node.js (Version: >=18.x)\n- PostgreSQL\n- NPM\n- Docker compose\n\n### Development\n\n#### 1. Setup\n\n- [Fork](https://github.com/boxyhq/saas-starter-kit/fork) the repository\n- Clone the repository by using this command:\n\n```bash\ngit clone https://github.com/<your_github_username>/saas-starter-kit.git\n```\n\n#### 2. Go to the project folder\n\n```bash\ncd saas-starter-kit\n```\n\n#### 3. Install dependencies\n\n```bash\nnpm install\n```\n\n#### 4. Set up your .env file\n\nDuplicate `.env.example` to `.env`.\n\n```bash\ncp .env.example .env\n```\n\n#### 5. Create a database (Optional)\n\nTo make the process of installing dependencies easier, we offer a `docker-compose.yml` with a Postgres container.\n\n```bash\ndocker-compose up -d\n```\n\n#### 6. Set up database schema\n\n```bash\nnpx prisma db push\n```\n\n#### 7. Start the server\n\nIn a development environment:\n\n```bash\nnpm run dev\n```\n\n#### 8. Start the Prisma Studio\n\nPrisma Studio is a visual editor for the data in your database.\n\n```bash\nnpx prisma studio\n```\n\n#### 9. Testing\n\nWe are using [Playwright](https://playwright.dev/) to execute E2E tests. Add all tests inside the `/tests` folder.\n\nUpdate `playwright.config.ts` to change the playwright configuration.\n\n##### Install Playwright dependencies\n\n```bash\nnpm run playwright:update\n```\n\n##### Run E2E tests\n\n```bash\nnpm run test:e2e\n```\n\n_Note: HTML test report is generated inside the `report` folder. Currently supported browsers for test execution `chromium` and `firefox`_\n\n## ⚙️ Feature configuration\n\nTo get started you only need to configure the database by following the steps above. For more advanced features, you can configure the following:\n\n### Authentication with NextAuth.js\n\nThe default login options are email and GitHub. Configure below:\n\n1. Generate a secret key for NextAuth.js by running `openssl rand -base64 32` and adding it to the `.env` file as `NEXTAUTH_SECRET`.\n2. For email login, configure the `SMTP_*` environment variables in the `.env` file to send magic link login emails. You can use services like [AWS SES](https://aws.amazon.com/ses/), [Sendgrid](https://sendgrid.com/) or [Resend](https://resend.com/).\n3. For social login with GitHub and Google, you need to create OAuth apps in the respective developer consoles and add the client ID and secret to the `.env` file. The default is email login and For GitHub, follow the instructions [here](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app). For Google, follow the instructions [here](https://support.google.com/cloud/answer/6158849?hl=en).\n\n### Svix Webhooks\n\n1. Create an account on [Svix](https://www.svix.com/)\n2. The authenticaton token and add `SVIX_API_KEY` to the `.env` file.\n\n### Stripe Payments\n\n1. Create an account on [Stripe](https://stripe.com/)\n2. Add the [Stripe API secret key](https://dashboard.stripe.com/apikeys) to the `.env` file as `STRIPE_SECRET_KEY`.\n3. Create a webhook in the [Stripe dashboard](https://dashboard.stripe.com/webhooks). The URL is your app hostname plus `/api/webhooks/stripe`. If you want to set this up locally you will need to use the [Stripe CLI forwarder](https://docs.stripe.com/webhooks#test-webhook).\n4. Once created, add the signing secret to the `.env` file as `STRIPE_WEBHOOK_SECRET`.\n\n### Recaptcha\n\n1. Create an account on [Google reCAPTCHA](https://www.google.com/recaptcha/admin/enterprise). This will create a Google Cloud account if you don't have one.\n2. From the Key Details in the [Google Cloud Console](https:","default_branch":"main","files":327,"tree":[".do/deploy.template.yaml",".env.example",".github/dependabot.yml",".github/workflows/main.yml",".gitignore",".prettierignore",".prettierrc.js",".release-it.json","CODE_OF_CONDUCT.md","CONTRIBUTING.md","LICENSE","Procfile","README.md","__tests__/lib/server-common.spec.ts","app.json","check-locale.js","components/account/ManageSessions.tsx","components/account/UpdateAccount.tsx","components/account/UpdateEmail.tsx","components/account/UpdateName.tsx","components/account/UpdatePassword.tsx","components/account/UpdateTheme.tsx","components/account/UploadAvatar.tsx","components/account/index.ts","components/apiKey/APIKeys.tsx","components/apiKey/APIKeysContainer.tsx","components/apiKey/NewAPIKey.tsx","components/auth/AgreeMessage.tsx","components/auth/GithubButton.tsx","components/auth/GoogleButton.tsx","components/auth/Join.tsx","components/auth/JoinWithInvitation.tsx","components/auth/MagicLink.tsx","components/auth/ResetPassword.tsx","components/auth/index.ts","components/billing/Help.tsx","components/billing/LinkToPortal.tsx","components/billing/PaymentButton.tsx","components/billing/ProductPricing.tsx","components/billing/Subscriptions.tsx","components/defaultLanding/FAQSection.tsx","components/defaultLanding/FeatureSection.tsx","components/defaultLanding/HeroSection.tsx","components/defaultLanding/PricingSection.tsx","components/defaultLanding/data/faq.json","components/defaultLanding/data/features.json","components/defaultLanding/data/pricing.json","components/emailTemplates/AccountLocked.tsx","components/emailTemplates/EmailLayout.tsx","components/emailTemplates/MagicLink.tsx","components/emailTemplates/ResetPassword.tsx","components/emailTemplates/TeamInvite.tsx","components/emailTemplates/VerificationEmail.tsx","components/emailTemplates/WelcomeEmail.tsx","components/emailTemplates/index.ts","components/invitation/AcceptInvitation.tsx","components/invitation/EmailDomainMismatch.tsx","components/invitation/EmailMismatch.tsx","components/invitation/InviteMember.tsx","components/invitation/InviteViaEmail.tsx","components/invitation/InviteViaLink.tsx","components/invitation/NotAuthenticated.tsx","components/invitation/PendingInvitations.tsx","components/invitation/index.ts","components/layouts/AccountLayout.tsx","components/layouts/AuthLayout.tsx","components/layouts/index.ts","components/shared/AccessControl.tsx","components/shared/Alert.tsx","components/shared/Badge.tsx","components/shared/Card.tsx","components/shared/Checkbox.tsx","components/shared/ConfirmationDialog.tsx","components/shared/CopyToClipboardButton.tsx","components/shared/EmptyState.tsx","components/shared/Error.tsx","components/shared/GoogleReCAPTCHA.tsx","components/shared/InputWithCopyButton.tsx","components/shared/InputWithLabel.tsx","components/shared/LetterAvatar.tsx","components/shared/Loading.tsx","components/shared/Modal.tsx","components/shared/TeamDropdown.tsx","components/shared/TogglePasswordVisibility.tsx","components/shared/WithLoadingAndError.tsx","components/shared/index.ts","components/shared/shell/AppShell.tsx","components/shared/shell/Brand.tsx","components/shared/shell/Drawer.tsx","components/shared/shell/Header.tsx","components/shared/shell/Navigation.tsx","components/shared/shell/NavigationItems.tsx","components/shared/shell/ProductNavigation.tsx","components/shared/shell/TeamNavigation.tsx","components/shared/shell/UserNavigation.tsx","components/shared/table/Table.tsx","components/shared/table/TableBody.tsx","components/shared/table/TableHeader.tsx","components/styles.ts","components/team/CreateTeam.tsx","components/team/Members.tsx","components/team/RemoveTeam.tsx","components/team/TeamSettings.tsx","components/team/TeamTab.tsx","components/team/Teams.tsx","components/team/UpdateMemberRole.tsx","components/team/index.ts","components/webhook/CreateWebhook.tsx","components/webhook/EditWebhook.tsx","components/webhook/EventTypes.tsx","components/webhook/Form.tsx","components/webhook/Webhooks.tsx","components/webhook/index.ts","delete-team.js","docker-compose.yml","eslint.config.cjs","find-dupe-locale.js","hooks/useAPIKeys.ts","hooks/useCanAccess.ts","hooks/useCustomSignout.ts","hooks/useInvitation.ts","hooks/useInvitations.ts","hooks/usePermissions.ts","hooks/useTeam.ts","hooks/useTeamMembers.ts","hooks/useTeams.ts","hooks/useTheme.ts","hooks/useWebhook.ts","hooks/useWebhooks.ts","i18next.d.ts","instrumentation.ts","jest.config.js","jest.setup.js","lib/accountLock.ts","lib/app.ts","lib/auth.ts","lib/common.ts","lib/email/freeEmailService.json","lib/email/sendEmail.ts","lib/email/sendMagicLink.ts","lib/email/sendPasswordResetEmail.ts","lib/email/sendTeamInviteEmail.ts","lib/email/sendVerificationEmail.ts","lib/email/sendWelcomeEmail.ts","lib/email/utils.ts","lib/env.ts","lib/errors.ts","lib/fetcher.ts","lib/guards/team-api-key.ts","lib/guards/team-dsync.ts","lib/guards/team-sso.ts","lib/inferSSRProps.ts","lib/jackson.ts","lib/jackson/config.ts","lib/jackson/dsync/embed.ts","lib/jackson/dsync/hosted.ts","lib/jackson/dsync/index.ts","lib/jackson/dsync/utils.ts","lib/jackson/dsyncEvents.ts","lib/jackson/sso/embed.ts","lib/jackson/sso/hosted.ts","lib/jackson/sso/index.ts","lib/jackson/sso/utils.ts","lib/metrics.ts","lib/nextAuth.ts","lib/permissions.ts","lib/prisma.ts","lib/rbac.ts","lib/recaptcha.ts","lib/retraced.ts","lib/server-common.ts","lib/session.ts","lib/slack.ts","lib/stripe.ts","lib/svix.ts","lib/theme.ts","lib/zod/index.ts","lib/zod/primitives.ts","lib/zod/schema.ts","locales/en/common.json","middleware.ts","models/account.ts","models/apiKey.ts","models/invitation.ts","models/passwordReset.ts","models/price.ts","models/service.ts","models/session.ts","models/subscription.ts","models/team.ts","models/teamMember.ts","models/user.ts","models/verificationToken.ts","next-env.d.ts","next-i18next.config.js","next.config.js","package-lock.json","package.json","pages/404.tsx","pages/500.tsx","pages/_app.tsx","pages/_document.tsx","pages/api/auth/[...nextauth].ts","pages/api/auth/custom-signout.ts","pages/api/auth/forgot-password.ts","pages/api/auth/join.ts","pages/api/auth/resend-email-token.ts","pages/api/auth/reset-password.ts","pages/api/auth/sso/acs.ts","pages/api/auth/sso/verify.ts","pages/api/auth/unlock-account.ts","pages/api/health.ts","pages/api/hello.ts","pages/api/idp.ts","pages/api/import-hack.ts","pages/api/invitations/[token].ts","pages/api/oauth/authorize.ts","pages/api/oauth/oidc.ts","pages/api/oauth/saml.ts","pages/api/oauth/token.ts","pages/api/oauth/userinfo.ts","pages/api/password.ts","pages/api/scim/v2.0/[...directory].ts","pages/api/sessions/[id].ts","pages/api/sessions/index.ts","pages/api/teams/[slug]/api-keys/[apiKeyId].ts","pages/api/teams/[slug]/api-keys/index.ts","pages/api/teams/[slug]/dsync/[directoryId].ts","pages/api/teams/[slug]/dsync/index.ts","pages/api/teams/[slug]/index.ts","pages/api/teams/[slug]/invitations.ts","pages/api/teams/[slug]/members.ts","pages/api/teams/[slug]/payments/create-checkout-session.ts","pages/api/teams/[slug]/payments/create-portal-link.ts","pages/api/teams/[slug]/payments/products.ts","pages/api/teams/[slug]/permissions.ts","pages/api/teams/[slug]/sso.ts","pages/api/teams/[slug]/webhooks/[endpointId].ts","pages/api/teams/[slug]/webhooks/index.ts","pages/api/teams/index.ts","pages/api/users.ts","pages/api/webhooks/dsync.ts","pages/api/webhooks/stripe.ts","pages/api/well-known/saml.cer.ts","pages/auth/forgot-password.tsx","pages/auth/idp-login.tsx","pages/auth/join.tsx","pages/auth/login.tsx","pages/auth/magic-link.tsx","pages/auth/resend-email-token.tsx","pages/auth/reset-password/[token].tsx","pages/auth/sso/idp-select.tsx","pages/auth/sso/index.tsx","pages/auth/unlock-account.tsx","pages/auth/verify-email-token.tsx","pages/auth/verify-email.tsx","pages/dashboard.tsx","pages/index.tsx","pages/invitations/[token].tsx","pages/settings/account.tsx","pages/settings/security.tsx","pages/teams/[slug]/api-keys.tsx","pages/teams/[slug]/audit-logs.tsx","pages/teams/[slug]/billing.tsx","pages/teams/[slug]/directory-sync.tsx","pages/teams/[slug]/members.tsx","pages/teams/[slug]/products.tsx","pages/teams/[slug]/settings.tsx","pages/teams/[slug]/sso.tsx","pages/teams/[slug]/webhooks.tsx","pages/teams/index.tsx","pages/teams/switch.tsx","pages/well-known/saml-configuration.tsx","playwright.config.ts","postcss.config.js","prisma/migrations/20230625203909_init/migration.sql","prisma/migrations/20230703084002_add_api_keys/migration.sql","prisma/migrations/20230703084117_add_index_user/migration.sql","prisma/migrations/20230720113226_make_password_optional/migration.sql","prisma/migrations/20231109082527_add_account_lockout/migration.sql","prisma/migrations/20240109041326_columns_for_invitation_link/migration.sql","prisma/migrations/20240212105842_stripe/migration.sql","prisma/migrations/20240213160517_indices/migration.sql","prisma/migrations/20240226091046_add_jackson_schema/migration.sql","prisma/migrations/20240316224800_add_index_billing_id/migration.sql","prisma/migrations/20240531124127_expand_jackson_namespace_column/migration.sql","prisma/migrations/migration_lock.toml","prisma/schema.prisma","prisma/seed.ts","public/home-hero.svg","public/logo.png","public/logowhite.png","public/saas-starter-kit-poster.png","public/user-default-profile.jpeg","public/vercel.svg","sentry.client.config.ts","styles/globals.css","styles/sdk-override.module.css","sync-stripe.js","tailwind.config.js","tests/e2e/auth/idp-initiated.spec.ts","tests/e2e/auth/sso.login.spec.ts","tests/e2e/session/session.spec.ts","tests/e2e/settings/api-key.spec.ts","tests/e2e/settings/directory-sync.spec.ts","tests/e2e/settings/members.spec.ts","tests/e2e/settings/team-settings.spec.ts","tests/e2e/support/account.setup.ts","tests/e2e/support/account.teardown.ts","tests/e2e/support/fixtures/api-keys-page.ts","tests/e2e/support/fixtures/consts.ts","tests/e2e/support/fixtures/directory-sync-page.ts","tests/e2e/support/fixtures/index.ts","tests/e2e/support/fixtures/join-page.ts","tests/e2e/support/fixtures/login-page.ts","tests/e2e/support/fixtures/member-page.ts","tests/e2e/support/fixtures/security-page.ts","tests/e2e/support/fixtures/settings-page.ts","tests/e2e/support/fixtures/sso-page.ts","tests/e2e/support/globalSetup.ts","tests/e2e/support/helper.ts","tests/e2e/support/utils/throttling-network-presets.ts","tsconfig.json","types/base.ts","types/index.ts","types/next-auth.d.ts","types/next.ts"],"storefront":"/r/boxyhq","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/boxyhq/saas-starter-kit/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}