This guide will help you to deploy your Nuxt application to various platforms with best practices and optimization strategies.
As far as Nuxtbe is a Kit built on top of Nuxt, it's easy to deploy it to any platform that supports Nuxt. You may find all available options here: Nuxt Deployment.
Nuxtbe has prerendering and incremental static regeneration enabled for next pages:
export default defineNuxtConfig({
routeRules: {
'/': {
prerender: true,
isr: true,
},
'/license': {
prerender: true,
isr: true,
},
'/privacy-policy': {
prerender: true,
isr: true,
},
'/terms-of-service': {
prerender: true,
isr: true,
},
'/faq': {
prerender: true,
isr: true,
},
'/docs': {
prerender: true,
isr: true,
},
},
})
You may want to add more pages to the prerendering list or completely disable it. Overall it's a good idea to prerender documentation pages, blog posts, or landing page.
More information about Nuxt rendering modes can be found here: Nuxt Rendering Modes.
Ensure that you have all the environment variables set up in your deployment platform. You may remove unused variables, for example if you use LemonSqueezy, you don't need to set up Stripe variables.
# Supabase Configuration
# URL of your Supabase project (found in Project Settings > API)
SUPABASE_URL="Your Supabase URL"
# Anon/Public key for client-side API calls (found in Project Settings > API)
SUPABASE_KEY="Your Supabase Key"
# Service role key for server-side API calls
SUPABASE_SERVICE_KEY="Your Supabase Service Key"
# Stripe Configuration
# Secret key for server-side Stripe API calls
STRIPE_SERVER_SECRET_KEY="Your Stripe Server Secret Key"
# Secret for verifying Stripe webhook signatures
STRIPE_WEBHOOK_SECRET="Your Stripe Webhook Secret"
# Resend Email Service Configuration
# API key for Resend email service
RESEND_API_KEY="Your Resend API Key"
# Audience ID for email targeting
RESEND_AUDIENCE_ID="Your Resend Audience ID"
# Secret for email webhook verification
SEND_EMAIL_HOOK_SECRET="Your Send Email Hook Secret"
# LemonSqueezy Configuration
# API key for LemonSqueezy integration
LEMONSQUEEZY_API_KEY="Your Lemonsqueezy API Key"
# Webhook secret for Supabase integration
LEMONSQUEEZY_WEBHOOK_SECRET_SUPABASE="Your Lemonsqueezy Webhook Secret for Supabase"
# General webhook secret for LemonSqueezy
LEMONSQUEEZY_WEBHOOK_SECRET="Your Lemonsqueezy Webhook Secret"
If you don't need some of the dependencies, you can remove them from the package.json
and nuxt.config.ts
files. For example, if you don't need Stripe because you use LemonSqueezy, you can remove it from the package.json
and nuxt.config.ts
files. Also, you can remove unused files from the app/api
folder. Like stripe.post.ts
.