Deployment Checklist ๐
Before deploying your JetShip application to production, follow this comprehensive checklist to ensure everything is set up correctly. This guide covers all the essential steps, from configuring Supabase and authentication to setting up payments, environment variables, and deploying your Next.js app.
When you're ready to deploy your project to production, follow this checklist.
Not completing these steps will result in your project not working correctly. Please make sure to complete these steps before testing your project.
This process may take a few hours and some trial and error, so buckle upโyou're almost there!
1. Supabase Setup ๐ฏโ
Creating and Linking a Supabase Projectโ
To start, you need to create a Supabase project and link it to your local development environment.
-
Create a new project on Supabase by visiting the Supabase Dashboard and following the instructions.
-
Link your local project to Supabase using the Supabase CLI. Open your terminal and run:
supabase link --project-ref your-project-ref
This will connect your local development environment to your Supabase instance.
๐ Reference: Supabase CLI Documentation
Database Migrationsโ
Once your project is linked, it's important to apply all pending database migrations to ensure that your database structure is correctly set up.
-
Run the following command to push migrations to Supabase:
supabase db push
-
Verify that all tables, functions, and schemas have been created correctly in the Supabase Database Dashboard.
-
Ensure that Row-Level Security (RLS) is properly configured for each table. RLS is crucial for securing your database and preventing unauthorized access.
๐ Reference: Row-Level Security Guide
2. Authentication Setup ๐โ
Configuring Authentication Settingsโ
Authentication is a critical part of your application. Supabase provides built-in authentication, but you must configure it correctly.
- Navigate to the Supabase Authentication Settings in the dashboard.
- Set your production application URL.
- Add
/auth/callback
to the list of allowed redirect URLs to ensure smooth authentication.
๐ Reference: Supabase Authentication Settings
Setting Up OAuth Providersโ
To allow users to sign in using third-party providers, you need to configure OAuth authentication.
Google OAuth Setupโ
- Create a Google Cloud Project at Google Cloud Console.
- Navigate to APIs & Services โ Credentials.
- Configure a new OAuth client ID and set up authorized redirect URIs.
- Copy the Client ID and Secret and add them to Supabase Authentication Settings.
๐ Reference: Google OAuth Setup Guide
Other OAuth Providersโ
Supabase supports multiple OAuth providers. Set them up as needed:
Configuring Authentication Emailsโ
Supabase sends emails for account confirmation, password reset, and magic links. You should customize the email templates to match your branding.
- Navigate to Supabase โ Authentication โ Email Templates.
- Modify the templates for:
- Sign-up Confirmation
- Password Reset
- Magic Link
- Email Change Verification
- Test each email flow to ensure they are sent correctly.
๐ Reference: Supabase Email Templates
3. Email Configuration ๐งโ
Setting Up SMTP for Sending Emailsโ
Supabase does not provide a built-in email-sending service, so you need to configure an SMTP provider.
-
Choose an email provider and get SMTP credentials:
-
Update your environment variables with the SMTP credentials.
๐ Reference: Supabase Email Setup
4. Payment Integration ๐ณโ
Configuring Stripe Paymentsโ
If your application involves subscriptions or payments, integrate Stripe.
-
Create a Stripe account: Sign up on Stripe.
-
Set up webhook endpoints:
- Add
/api/webhooks
in Stripe Webhooks. - Set the Webhook Signing Secret.
- Add
-
Add your Stripe API keys to environment variables:
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_xxx
STRIPE_SECRET_KEY=sk_live_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
๐ Reference: Stripe Webhook Setup
5. Setting Up Environment Variables ๐โ
The initial deploy will likely fail because you may not yet have a URL to set in your environment variables. This is normal. Once you have the URL, set the URL in the environment variables and redeploy.
๐ Reference: Environment Variables in Vercel
6. Next.js Deployment ๐โ
Deploying Your Applicationโ
-
Choose a hosting provider:
- Recommended: Vercel
-
Configure Deployment Settings:
- Set Node.js version in the hosting provider.
- Add all environment variables.
-
Deploy the app:
git push origin main
-
Verify the deployment:
- Check logs for errors.
- Test authentication and payment flows.
- Confirm environment variables are applied correctly.
๐ Reference: Next.js Deployment Guide
๐ Congratulations! Your JetShip application is now successfully deployed!