Easy-to-setup, fully-featured, and customizable NextJS Boilerplate
Prerequisites
v24.x.y
(at the time of writing: 24.1.0)
1.x.y
(at the time of writing: 1.2.15)git@github.com:username/repo-name.git
)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
and CLERK_SECRET_KEY
from the ‘API Keys’ section..env
file later)CLERK_WEBHOOK_SECRET
when we’re testing the app locally and deploying to production. Leave it blank for now.STRIPE_SECRET_KEY
and NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
from the ‘API Keys’ section (‘Developers’ -> ‘API Keys’)NEXT_PUBLIC_STRIPE_PRICE_ID
.env
file later)STRIPE_WEBHOOK_SECRET
when we’re testing the app locally and deploying to production. Leave it blank for now.PLUNK_API_KEY
from Project Settings > API Keys.env
file later)NEXT_PUBLIC_SUPABASE_URL
and NEXT_PUBLIC_SUPABASE_ANON_KEY
from the ‘Connect’ modal on the main Project Dashboard page (click on the ‘Connect’ button) and then go to the ‘App Frameworks’ tabSUPABASE_SERVICE_ROLE_KEY
from the Project Settings
> API Keys
tabDATABASE_URL
(with pgbouncer) and DIRECT_URL
(without pgbouncer) from the same ‘Connect’ modal under the ‘ORMs’ tab.env
file later)Setup via CLI
.env
file..env
file before you start local development.Developing your app locally
brew install ngrok
ngrok http 3000
.env
file to the ngrok URL.https://1234567890.ngrok-free.app
)The reason we need this is to expose our localhost to the public internet, so that we can setup Clerk and Stripe webhooks (which will both send requests to our app in order for us to store those details in our database).Configure
-> Webhooks
-> + Add Endpoint
Endpoint URL
to https://[your-ngrok-url]/api/auth/webhook
Events
to user.created
and user.updated
Create
CLERK_WEBHOOK_SECRET
in your .env
file.stripe listen --forward-to [your-ngrok-url]/api/payments/webhook
in a new terminal (outside of Cursor)STRIPE_WEBHOOK_SECRET
in your .env
file.FRONTEND_URL
in your .env
file with the new ngrok URLCLERK_WEBHOOK_SECRET
in your .env
file.stripe listen --forward-to [the-new-ngrok-url]/api/payments/webhook
in a new terminal (outside of Cursor) and copy the webhook secret in the terminal and update the STRIPE_WEBHOOK_SECRET
in your .env
file..env
fileBuilding the Product
Deploying the App to Production
Setup Analytics
index.html
fileGather User Feedback