Vercel
This guide walks you through deploying WeaveAI to Vercel, a serverless platform.
Prerequisites
Section titled “Prerequisites”Before deploying to Vercel, ensure you have:
- A Git hosting account (GitHub, GitLab, or Bitbucket)
- A Vercel account (free tier available)
Download WeaveAI from CodeCanyon
Section titled “Download WeaveAI from CodeCanyon”-
Download the WeaveAI zip file from your CodeCanyon account
-
Extract the downloaded zip file and navigate to the extracted folder where the app files are located
-
Create a Git Repository on your preferred Git hosting platform:
GitHub:
- Go to GitHub
- Create a new private repository (e.g., “codecanyon-saas-app”)
- Do not initialize with README, .gitignore, or license
GitLab:
- Go to GitLab
- Create a private blank project
Bitbucket:
- Go to Bitbucket
- Create a new private repository
-
Initialize Git and Push Code
Open a terminal in the WeaveAI app directory (where the app files are located) and run:
Terminal window # Initialize git repositorygit init# Add all filesgit add .# Create initial commitgit commit -m "Initial commit: WeaveAI from CodeCanyon"# Add your remote repository (replace with your repository URL)git remote add origin https://github.com/yourusername/codecanyon-saas-app.git# Push to main branchgit branch -M maingit push -u origin mainReplace the repository URL with your actual Git repository URL.
Install Vercel Adapter
Section titled “Install Vercel Adapter”SvelteKit requires a deployment adapter for each platform. Install the Vercel adapter by running this command in terminal while being in the app directory (where the app files are located):
npm install -D @sveltejs/adapter-vercelUpdate your svelte.config.js file on the first line, just change adapter-auto to adapter-vercel:
import adapter from "@sveltejs/adapter-auto"; // change this to @sveltejs/adapter-vercelimport { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
/** @type {import('@sveltejs/kit').Config} */const config = { preprocess: vitePreprocess(),
kit: { adapter: adapter(), },};
export default config;Commit these changes to your repository.
Deploy to Vercel
Section titled “Deploy to Vercel”-
Import Your Project
- Go to Vercel Dashboard
- Click Add New… → Project
- Select your Git provider and authorize Vercel
- Choose your WeaveAI repository and click Import
-
Set Environment Variables
Add your environment variables in the Environment Variables section:
DATABASE_URL- Database connection stringAUTH_SECRET- Auth.js auth secretPUBLIC_ORIGIN- Public Origin URLNODE_ENV- Node Environment
Leave them empty for now, we’ll fill out the values later.
-
Deploy
- Click Deploy
- The first build will fail because
DATABASE_URLdoesn’t have a value yet. This is expected. - Click on Go to Project
Create a Database
Section titled “Create a Database”- Once you’re in the WeaveAI project within the Vercel Dashboard, go to Storage
- Click on Create Database
- In the Create New tab, under Marketplace Database Providers, select Neon and click Continue
- Select your database region (it’s recommended that your database and app are in the same region)
- Leave the “Auth” option disabled, and click Continue
- Provide a name for your database, and click Create
- Once the database has been created, click on Connect
Push Database Schema
Section titled “Push Database Schema”After creating your database, you need to push the database schema. Follow the instructions in the Database Schema documentation to set up your database tables and structure. After that has been done, come back to this page to finish the deployment.
Environment Variables
Section titled “Environment Variables”Now let’s finish configuring the Environment Variables on Vercel:
-
Go to your WeaveAI project in the Vercel Dashboard
-
Go to Settings → Environment Variables
-
We need to configure by adding the values for the following Environment Variables:
DATABASE_URL- This should’ve been automatically configured when we created the Neon database, so just double-check that the value is thereAUTH_SECRET- Use this Generator to generate your Auth.js secretPUBLIC_ORIGIN- This is your app domain (e.g.https://your-domain-name.com)NODE_ENV- Addproduction
-
Each time you update an Environment Variable, you’ll get a notification from Vercel in the bottom right corner asking you to Redeploy the app. You will need to Redeploy the app after you’ve changed the last Environment Variable so all the changes can take effect.
Custom Domain
Section titled “Custom Domain”- While being in the WeaveAI project, go to Settings → Domains
- Click on Add Domain
- Add your domain
- Update the DNS records as instructed by Vercel
Updating the app
Section titled “Updating the app”Vercel automatically deploys your application when you push to your repository:
- Production Branch: Commits to
mainormasterdeploy to production - Preview Deployments: All other branches get preview URLs
When there’s a new WeaveAI update, you will need to download and extract the .zip file in your existing folder that’s linked to your git repo, and push the changes. Vercel will detect the changes on your git repo and automatically deploy the latest version.