Deploying Supamode to Vercel

Learn how to deploy Supamode to Vercel

We provide first-class support for deploying Supamode to Vercel.

To deploy Supamode to Vercel, you have to connect your Supamode project to your Vercel account and create two projects using the same repository:

  1. Vite APP: This is the main project that will be deployed to Vercel.
  2. Hono API: This is the API project that will be deployed to Vercel.

Each project has its own vercel.json file that defines the build and deployment process.

Connecting your Supamode project to your Vercel account

For each project, you have to:

  1. Go to the Vercel dashboard and click on "New Project".
  2. Select "Import" and then "Import Git Repository".
  3. Enter the URL of your Supamode repository and click "Import".
  4. Wait for Vercel to build your project.
  5. Once the build is complete, you can access your Supamode project at the URL provided by Vercel.
  6. Set apps/api as the root directory for the API project, and set apps/app as the root directory for the Vite APP project.

Environment variables

Please set the required environment variables for your project.

Client environment variables

Please refer to the Environment variables section for the list of environment variables to set in the Vite APP project.

Server environment variables

Please refer to the Environment variables section for the list of environment variables to set in the Hono API project.

Setting the Proxy URL in the Vite APP project

At apps/app/vercel.json, you need to replace the <api-project-url> (provided as an example) with the URL of the Hono API project that you deployed in Vercel.

json
{
"rewrites": [
{
"source": "/api/:path*",
"destination": "<api-project-url>/:path*"
},
{ "source": "/:path*", "destination": "/" }
]
}

NB: You need to replace <api-project-url> with the URL of the Hono API project that you deployed in Vercel.