Skip to main content

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.

Please complete the following Steps

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.

  1. Create a new project on Supabase by visiting the Supabase Dashboard and following the instructions.

  2. 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.

  1. Run the following command to push migrations to Supabase:

    supabase db push
  2. Verify that all tables, functions, and schemas have been created correctly in the Supabase Database Dashboard.

  3. 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.

  1. Navigate to the Supabase Authentication Settings in the dashboard.
  2. Set your production application URL.
  3. 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โ€‹

  1. Create a Google Cloud Project at Google Cloud Console.
  2. Navigate to APIs & Services โ†’ Credentials.
  3. Configure a new OAuth client ID and set up authorized redirect URIs.
  4. 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.

  1. Navigate to Supabase โ†’ Authentication โ†’ Email Templates.
  2. Modify the templates for:
    • Sign-up Confirmation
    • Password Reset
    • Magic Link
    • Email Change Verification
  3. 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.

  1. Choose an email provider and get SMTP credentials:

  2. 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.

  1. Create a Stripe account: Sign up on Stripe.

  2. Set up webhook endpoints:

    • Add /api/webhooks in Stripe Webhooks.
    • Set the Webhook Signing Secret.
  3. 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โ€‹

  1. Choose a hosting provider:

  2. Configure Deployment Settings:

    • Set Node.js version in the hosting provider.
    • Add all environment variables.
  3. Deploy the app:

    git push origin main
  4. 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!