Now that we’ve gone through the basics of creating a full-stack serverless app, you are ready to deploy it to production.

Deploy to Prod

We are now going to deploy our app to prod. You can go ahead and stop the local development environments for SST and React.

Change indicator Run the following in your project root.

$ pnpm sst deploy --stage prod

This command will take a few minutes as it’ll deploy your app to a completely new environment. Recall that we are deploying to a separate prod environment because we don’t want to affect our users while we are actively developing our app. This ensures that we have a separate local dev environment and a separate prod environment.

At the end of the deploy process you should see something like this.

✓  Deployed:

Set Secrets in Prod

We also need to configure out secrets for production. You’ll recall we had previously configured secrets for our local stage.

We’ll do the same here but for prod.

Change indicator Run the following in your project root.

$ pnpm sst secrets set --stage prod STRIPE_SECRET_KEY <YOUR STRIPE SECRET TEST KEY>

You can run pnpm sst secrets list to see the secrets for the current stage.

Our full-stack serverless app is almost ready to go. You can play around with the prod version.

Custom Domains

However the API is currently on an endpoint that’s auto-generated by API Gateway.

And the frontend React app is hosted on an auto-generated CloudFront domain.

We want to host these on our own domain. Let’s look at that next.