This is a robust boilerplate solution crafted with Next.js 14, Clerk, MongoDB, and Stripe, seamlessly integrated with webhooks for enhanced functionality. Ideal for building SaaS applications with ease. π
git clone https://github.com/iamsrikanthnani/saas-app.git
cd saas-app
npm install
cp .env.example .env
Fill in the following environment variables:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
: Your Clerk Publishable Key. Get this from clerk dashboard.CLERK_SECRET_KEY
: Your Clerk Secret Key. Get this from clerk dashboard.MONGODB_HOST
: Your MongoDB host URL.
- Go to the clerk dashboard and on the sidebar click on
webhooks
, and clickadd endpoint
. - Enable the following webhook events:
user.created
,user.deleted
,user.updated
. - Set the Endpoint URL as:
https://[your-deployed-url]/api/webhooks/user
. - copy
Signing Secret
from Webhooks and paste it in env =>CLERK_WEBHOOK_SECRET
. - still not working? checkout Webhook docs
- Go to the sripe dashboard and click on
webhooks
, and clickadd an endpoint
. - Enable the following webhook event:
checkout.session.completed
. - Set the Endpoint URL as:
https://[your-deployed-url]/api/webhooks/stripe
. - copy
Signing Secret
from Webhooks and paste it in env =>STRIPE_WEBHOOK_SECRET
. - still not working? checkout Webhook docs
npm run dev
This will start the development server. at localhost:3000
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
Thank you for checking out the SaaS Boilerplate! I hope this boilerplate helps you kickstart your SaaS projects. If you have any questions or suggestions, feel free to open an issue or submit a pull request.
Don't forget to visit my portfolio for more projects and updates!
π Keep coding and building amazing things!