Build and start commands
| Command | Script | What it does |
|---|---|---|
npm run build | next build | Compiles the Next.js application for production. |
npm run start | next start | Starts the production Next.js server. |
npm run lint | eslint | Runs the linter. Run this before deploying to catch issues early. |
Deploy Convex functions
Before deploying the Next.js app, deploy your Convex schema and functions to the production Convex deployment:CONVEX_DEPLOYMENT variable (set to prod:your-deployment-name for production), pushes your schema and all Convex functions, and makes them live. Run this whenever you make changes to files in the convex/ directory.
Deploy to Vercel (recommended)
Push your code to GitHub
Make sure your project is in a GitHub repository. Vercel pulls your code directly from GitHub on each deploy.
Import the repository in Vercel
Go to vercel.com/new, click Import Git Repository, and select your DocuSphere repository. Vercel automatically detects that it is a Next.js project.
Add environment variables
In the Vercel project settings, go to Settings > Environment Variables and add all seven required variables with your production values:See the environment variables reference for full descriptions of each variable.
Other platforms
Any platform that supports Node.js 18 or later can host DocuSphere. Runnpm run build to produce the production build, then npm run start to serve it. Set all seven environment variables in the platform’s environment configuration before starting the server.
The Convex dev server (
npx convex dev) and the Next.js dev server (npm run dev) are only needed for local development. In production, use npx convex deploy to deploy Convex functions and npm run start to serve the Next.js app.