Setup
Create a.env.local file in the root directory of your project with the required environment variables.
Required Variables
Public API Configuration
These variables are prefixed withNEXT_PUBLIC_ and are exposed to the browser.
The base URL for your API endpoints. This is used for making API requests from the client-side.Development:
http://localhost:3000/apiProduction: https://your-domain.com/apiThe URL for the Socket.IO server that handles real-time collaboration features.Development:
http://localhost:3000Production: https://your-domain.comThe endpoint URL for file uploads. Noteverse uses Vercel Blob for edge-compatible blob storage.Example:
https://your-storage-endpoint.vercel-storage.comAuthentication (NextAuth.js)
The canonical URL of your site. This is used by NextAuth.js for redirects and callbacks.Development:
http://localhost:3000Production: https://your-domain.comA random string used to encrypt tokens, sign cookies, and generate cryptographic keys. Generate a secure secret using:
Database
PostgreSQL connection string for Prisma ORM. This should include the username, password, host, port, and database name.Format:
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=publicExample: postgresql://noteverse_user:password123@localhost:5432/noteverse_dbOptional Variables
Google OAuth (Optional)
If you want to enable Google authentication, add these variables:Google OAuth Client ID. Obtain this from the Google Cloud Console.
Google OAuth Client Secret. Keep this confidential.
Environment-Specific Configuration
Development
Production
For production deployments on Vercel, set these environment variables in your project settings under Settings > Environment Variables.
Verification
After setting up your environment variables, verify they are loaded correctly:.env.local file.
Troubleshooting
Next Steps
Authentication Setup
Configure NextAuth.js for user authentication
Database Setup
Set up PostgreSQL and Prisma ORM