Before going to production, it's essential to follow certain precautions to avoid failures.
First, we must safely inject the correct environment variables into their relative environment. MakerKit has predefined templates that allow you to understand where each variable should be added.
Before publishing your SaaS, or if you are making a production release after a change and this included an environment variable; ensure your CI provider is up to date with the correct variable in the right environments.
.env file will not be committed to your repository, you will
need to add the environment variables beforehand.
If you are using Supabase, you will need to ensure that your RLS policies are set up correctly, and that the changes are propagated to the production database.
If you are using Supabase, you will need to ensure that your database schema is in sync with your remote Supabase database.
You can do this using the Supabase CLI: for more information, please refer to the Supabase CLI documentation.
More specifically, you need to run the following command:
supabase db push
You may need to link your Supabase project to your local Supabase CLI instance first.
After running this command, navigate to your Supabase project and check that the database schema is in sync with your local database schema.
We need to add the app's URL to the Supabase Auth settings. To do this, navigate to the "Auth" tab in your project's dashboard and then navigate to the "URL Configuration" tab.
- Site URL: set up the "Site URL" field using your Vercel URL
- Redirect URLs: set the "Redirect URLs" field using the following URL:
This is fundamental, as it will allow Supabase to redirect users back to our application after they log in.
Remember to complete your Stripe account's information and enable billing and to not forget it in
Additionally, you will need to add your Stripe API keys to the environment variables to process payments. Ensure you have added the correct keys to the correct environment and that have selected all the required events to your webhook.
Please follow the Stripe configuration guide to configure your Stripe account.
If you use Lemon Squeezy - the same applies.
You will need to add your SMTP service credentials to the environment variables to send emails. This is required for sending emails to users when they are invited to an organization.
To set the credentials, add them to the environment variables in the correct environment.
Remember to do the same for your email templates in Supabase - as the limits are extremely low in the free plan.
You will need to configure the image remote patterns in your Next.js configuration to allow the images to be served from the correct domain. This needs to match the domain of your Supabase Storage bucket domain - and other eventual domains you may be using to serve your images.
Follow the Supabase guide to ensure you have followed all the steps to deploy your application to production.
With 4000 events for free per month, we recommend that you use Sentry.io for ensuring you can catch, analyze and fix any runtime errors in your application that your users will encounter.
We recommend that you use a logging service to log any events that occur in your application. This will allow you to debug any issues that may occur in your application.
Some logging services that we recommend are: