Deployment
Follow these steps to deploy your application. While this guide uses Vercel as the deployment platform, you can choose any platform that suits your needs.
Step 1: Prepare Your Application
- Ensure your application is production-ready:
- All environment variables are correctly set in
.env.local
. - The application works locally using
npm run dev
oryarn dev
.
- All environment variables are correctly set in
Step 2: Choose Your Deployment Platform
While this guide focuses on deploying to Vercel, you can choose any deployment platform, such as Netlify, AWS, Heroku, or DigitalOcean.
For Vercel, it’s seamless to deploy with GitHub, GitLab, or Bitbucket integration.
Step 3: Deploy to Vercel
- Go to Vercel and sign up or log in to your account.
- After logging in, click on New Project.
- Choose your Git provider (GitHub, GitLab, or Bitbucket) and select the repository containing your app.
- Vercel will automatically detect the framework (Next.js in this case) and configure the build settings.
- Click Deploy. Vercel will deploy your app, and after a few moments, you’ll receive a production URL.
Environment Variables on Vercel
Make sure to add your environment variables to Vercel:
- Go to the Settings tab of your project on Vercel.
- Under Environment Variables, add the necessary variables that you have in your
.env.local
file (e.g.,LEMONSQUEEZY_API_KEY
,GOOGLE_CLIENT_ID
, etc.). - After adding the environment variables, click Save.
Vercel will automatically rebuild your app whenever you push changes to your connected Git repository.
Step 4: Verify Your Deployment
- After deployment is complete, visit the URL Vercel provided for your project.
- Check if all features are working correctly in the live environment, including authentication, subscription handling, and email sending.
Happy deploying! 🚀