Deployment

Frontend Deployment

Deploy your Nuda Kit frontend to Vercel.

This guide walks you through deploying your Nuda Kit frontend to Vercel. Vercel provides the best deployment experience for Nuxt applications with automatic builds, previews, and global CDN.

Prerequisites

Before deploying, ensure you have:


Step 1: Connect Your Repository

1. Log in to Vercel

Go to vercel.com and sign in with your GitHub account.

2. Import Your Project

  1. Click Add New...Project
  2. Select your Nuda Kit repository from the list
  3. If you don't see it, click Adjust GitHub App Permissions to grant access

Step 2: Configure Project Settings

Since Nuda Kit uses a monorepo structure with separate frontend and backend directories, you need to tell Vercel where your frontend code lives.

Root Directory

Set the Root Directory to:

frontend

This tells Vercel to only deploy the frontend folder.

Framework Preset

Vercel should automatically detect Nuxt.js. If not, select it from the dropdown.

Build Settings

The default settings should work, but verify:

SettingValue
Framework PresetNuxt.js
Root Directoryfrontend
Build Commandnpm run build (default)
Output Directory.output (default)
Install Commandnpm install (default)

Step 3: Configure Environment Variables

Before deploying, add your environment variables in Vercel.

1. Expand the "Environment Variables" section

2. Add the following variable:

NameValueEnvironment
API_BASE_URLhttps://your-backend-domain.comProduction
Important: Replace https://your-backend-domain.com with your actual deployed backend URL. Do not include a trailing slash.

Example Values

EnvironmentAPI_BASE_URL
Productionhttps://api.yourdomain.com
Previewhttps://api-staging.yourdomain.com
You can set different values for Production, Preview, and Development environments by selecting the appropriate checkboxes.

Step 4: Deploy

Click Deploy and wait for the build to complete. Vercel will:

  1. Clone your repository
  2. Navigate to the frontend directory
  3. Install dependencies
  4. Build the Nuxt application
  5. Deploy to the global edge network

The first deployment usually takes 2-3 minutes.


Step 5: Verify Deployment

Once deployed, Vercel will provide you with a URL like:

https://your-project.vercel.app

Visit the URL and verify:

  • The landing page loads correctly
  • You can navigate between pages
  • API calls to your backend work (try signing up or logging in)

Custom Domain (Optional)

To use your own domain:

  1. Go to your project in Vercel
  2. Click SettingsDomains
  3. Add your domain (e.g., app.yourdomain.com)
  4. Follow the DNS configuration instructions

Vercel will automatically provision an SSL certificate.


Automatic Deployments

With GitHub connected, Vercel automatically:

TriggerResult
Push to mainProduction deployment
Push to other branchesPreview deployment
Pull requestPreview deployment with unique URL

This enables you to test changes before merging to production.


Environment Variables Reference

VariableRequiredDescription
API_BASE_URLYesYour backend API URL (e.g., https://api.yourdomain.com)
The frontend only needs API_BASE_URL to communicate with your backend. All other configuration (Stripe, OAuth, etc.) is handled by the backend.

Troubleshooting

IssueSolution
Build fails with "Cannot find module"Ensure Root Directory is set to frontend
API calls return CORS errorsAdd your Vercel domain to allowed origins in your backend
Pages show "500 Internal Server Error"Check that API_BASE_URL is correct and backend is accessible
Environment variables not workingRedeploy after adding/changing environment variables
Old version still showingClear browser cache or wait for CDN propagation (~1 min)

CORS Configuration

If you see CORS errors, ensure your backend allows requests from your Vercel domain. In your backend .env:

FRONTEND_URL=https://your-project.vercel.app

Or for multiple domains, update your CORS configuration to include all your frontend URLs.


Next Steps

Backend Deployment

Deploy your AdonisJS backend.

Stripe Configuration

Configure Stripe for production.