This guide provides two options for deploying your frontend: using Railway (which deploys frontend, backend, and MongoDB together) or Vercel (frontend-only deployment).
Railway is an all-in-one platform for deploying full-stack applications, including the frontend, backend, and database. You can use the provided template for a seamless deployment experience.
Once deployed, Railway provides a unique URL for your application.
Vercel is a platform optimized for frontend deployments. It is the simplest way to deploy your Next.js frontend.
# Default build settings for Next.js
Framework: Next.js
Build Command: next build
Output Directory: .next
NEXT_PUBLIC_API_URL
NEXT_PUBLIC_APP_URL
NEXT_PUBLIC_POSTHOG_HOST
NEXT_PUBLIC_POSTHOG_KEY
Once deployed, Vercel will provide a URL for your frontend application, and it will automatically manage previews and production builds for you.
For further assistance, refer to the official documentation of Railway and Vercel.