Novel
Get NovelGuidesAPI Reference
Guides
Guides
  • Guides
  • Production Checklist
  • Shipping Fast
    • Speedrun
    • Getting an Idea
    • Buying a Domain
    • Designing your SaaS
    • Pricing
    • Marketing and Distribution
    • Securing your SaaS
    • Troubleshooting
    • Optimizations
    • Integrating your Team
  • Knowledge Base
    • General Information
      • Getting Stripe Keys
      • Getting Postmark Keys
      • Getting Github Oauth Credentials
      • Using AWS S3
      • Using Cloudflare R2
      • Getting VAPID Keys
      • Getting Anthropic API Keys
      • Using Sentry
    • Novel Server
      • Configuring Novel
      • Email Providers
      • Configuring Pricing
      • Creating a REST Endpoint
      • Securing an Endpoint
      • Writing a Middleware
      • Background Jobs
      • Cron Jobs
      • Setting up Oauth
      • Integrating an OAuth Provider
      • Setting up Multi-Factor Authentication
      • Configure Roles and Permissions
      • Creating an Error File
      • Sending Emails
      • Setting up Signups
      • Writing Transactional Email
      • Writing End-to-end Tests
      • Creating a Custom Model
      • Overriding a Model
      • Creating a Feature Flag
      • Adding Rate Limits
      • Requiring Elevated Permission
      • Using Idempotency
      • Check if User is Verified
      • Check if Organization is Subscribed
      • Caching an Endpoint
      • Setting up Cloudflare R2
    • Database
      • Connecting to a Database
      • Creating a Table
      • Writing Queries
      • Writing Mutations / Updates / Deletes
      • Using Validations
    • Novel Web / Next.js
      • Creating a Marketing Page
      • Creating an Application Screen
      • Securing a Page
      • Making a Request to the API
      • Using Generated Requests
      • Applying Styles
      • Using shadcn/ui
      • Writing Tests with Playwright
      • Modifying Content Security Policy
      • Checking a Feature Flag
      • Using Zod in Forms
    • Scaffolding
      • Describing a Background Job
      • Describing a Cron Job
      • Describing a Table
      • Describing an Endpoint
    • Novel Studio
  • Deployment
    • Github Actions
    • Release Pipeline
    • Deploying to Digital Ocean
    • Deploying to Vercel
    • Deploying to AWS EC2 and RDS
    • Deploying to AWS ECS/Fargate and RDS
Powered by GitBook
On this page
  • Proxy Mode
  • Environment Variables

Was this helpful?

  1. Deployment

Deploying to Vercel

There are two ways to deploy novel web in vercel. This assumes that you have the novel server set up in a different location.

  1. proxy mode - use rewrites in next.config.js to proxy all routes from /api /admin /auth /docs into novel server (warning, this may be costly as you scale)

  2. standalone mode - recommended. configure novel server to proxy pages and _next from the novel server location into vercel.

It is up to your preference and comfor where you want to stage your UI and server. The mode you pick now can be changed in the future based on your need.

Proxy Mode

You can run

novel web use proxy

and it will add the relevant rewrites into your next.config.js

If you want to do it manually, the rewrites applied are below

{
    "rewrites": [
    
    ]
}

Remember to add your custom endpoints if you have any. for example, api/v1 is available by default and if you want to add private-api/v1 into it, you need to add [$$$$$$]

Environment Variables

NEXT_PUBLIC_HOST

NEXT_PUBLIC_API_HOST

NEXT_PUBLIC_STRIPE_PUBLIC_TOKEN

NEXT_PUBLIC_GOOGLE_ANALYTICS_ID

NEXT_PUBLIC_SENTRY_DSN

SENTRY_PROJECT

SENTRY_ORG

SENTRY_AUTH_TOKEN

Last updated 5 months ago

Was this helpful?