Notice! this starter kit isn't fully finished, but I'm just making this public for now if anyone wants to add onto it. I'm getting burned out on working on this so I'm open to anyone wanting to help contribute to fixing up any bugs they find, etc.
You can join the discord if you want to talk about the code here or suggest features / etc.
For those wanting more hands on video walkthrough content that explains this code base, shows how to deploy it, and how to maintain it in production, I'm working on a paid video walkthrough series found here https://webdevcody.gumroad.com/l/wdc-saas-starter-kit-walkthrough. I'm in the process of recording and editing videos, but if you purchase now it's 50% off the original pricing.
Welcome to the WDC Next.js Starter Kit! This is a github template which contains the following technology we feel is a great starting point for any new SaaS product:
If you find obvious issues with this starter kit, feel free to submit a pull request or submit and issue. We want to keep this starter simple with the core technology picked, so we don't recommend trying to add in various things without prior approval.
Start by clicking the "use this template" button on the github repo. We suggest creating a new repository so you can track your code changes. After, clone your own repository down to your computer and start working on it.
This starter kit does uses Docker and Docker Compose to run a postgres database, so you will need to either have those installed, or modify the project to point to a hosted database solution.
cp .env.sample .env
npm i
docker compose up
npm run db:migrate
npm run dev
This starter kit depends on a few external services, such as google oauth, stripe, and resend. You'll need to following the steps below and make sure everything is setup and copy the necesssary values into your .env file:
Create an account on https://resend.com/ and generate an api key and paste into EMAIL_SERVER_PASSWORD
Setup your domain in resend so that you can send emails from your custom domain and set EMAIL_FROM to match your expected from line. To do this, go to your domain provider and add the necessary records outlined in resend.
TODO: add info about bucket and keys
This starter kit uses postgres. Supabase provides 2 free postgres database. Setup a database and get your DATABASE_URL.
This starter kit uses stripe which means you'll need to setup a stripe account at https://stripe.com. After creating an account and a project, you'll need to set the following env variables:
How you can find these are outlined below:
You need to define both NEXT_PUBLIC_STRIPE_KEY and STRIPE_API_KEY inside of .env. These can get found here:
Depending on if you are developing locally or deploying to prod, there are two paths you need to take for getting a webhook key:
brew install stripe/stripe-cli/stripe
stripe:listen
you can run if you want to setup your locally running application to listsen for any stripe events. Run this command and copy the webhook secret it prints to the console into your .env file.When going to production, you'll need to create a webhook endpoint and copy your webhook secret into _STRIPE_WEBHOOKSECRET:
You'll need to create a subscription product in stripe:
Stripe has a built in way for customers to cancel their subscriptions. You'll need to enable this feature:
When deplying to production, you want to set HOST_NAME to your FQDN, such as https://you-domain.com
By default, this starter only comes with the google provider which you'll need to setup:
TODO: add info